From 8fafb4e45f5c7ac8278b476970fc49849307ba47 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 4 Nov 2019 12:31:48 -0600 Subject: [PATCH 001/430] Add validate and testing actions pipeline --- .github/workflows/go.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..20458a48 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,27 @@ +on: + pull_request: + push: + branches: + - master + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + name: Validate/Test + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + - name: validate + run: | + # Check that go mod tidy produces a zero diff; clean up any changes afterwards. + go mod tidy && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go vet ./... produces a zero diff; clean up any changes afterwards. + go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. + go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + - name: test + run: go test -cover ./... From a68374b67e7a478f32b110095f4bb7568bdfede0 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Mon, 4 Nov 2019 15:15:55 -0600 Subject: [PATCH 002/430] Break actions out by event --- .../workflows/{go.yml => pull_request.yml} | 26 ++++++++++++------- .github/workflows/push.yml | 22 ++++++++++++++++ .github/workflows/tag.yml | 24 +++++++++++++++++ 3 files changed, 62 insertions(+), 10 deletions(-) rename .github/workflows/{go.yml => pull_request.yml} (73%) create mode 100644 .github/workflows/push.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/go.yml b/.github/workflows/pull_request.yml similarity index 73% rename from .github/workflows/go.yml rename to .github/workflows/pull_request.yml index 20458a48..f4f59a51 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/pull_request.yml @@ -1,20 +1,17 @@ +name: Pull Request Actions on: pull_request: - push: - branches: - - master - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - + jobs: - build: - name: Validate/Test + validate: + name: validate runs-on: ubuntu-latest container: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v1 + - name: validate run: | # Check that go mod tidy produces a zero diff; clean up any changes afterwards. @@ -23,5 +20,14 @@ jobs: go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + + test: + name: test + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 - name: test - run: go test -cover ./... + run: go test -cover ./... diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..234778c0 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,22 @@ +name: Push Request Actions +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: clone + uses: actions/checkout@master + + - name: build + run: make build + + - name: publish + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela/worker + cache: true + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..577d4684 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,24 @@ +name: Tag Request Actions +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: clone + uses: actions/checkout@master + + - name: build + run: make build + + - name: publish + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela/worker + cache: true + tag_names: true + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} From aee31832d4b2ebc44ba36164123ffc83be241e6f Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Mon, 4 Nov 2019 15:21:24 -0600 Subject: [PATCH 003/430] Add Dockerfile --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e5ac1bc4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM scratch + +EXPOSE 8080 + +ENV GODEBUG=netdns=go + +ADD release/vela-worker /bin/ + +CMD ["/bin/vela-worker"] \ No newline at end of file From b5f10f37f556fcc1b86c5e0f17828fb0a9c55b68 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Mon, 4 Nov 2019 15:37:39 -0600 Subject: [PATCH 004/430] make clean --- executor/linux/linux.go | 6 ++--- executor/linux/linux_test.go | 2 +- executor/linux/secret_test.go | 6 ++--- go.mod | 8 +++++++ go.sum | 43 +++++++++++++++++++++++++++++++++-- router/middleware/header.go | 2 +- router/middleware/logger.go | 2 +- router/router.go | 2 +- runtime/docker/docker.go | 2 +- runtime/docker/network.go | 2 +- runtime/docker/volume.go | 2 +- 11 files changed, 62 insertions(+), 15 deletions(-) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 3162c3d9..395c7ce7 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -10,15 +10,15 @@ import ( "github.com/go-vela/worker/executor" - "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) type client struct { - Vela *vela.Client + Vela *vela.Client Runtime runtime.Engine Secrets map[string]*library.Secret Hostname string @@ -56,7 +56,7 @@ func New(c *vela.Client, r runtime.Engine) (*client, error) { }) return &client{ - Vela: c, + Vela: c, Runtime: r, Hostname: h, logger: l, diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index c8a05491..4ba442d4 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -8,10 +8,10 @@ import ( "reflect" "testing" - "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/docker" ) func TestLinux_WithBuild(t *testing.T) { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 90ee2a1b..c4322d4c 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -9,12 +9,12 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/sdk-go/vela" + "github.com/gin-gonic/gin" "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/gin-gonic/gin" + "github.com/go-vela/worker/runtime/docker" "github.com/google/go-cmp/cmp" ) diff --git a/go.mod b/go.mod index cdb811ca..9cf1d16d 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,8 @@ module github.com/go-vela/worker go 1.13 require ( + github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect + github.com/Microsoft/go-winio v0.4.14 // indirect github.com/coreos/go-semver v0.3.0 github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 @@ -15,12 +17,18 @@ require ( github.com/go-vela/sdk-go v0.1.0 github.com/go-vela/types v0.1.0 github.com/google/go-cmp v0.3.1 + github.com/gorilla/mux v1.7.3 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/onsi/ginkgo v1.10.3 // indirect + github.com/onsi/gomega v1.7.1 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.4.2 github.com/urfave/cli v1.22.1 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect google.golang.org/grpc v1.24.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 + gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index 18ed0dfa..6db720eb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -16,19 +20,20 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee 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/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= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 h1:w3NnFcKR5241cfmQU5ZZAsf0xcpId6mWOupTvJlUX2U= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ= @@ -48,6 +53,7 @@ github.com/go-vela/types v0.1.0 h1:N/xN928jo0nIPIL7F7DugL98E4BGXVv0y5O8ywrpAsg= github.com/go-vela/types v0.1.0/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -61,9 +67,15 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= @@ -73,10 +85,19 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -84,6 +105,7 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -105,11 +127,13 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD 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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -118,25 +142,32 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -145,14 +176,22 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/router/middleware/header.go b/router/middleware/header.go index 0b29387b..ded2a488 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/go-vela/worker/version" "github.com/gin-gonic/gin" + "github.com/go-vela/worker/version" ) // NoCache is a middleware function that appends headers diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 8add0e42..eae2651a 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -42,7 +42,7 @@ func Logger(logger *logrus.Logger, timeFormat string, utc bool) gin.HandlerFunc "path": path, "ip": c.ClientIP(), "latency": latency, - "user-worker": c.Request.UserAgent(), + "user-worker": c.Request.UserAgent(), "time": end.Format(timeFormat), } diff --git a/router/router.go b/router/router.go index ca6ea807..946e912e 100644 --- a/router/router.go +++ b/router/router.go @@ -5,9 +5,9 @@ package router import ( + "github.com/gin-gonic/gin" "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware" - "github.com/gin-gonic/gin" ) const ( diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 0debe212..4ca5db6f 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -5,8 +5,8 @@ package docker import ( - "github.com/go-vela/worker/runtime/docker/testdata/mock" docker "github.com/docker/docker/client" + "github.com/go-vela/worker/runtime/docker/testdata/mock" "github.com/sirupsen/logrus" ) diff --git a/runtime/docker/network.go b/runtime/docker/network.go index fb7346f5..0ce14f08 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -7,9 +7,9 @@ package docker import ( "context" - "github.com/go-vela/types/pipeline" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" + "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 7bb60ec3..b1c4d82a 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -7,8 +7,8 @@ package docker import ( "context" - "github.com/go-vela/types/pipeline" types "github.com/docker/docker/api/types/volume" + "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) From 9b23428e42815f4849ff73e0371962f3d33a4f99 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 4 Nov 2019 18:01:23 -0600 Subject: [PATCH 005/430] fmt and clean go files --- executor/linux/linux.go | 6 ++--- executor/linux/linux_test.go | 2 +- executor/linux/secret_test.go | 6 ++--- go.mod | 8 +++++++ go.sum | 43 +++++++++++++++++++++++++++++++++-- router/middleware/header.go | 2 +- router/middleware/logger.go | 2 +- router/router.go | 2 +- runtime/docker/docker.go | 2 +- runtime/docker/network.go | 2 +- runtime/docker/volume.go | 2 +- 11 files changed, 62 insertions(+), 15 deletions(-) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 3162c3d9..395c7ce7 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -10,15 +10,15 @@ import ( "github.com/go-vela/worker/executor" - "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) type client struct { - Vela *vela.Client + Vela *vela.Client Runtime runtime.Engine Secrets map[string]*library.Secret Hostname string @@ -56,7 +56,7 @@ func New(c *vela.Client, r runtime.Engine) (*client, error) { }) return &client{ - Vela: c, + Vela: c, Runtime: r, Hostname: h, logger: l, diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index c8a05491..4ba442d4 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -8,10 +8,10 @@ import ( "reflect" "testing" - "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/docker" ) func TestLinux_WithBuild(t *testing.T) { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 90ee2a1b..c4322d4c 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -9,12 +9,12 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/sdk-go/vela" + "github.com/gin-gonic/gin" "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/gin-gonic/gin" + "github.com/go-vela/worker/runtime/docker" "github.com/google/go-cmp/cmp" ) diff --git a/go.mod b/go.mod index cdb811ca..9cf1d16d 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,8 @@ module github.com/go-vela/worker go 1.13 require ( + github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect + github.com/Microsoft/go-winio v0.4.14 // indirect github.com/coreos/go-semver v0.3.0 github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 @@ -15,12 +17,18 @@ require ( github.com/go-vela/sdk-go v0.1.0 github.com/go-vela/types v0.1.0 github.com/google/go-cmp v0.3.1 + github.com/gorilla/mux v1.7.3 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/onsi/ginkgo v1.10.3 // indirect + github.com/onsi/gomega v1.7.1 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.4.2 github.com/urfave/cli v1.22.1 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect google.golang.org/grpc v1.24.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 + gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index 18ed0dfa..6db720eb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -16,19 +20,20 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee 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/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= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 h1:w3NnFcKR5241cfmQU5ZZAsf0xcpId6mWOupTvJlUX2U= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ= @@ -48,6 +53,7 @@ github.com/go-vela/types v0.1.0 h1:N/xN928jo0nIPIL7F7DugL98E4BGXVv0y5O8ywrpAsg= github.com/go-vela/types v0.1.0/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -61,9 +67,15 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= @@ -73,10 +85,19 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -84,6 +105,7 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -105,11 +127,13 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD 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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -118,25 +142,32 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -145,14 +176,22 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/router/middleware/header.go b/router/middleware/header.go index 0b29387b..ded2a488 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/go-vela/worker/version" "github.com/gin-gonic/gin" + "github.com/go-vela/worker/version" ) // NoCache is a middleware function that appends headers diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 8add0e42..eae2651a 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -42,7 +42,7 @@ func Logger(logger *logrus.Logger, timeFormat string, utc bool) gin.HandlerFunc "path": path, "ip": c.ClientIP(), "latency": latency, - "user-worker": c.Request.UserAgent(), + "user-worker": c.Request.UserAgent(), "time": end.Format(timeFormat), } diff --git a/router/router.go b/router/router.go index ca6ea807..946e912e 100644 --- a/router/router.go +++ b/router/router.go @@ -5,9 +5,9 @@ package router import ( + "github.com/gin-gonic/gin" "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware" - "github.com/gin-gonic/gin" ) const ( diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 0debe212..4ca5db6f 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -5,8 +5,8 @@ package docker import ( - "github.com/go-vela/worker/runtime/docker/testdata/mock" docker "github.com/docker/docker/client" + "github.com/go-vela/worker/runtime/docker/testdata/mock" "github.com/sirupsen/logrus" ) diff --git a/runtime/docker/network.go b/runtime/docker/network.go index fb7346f5..0ce14f08 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -7,9 +7,9 @@ package docker import ( "context" - "github.com/go-vela/types/pipeline" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" + "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 7bb60ec3..b1c4d82a 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -7,8 +7,8 @@ package docker import ( "context" - "github.com/go-vela/types/pipeline" types "github.com/docker/docker/api/types/volume" + "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) From aaceee5c03b4ac295f958f505252edbe9f50c6ee Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 4 Nov 2019 18:26:56 -0600 Subject: [PATCH 006/430] add certs to docker image --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e5ac1bc4..ccd6b9cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,19 @@ +# Copyright (c) 2019 Target Brands, Inc. All rights reserved. +# +# Use of this source code is governed by the LICENSE file in this repository. + +FROM alpine as certs + +RUN apk add --update --no-cache ca-certificates + FROM scratch +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt + EXPOSE 8080 ENV GODEBUG=netdns=go ADD release/vela-worker /bin/ -CMD ["/bin/vela-worker"] \ No newline at end of file +CMD ["/bin/vela-worker"] From 89e187046ea63dec50baeaa0fe04276fcc7317e1 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 5 Nov 2019 13:25:23 -0600 Subject: [PATCH 007/430] split out actions pipeline per task --- .github/workflows/build.yml | 17 +++++++++++ .github/workflows/{tag.yml => publish.yml} | 22 ++++++++------ .github/workflows/push.yml | 22 -------------- .github/workflows/release.yml | 30 +++++++++++++++++++ .github/workflows/test.yml | 17 +++++++++++ .../{pull_request.yml => validate.yml} | 26 +++++----------- 6 files changed, 85 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{tag.yml => publish.yml} (51%) delete mode 100644 .github/workflows/push.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml rename .github/workflows/{pull_request.yml => validate.yml} (64%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..73252204 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: Build Action +on: + pull_request: + push: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + + - name: clone + uses: actions/checkout@v1 + + - name: build + run: make build diff --git a/.github/workflows/tag.yml b/.github/workflows/publish.yml similarity index 51% rename from .github/workflows/tag.yml rename to .github/workflows/publish.yml index 577d4684..89c1fde0 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/publish.yml @@ -1,24 +1,28 @@ -name: Tag Request Actions +name: Publish Action on: push: - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - + branches: [ master ] + jobs: - build: + publish: runs-on: ubuntu-latest + container: + image: golang:latest steps: + - name: clone uses: actions/checkout@master - + - name: build - run: make build + env: + GOOS: linux + CGO_ENABLED: '1' + run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server - name: publish uses: elgohr/Publish-Docker-Github-Action@master with: - name: target/vela/worker + name: target/vela-worker cache: true - tag_names: true username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 234778c0..00000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Push Request Actions -on: - push: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: clone - uses: actions/checkout@master - - - name: build - run: make build - - - name: publish - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: target/vela/worker - cache: true - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fbc4219a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release Action +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + release: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + + - name: clone + uses: actions/checkout@master + + - name: build + env: + GOOS: linux + CGO_ENABLED: '1' + run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server + + - name: publish + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela-worker + cache: true + tag_names: true + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..83a0acfb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: Test Action +on: + pull_request: + push: + +jobs: + test: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + + - name: clone + uses: actions/checkout@v1 + + - name: test + run: go test -cover -coverprofile coverage.out ./... diff --git a/.github/workflows/pull_request.yml b/.github/workflows/validate.yml similarity index 64% rename from .github/workflows/pull_request.yml rename to .github/workflows/validate.yml index f4f59a51..f3a2c663 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/validate.yml @@ -1,33 +1,23 @@ -name: Pull Request Actions -on: +name: Validate Action +on: pull_request: + push: jobs: validate: - name: validate runs-on: ubuntu-latest container: image: golang:latest steps: + - name: clone - uses: actions/checkout@v1 - + uses: actions/checkout@v1 + - name: validate run: | # Check that go mod tidy produces a zero diff; clean up any changes afterwards. go mod tidy && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go vet ./... produces a zero diff; clean up any changes afterwards. - go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. - go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - - test: - name: test - runs-on: ubuntu-latest - container: - image: golang:latest - steps: - - name: clone - uses: actions/checkout@v1 - - name: test - run: go test -cover ./... + go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) From 0587816269077501babc47ca854424fcd355767c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 5 Nov 2019 18:03:42 -0600 Subject: [PATCH 008/430] use goveralls to report test coverage to coveralls --- .github/workflows/test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83a0acfb..ef7c9ea0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,18 @@ jobs: container: image: golang:latest steps: - - name: clone uses: actions/checkout@v1 + - name: install + run: | + go get github.com/mattn/goveralls + - name: test - run: go test -cover -coverprofile coverage.out ./... + run: | + go test -covermode=count -coverprofile=coverage.out ./... + + - name: coveralls + run: | + # https://github.com/mattn/goveralls#goveralls + $GOPATH/bin/goveralls -service=actions -coverprofile=coverage.out -repotoken=${{ secrets.COVERALLS_TOKEN }} From 532c9705e948ea1959d1025aa8e735bd1bf8d98f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 7 Nov 2019 11:34:56 -0600 Subject: [PATCH 009/430] add badges to readme --- .github/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/README.md b/.github/README.md index 08b23a5f..bdca36fd 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,5 +1,9 @@ # worker +[![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) +[![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) +[![Coverage Status](https://coveralls.io/repos/go-vela/worker/badge.svg?branch=master)](https://coveralls.io/r/go-vela/worker?branch=master) + Vela is a Pipeline Automation (CI/CD) framework built on [Linux container](https://linuxcontainers.org/) technology written in [Golang](https://golang.org/). Vela uses a syntax similar to [Docker Compose](https://docs.docker.com/compose/) to define its configuration. This structure for repeated use, within the application, is called a pipeline and a single execution of a pipeline is referenced as a build. From 5750b3b208fc390d98f8567b89df53635fe97cc4 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Thu, 7 Nov 2019 12:39:06 -0600 Subject: [PATCH 010/430] Update agent to build no C static links --- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 89c1fde0..09508aee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: - name: build env: GOOS: linux - CGO_ENABLED: '1' + CGO_ENABLED: '0' run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server - name: publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fbc4219a..e3514b0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: build env: GOOS: linux - CGO_ENABLED: '1' + CGO_ENABLED: '0' run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server - name: publish From 83f4f1287f985c87f5dc891ee7eb841eaf8f1426 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 8 Nov 2019 08:55:55 -0600 Subject: [PATCH 011/430] set proper version for vela --- router/middleware/header_test.go | 8 ++++---- version/version.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index a48fa7b3..f19bda9b 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.1.1" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.1.1" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.1.1" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.1.1" // setup context resp := httptest.NewRecorder() diff --git a/version/version.go b/version/version.go index 98fd28d4..c43c9753 100644 --- a/version/version.go +++ b/version/version.go @@ -10,9 +10,9 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor int64 = 5 + VersionMinor int64 = 1 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 + VersionPatch int64 = 1 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From 524e49d079704a2b8f16da04d7b8d02e06d12a8c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 8 Nov 2019 14:38:03 -0600 Subject: [PATCH 012/430] upgrade vela dependencies for login bug --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 9cf1d16d..5c91f885 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.0 - github.com/go-vela/sdk-go v0.1.0 - github.com/go-vela/types v0.1.0 + github.com/go-vela/mock v0.1.1 + github.com/go-vela/sdk-go v0.1.1 + github.com/go-vela/types v0.1.1 github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 6db720eb..62792a58 100644 --- a/go.sum +++ b/go.sum @@ -45,12 +45,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.1.0 h1:I8a1MfIS7wfP8Ngp/+BdczxlRAn7N1zGDmU+90xRk2I= -github.com/go-vela/mock v0.1.0/go.mod h1:BoAQq97nVkieL4o0aWBkEhoeLTChDIkdfw2fr4eqnX8= -github.com/go-vela/sdk-go v0.1.0 h1:WFBANzOvmng3PZYxSzcyzhSV1XL+r0xKi6Ihwa+NxCs= -github.com/go-vela/sdk-go v0.1.0/go.mod h1:n9VChWpRCp5yT7UEfbVEEzSrhd6q2Sv0PBsh9MC8GGA= -github.com/go-vela/types v0.1.0 h1:N/xN928jo0nIPIL7F7DugL98E4BGXVv0y5O8ywrpAsg= -github.com/go-vela/types v0.1.0/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= +github.com/go-vela/mock v0.1.1 h1:l/W0bBUJlFi3cs/lfzU/NxfyBAJisR4Zuq5OmPbvVII= +github.com/go-vela/mock v0.1.1/go.mod h1:feFnPD27oy3xTCDGYqbSvfbfR0JgZh5NaQaC4XFFwRU= +github.com/go-vela/sdk-go v0.1.1 h1:LCMtEZSvu4dizWEZjyJ/z8CvUtzfUkdvJ96UlQFA7OY= +github.com/go-vela/sdk-go v0.1.1/go.mod h1:Uhxu8oN1DWTlsh+4QaiU0t9cTFhguzq5bF4pWy3FdZE= +github.com/go-vela/types v0.1.1 h1:mCZzTZsw2BFachgRns0I3FcmyFn2njfSJhx/celju4k= +github.com/go-vela/types v0.1.1/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= From 2dd85a144b57867839ac99a39dbb32998badd171 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Sun, 10 Nov 2019 19:48:01 -0600 Subject: [PATCH 013/430] refactor(gofmt): adjust formatting for gofmt warnings --- executor/linux/secret_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index c4322d4c..3b640ae3 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -116,7 +116,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Images: &[]string{""}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -126,7 +126,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Images: &[]string{"alpine"}, Events: &[]string{}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine"}, Events: &[]string{}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, @@ -136,7 +136,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Images: &[]string{"alpine:latest"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine:latest"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, @@ -146,7 +146,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Images: &[]string{"centos"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -163,7 +163,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -178,7 +178,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, @@ -193,7 +193,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -208,7 +208,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, @@ -225,7 +225,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -240,7 +240,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, @@ -255,7 +255,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -270,7 +270,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": &library.Secret{Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, From f5348fa7250e14fdb0dcff108eb74ed30b3bc878 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Sun, 10 Nov 2019 19:49:00 -0600 Subject: [PATCH 014/430] refactor(misspell): fix spelling for misspell warnings --- executor/linux/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index 5d81ebcf..42810c80 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -287,7 +287,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the step err = c.DestroyStep(ctx, s) if err != nil { - c.logger.Errorf("unable to destory step: %w", err) + c.logger.Errorf("unable to destroy step: %w", err) } } @@ -297,7 +297,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the stage err = c.DestroyStage(ctx, s) if err != nil { - c.logger.Errorf("unable to destory stage: %w", err) + c.logger.Errorf("unable to destroy stage: %w", err) } } From aac381747b74b2c9b1d198c07f7fc2dd21d4c926 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Mon, 11 Nov 2019 09:41:39 -0600 Subject: [PATCH 015/430] Update go mod --- go.mod | 6 +++--- go.sum | 12 ++++++------ router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 5c91f885..e8ac6fea 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.1 - github.com/go-vela/sdk-go v0.1.1 - github.com/go-vela/types v0.1.1 + github.com/go-vela/mock v0.1.2 + github.com/go-vela/sdk-go v0.1.2 + github.com/go-vela/types v0.1.2 github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 62792a58..84f8f683 100644 --- a/go.sum +++ b/go.sum @@ -45,12 +45,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.1.1 h1:l/W0bBUJlFi3cs/lfzU/NxfyBAJisR4Zuq5OmPbvVII= -github.com/go-vela/mock v0.1.1/go.mod h1:feFnPD27oy3xTCDGYqbSvfbfR0JgZh5NaQaC4XFFwRU= -github.com/go-vela/sdk-go v0.1.1 h1:LCMtEZSvu4dizWEZjyJ/z8CvUtzfUkdvJ96UlQFA7OY= -github.com/go-vela/sdk-go v0.1.1/go.mod h1:Uhxu8oN1DWTlsh+4QaiU0t9cTFhguzq5bF4pWy3FdZE= -github.com/go-vela/types v0.1.1 h1:mCZzTZsw2BFachgRns0I3FcmyFn2njfSJhx/celju4k= -github.com/go-vela/types v0.1.1/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= +github.com/go-vela/mock v0.1.2 h1:Faxe3QHa6dqZKTAqBYH3XBMXLJBBRUEzaFNzBupgkb4= +github.com/go-vela/mock v0.1.2/go.mod h1:zZ5GTcbjDqal6wziV1Hre0qHC2x9NHvRF8Z5L5trZUw= +github.com/go-vela/sdk-go v0.1.2 h1:pqu2fbC4k6yZdFgBVfgVkSLV+vrZUo4RD9kJ22SWlo8= +github.com/go-vela/sdk-go v0.1.2/go.mod h1:LyxSwMhEcvOJv2AZCuqxzYKoxw4oR7sVRvSycLubJMw= +github.com/go-vela/types v0.1.2 h1:1YyjLJNREMiEkI8KH2bGICz7jihvsROTjFm8TaoaY7E= +github.com/go-vela/types v0.1.2/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index f19bda9b..a1cbe200 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.1.1" + wantVersion := "0.1.2" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.1" + wantVersion := "0.1.2" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.1.1" + wantVersion := "0.1.2" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.1" + wantVersion := "0.1.2" // setup context resp := httptest.NewRecorder() diff --git a/version/version.go b/version/version.go index c43c9753..650cd2e6 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 1 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 1 + VersionPatch int64 = 2 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From 10da43d281c3241d6dfbd5d5b9f7393d591503cb Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 13:56:50 -0600 Subject: [PATCH 016/430] fix(secrets): use secret Match function to inject secrets --- executor/linux/secret.go | 57 +++++++++------------------------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 02491f4c..64fbf5b7 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -12,6 +12,8 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" ) // PullSecret defines a function that pulls the secrets for a given pipeline. @@ -199,54 +201,21 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { // helper function to check secret whitelist before setting value // TODO: Evaluate pulling this into a "bool" types function for injecting -func injectSecrets(s *pipeline.Container, m map[string]*library.Secret) error { +func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error { // inject secrets for step - for _, secret := range s.Secrets { - eACL, iACL := false, false - events, images := []string{}, []string{} - - if value, ok := m[secret.Source]; ok { - events = value.GetEvents() - images = value.GetImages() - } - - // check event whitelist for if statements - if !s.Ruleset.If.Empty() { - for _, e := range events { - if s.Ruleset.If.Match(&pipeline.RuleData{Event: e}, "and") { - eACL = true - break - } - } - } - - // check event whitelist for unless statements - if !s.Ruleset.Unless.Empty() { - for _, e := range events { - if s.Ruleset.Unless.Match(&pipeline.RuleData{Event: e}, "and") { - eACL = true - break - } - } - } - - // check images whitelist - for _, i := range images { - if strings.HasPrefix(s.Image, i) && (len(i) != 0) { - iACL = true - break - } + for _, secret := range ctn.Secrets { + logrus.Tracef("looking up secret %s from pipeline secrets", secret.Source) + // lookup container secret in map + s, ok := m[secret.Source] + if !ok { + continue } - // inject secrets into environment - switch { - case iACL && (len(events) == 0): - s.Environment[strings.ToUpper(secret.Target)] = *m[secret.Source].Value - case eACL && (len(images) == 0): - s.Environment[strings.ToUpper(secret.Target)] = *m[secret.Source].Value - case eACL && iACL: - s.Environment[strings.ToUpper(secret.Target)] = *m[secret.Source].Value + logrus.Tracef("matching secret %s to container %s", secret.Source, ctn.Name) + // ensure the secret matches with the container + if s.Match(ctn) { + ctn.Environment[strings.ToUpper(secret.Target)] = *m[secret.Source].Value } } From 9aa49fc69af8c9c435348cde9c2f4f5f1e12d8f2 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 13:57:20 -0600 Subject: [PATCH 017/430] test(secrets): adjust tests for secret injection --- executor/linux/secret_test.go | 240 ++++++++++++++++++---------------- 1 file changed, 130 insertions(+), 110 deletions(-) diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 3b640ae3..d42f8b3f 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -111,170 +111,190 @@ func TestLinux_Secret_injectSecret(t *testing.T) { want *pipeline.Container }{ // Tests for secrets with image ACLs - {step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine"}, Events: &[]string{}}}, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine:latest"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"FOO": "foo"}, - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), - }}, + }, + }, // Tests for secrets with event ACLs - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - If: pipeline.Rules{ - Event: []string{"push"}, - }, + { // push event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: make(map[string]string), - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - If: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"BUILD_EVENT": "push"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, + { // pull_request event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - Unless: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "pull_request"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}, Images: &[]string{}}}, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: make(map[string]string), - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - Unless: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + }, + }, + { // tag event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "tag"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "tag"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{}}}, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "tag"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }}, - - // Tests for secrets with event and image ACLs - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - If: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"BUILD_EVENT": "tag"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, + { // deployment event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: make(map[string]string), - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - If: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "deployment"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - Unless: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"BUILD_EVENT": "deployment"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, + + // Tests for secrets with event and image ACLs + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: make(map[string]string), - }}, - {step: &pipeline.Container{ - Image: "alpine:latest", - Ruleset: pipeline.Ruleset{ - Unless: pipeline.Rules{ - Event: []string{"push"}, - }, + Environment: map[string]string{"BUILD_EVENT": "push"}, }, - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, + { + step: &pipeline.Container{ + Image: "centos:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}, Images: &[]string{"centos"}}}, + want: &pipeline.Container{ + Image: "centos:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }}, + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, + }, + }, } // run test From 7b32a7008291a9c23ae4c36e1179af7004056f42 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 14:02:08 -0600 Subject: [PATCH 018/430] refactor(secrets): use getter to capture secret value --- executor/linux/secret.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 64fbf5b7..dbbfd2a2 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -215,7 +215,7 @@ func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error logrus.Tracef("matching secret %s to container %s", secret.Source, ctn.Name) // ensure the secret matches with the container if s.Match(ctn) { - ctn.Environment[strings.ToUpper(secret.Target)] = *m[secret.Source].Value + ctn.Environment[strings.ToUpper(secret.Target)] = s.GetValue() } } From 36b7633b4fd28d207dc4bce12484f5ae2a4ca2bd Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 14:06:23 -0600 Subject: [PATCH 019/430] chore(version): bump Vela version for worker --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 650cd2e6..34685596 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 1 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 2 + VersionPatch int64 = 3 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From e37938f554ea1bafdbbc29c2622ad76e2ec850f0 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 14:06:52 -0600 Subject: [PATCH 020/430] test(version): bump version in failing tests --- router/middleware/header_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index a1cbe200..cfc860fc 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.1.2" + wantVersion := "0.1.3" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.2" + wantVersion := "0.1.3" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.1.2" + wantVersion := "0.1.3" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.2" + wantVersion := "0.1.3" // setup context resp := httptest.NewRecorder() From 4599433898618ea576b23a8bbb89b017d4503ae5 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 20:51:23 -0600 Subject: [PATCH 021/430] ci(coveralls): adopt goveralls configuration --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef7c9ea0..ad86c5da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,9 +18,11 @@ jobs: - name: test run: | - go test -covermode=count -coverprofile=coverage.out ./... + go test -race -covermode=atomic -coverprofile=coverage.out ./... - name: coveralls + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # https://github.com/mattn/goveralls#goveralls - $GOPATH/bin/goveralls -service=actions -coverprofile=coverage.out -repotoken=${{ secrets.COVERALLS_TOKEN }} + $(go env GOPATH)/bin/goveralls -service=github -coverprofile=coverage.out From ce62807e24f73b7266cef9ba71879c60874126d8 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 11 Nov 2019 20:56:16 -0600 Subject: [PATCH 022/430] ci(race): skip checking for race conditions --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad86c5da..55275e02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - name: test run: | - go test -race -covermode=atomic -coverprofile=coverage.out ./... + go test -covermode=atomic -coverprofile=coverage.out ./... - name: coveralls env: From 9c8636cded39b71e4e1efd2b0182f005c5d881b9 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 12 Nov 2019 14:34:47 -0600 Subject: [PATCH 023/430] fix(coveralls): update link to coveralls badge --- .github/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index bdca36fd..5f565978 100644 --- a/.github/README.md +++ b/.github/README.md @@ -2,7 +2,7 @@ [![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) -[![Coverage Status](https://coveralls.io/repos/go-vela/worker/badge.svg?branch=master)](https://coveralls.io/r/go-vela/worker?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/go-vela/worker/badge.svg?branch=master)](https://coveralls.io/github/go-vela/worker?branch=master) Vela is a Pipeline Automation (CI/CD) framework built on [Linux container](https://linuxcontainers.org/) technology written in [Golang](https://golang.org/). From a0f6851dfdc95a3c7866e33238818129394e32f2 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 13 Nov 2019 12:21:34 -0600 Subject: [PATCH 024/430] fix(types): update types for allow_pull rename --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e8ac6fea..2f5902a6 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.2 - github.com/go-vela/sdk-go v0.1.2 - github.com/go-vela/types v0.1.2 + github.com/go-vela/mock v0.1.3 + github.com/go-vela/sdk-go v0.1.3 + github.com/go-vela/types v0.1.3 github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 84f8f683..10538f86 100644 --- a/go.sum +++ b/go.sum @@ -45,12 +45,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.1.2 h1:Faxe3QHa6dqZKTAqBYH3XBMXLJBBRUEzaFNzBupgkb4= -github.com/go-vela/mock v0.1.2/go.mod h1:zZ5GTcbjDqal6wziV1Hre0qHC2x9NHvRF8Z5L5trZUw= -github.com/go-vela/sdk-go v0.1.2 h1:pqu2fbC4k6yZdFgBVfgVkSLV+vrZUo4RD9kJ22SWlo8= -github.com/go-vela/sdk-go v0.1.2/go.mod h1:LyxSwMhEcvOJv2AZCuqxzYKoxw4oR7sVRvSycLubJMw= -github.com/go-vela/types v0.1.2 h1:1YyjLJNREMiEkI8KH2bGICz7jihvsROTjFm8TaoaY7E= -github.com/go-vela/types v0.1.2/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= +github.com/go-vela/mock v0.1.3 h1:YDOPugUeGgrd0CylHzwKhcLqxY50HZayJuwkaIyWuV4= +github.com/go-vela/mock v0.1.3/go.mod h1:3TgNZmhaNsptHvtnKTPVrsdBpH3DKAacymSaGS6vrSA= +github.com/go-vela/sdk-go v0.1.3 h1:PeQ3iDxcmg5P4Ra/xBvu/J5CfqAYR/8kv/FnLdXFUyM= +github.com/go-vela/sdk-go v0.1.3/go.mod h1:C7/f6RxfJhSlXCY+Eppx6ze/2HTH4WdbToR5/HhetUE= +github.com/go-vela/types v0.1.3 h1:y7PRarTVNZdu9x8v3vah+0+hB4NuNHYqY5Uq6MVJ04U= +github.com/go-vela/types v0.1.3/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= From 6d4514403cd791ed9069ed97aadfe38a6df41bb0 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Wed, 13 Nov 2019 12:34:48 -0600 Subject: [PATCH 025/430] Update version for release --- router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index cfc860fc..63b8ee52 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.1.3" + wantVersion := "0.1.4" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.3" + wantVersion := "0.1.4" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.1.3" + wantVersion := "0.1.4" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.3" + wantVersion := "0.1.4" // setup context resp := httptest.NewRecorder() diff --git a/version/version.go b/version/version.go index 34685596..61e526a0 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 1 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 3 + VersionPatch int64 = 4 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From 852f347b385c30e5f279a94d329c2f0a3635b618 Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Thu, 14 Nov 2019 11:15:26 -0600 Subject: [PATCH 026/430] Fix(logs): add struct maps for stages/serivces workflows --- executor/linux/build.go | 14 +++++++------- executor/linux/linux.go | 17 +++++++++++++---- executor/linux/service.go | 23 +++++++++++++++-------- executor/linux/stage.go | 8 ++++---- executor/linux/step.go | 23 +++++++++++++++-------- 5 files changed, 54 insertions(+), 31 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index 42810c80..a99925b2 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -199,14 +199,14 @@ func (c *client) ExecBuild(ctx context.Context) error { } // update the step fields - c.step.ExitCode = vela.Int(s.ExitCode) - c.step.Status = vela.String(constants.StatusFailure) + c.steps[s.ID].ExitCode = vela.Int(s.ExitCode) + c.steps[s.ID].Status = vela.String(constants.StatusFailure) } - c.step.Finished = vela.Int64(time.Now().UTC().Unix()) + c.steps[s.ID].Finished = vela.Int64(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", s.Name) // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.step) + _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[s.ID]) if err != nil { return err } @@ -312,9 +312,9 @@ func (c *client) DestroyBuild(ctx context.Context) error { c.logger.Infof("uploading %s service state", s.Name) // send API call to update the build - c.service.ExitCode = vela.Int(s.ExitCode) - c.service.Finished = vela.Int64(time.Now().UTC().Unix()) - _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.service) + c.services[s.ID].ExitCode = vela.Int(s.ExitCode) + c.services[s.ID].Finished = vela.Int64(time.Now().UTC().Unix()) + _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.services[s.ID]) if err != nil { c.logger.Errorf("unable to upload service status: %w", err) } diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 395c7ce7..ef8ec8c5 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -33,6 +33,11 @@ type client struct { step *library.Step stepLog *library.Log user *library.User + + services map[string]*library.Service + serviceLogs map[string]*library.Log + steps map[string]*library.Step + stepLogs map[string]*library.Log } // New returns an Executor implementation that integrates with a Linux instance. @@ -56,10 +61,14 @@ func New(c *vela.Client, r runtime.Engine) (*client, error) { }) return &client{ - Vela: c, - Runtime: r, - Hostname: h, - logger: l, + Vela: c, + Runtime: r, + Hostname: h, + logger: l, + services: make(map[string]*library.Service), + serviceLogs: make(map[string]*library.Log), + steps: make(map[string]*library.Step), + stepLogs: make(map[string]*library.Log), }, nil } diff --git a/executor/linux/service.go b/executor/linux/service.go index ec97254a..8f2f426f 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -47,7 +47,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error }) // update the engine service object - c.service = &library.Service{ + s := &library.Service{ Name: vela.String(ctn.Name), Number: vela.Int(ctn.Number), Status: vela.String(constants.StatusRunning), @@ -56,20 +56,26 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error logger.Debug("uploading service state") // send API call to update the service - _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.service) + s, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) if err != nil { return err } - c.service.Status = vela.String(constants.StatusSuccess) + s.Status = vela.String(constants.StatusSuccess) + + // add a service to a map + c.services[ctn.ID] = s // get the service log here logger.Debug("retrieve service log") // send API call to capture the service log - c.serviceLog, _, err = c.Vela.Log.GetService(r.GetOrg(), r.GetName(), b.GetNumber(), c.service.GetNumber()) + l, _, err := c.Vela.Log.GetService(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) if err != nil { return err } + // add a step log to a map + c.serviceLogs[ctn.ID] = l + return nil } @@ -77,6 +83,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { b := c.build r := c.repo + l := c.serviceLogs[ctn.ID] // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ @@ -126,10 +133,10 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Trace(logs.String()) // update the existing log with the new bytes - c.serviceLog.Data = vela.Bytes(append(c.serviceLog.GetData(), logs.Bytes()...)) + l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) logger.Debug("appending logs") - c.serviceLog, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, c.serviceLog) + l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) if err != nil { return err } @@ -141,11 +148,11 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Trace(logs.String()) // update the existing log with the last bytes - c.serviceLog.Data = vela.Bytes(append(c.serviceLog.GetData(), logs.Bytes()...)) + l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) logger.Debug("uploading logs") // send API call to update the logs for the service - c.serviceLog, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, c.serviceLog) + l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) if err != nil { return err } diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 9dfd9bde..fe1ab5a9 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -103,14 +103,14 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] } // update the step fields - c.step.ExitCode = vela.Int(step.ExitCode) - c.step.Status = vela.String(constants.StatusFailure) + c.steps[step.ID].ExitCode = vela.Int(step.ExitCode) + c.steps[step.ID].Status = vela.String(constants.StatusFailure) } - c.step.Finished = vela.Int64(time.Now().UTC().Unix()) + c.steps[step.ID].Finished = vela.Int64(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", step.Name) // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.step) + _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[step.ID]) if err != nil { return err } diff --git a/executor/linux/step.go b/executor/linux/step.go index dee53022..605ecb42 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -103,7 +103,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { }) // update the engine step object - c.step = &library.Step{ + s := &library.Step{ Name: vela.String(ctn.Name), Number: vela.Int(ctn.Number), Status: vela.String(constants.StatusRunning), @@ -115,20 +115,26 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { logger.Debug("uploading step state") // send API call to update the step - c.step, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.step) + s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) if err != nil { return err } - c.step.Status = vela.String(constants.StatusSuccess) + s.Status = vela.String(constants.StatusSuccess) + + // add a step to a map + c.steps[ctn.ID] = s // get the step log here logger.Debug("retrieve step log") // send API call to capture the step log - c.stepLog, _, err = c.Vela.Log.GetStep(r.GetOrg(), r.GetName(), b.GetNumber(), c.step.GetNumber()) + l, _, err := c.Vela.Log.GetStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) if err != nil { return err } + // add a step log to a map + c.stepLogs[ctn.ID] = l + return nil } @@ -136,6 +142,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { b := c.build r := c.repo + l := c.stepLogs[ctn.ID] // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ @@ -185,11 +192,11 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Trace(logs.String()) // update the existing log with the new bytes - c.stepLog.Data = vela.Bytes(append(c.stepLog.GetData(), logs.Bytes()...)) + l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) logger.Debug("appending logs") // send API call to update the logs for the step - c.stepLog, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, c.stepLog) + l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) if err != nil { return err } @@ -201,11 +208,11 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Trace(logs.String()) // update the existing log with the last bytes - c.stepLog.Data = vela.Bytes(append(c.stepLog.GetData(), logs.Bytes()...)) + l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) logger.Debug("uploading logs") // send API call to update the logs for the step - c.stepLog, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, c.stepLog) + l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) if err != nil { return err } From 8337747a28d1dad52d009a729a8b0ecf98a541fc Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Thu, 14 Nov 2019 12:51:42 -0600 Subject: [PATCH 027/430] fix(test): Update tests for map --- executor/linux/build_test.go | 5 +++-- executor/linux/service_test.go | 6 ++++-- executor/linux/step_test.go | 6 ++++-- go.mod | 2 +- go.sum | 2 ++ 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index b5e027f8..ef812063 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -625,8 +625,9 @@ func TestExecutor_DestroyBuild_Success(t *testing.T) { e.WithBuild(test.build) e.WithPipeline(test.pipeline) e.WithRepo(test.repo) - e.service = new(library.Service) - e.service.Number = vela.Int(1) + e.services = make(map[string]*library.Service) + e.services[e.pipeline.Services[0].ID] = new(library.Service) + e.services[e.pipeline.Services[0].ID].Number = vela.Int(1) got := e.DestroyBuild(context.Background()) diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 024c01f0..1c29cdd1 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -192,8 +192,10 @@ func TestExecutor_ExecService_Success(t *testing.T) { AllowDeploy: vela.Bool(false), AllowTag: vela.Bool(false), }) - e.serviceLog = new(library.Log) - e.service = new(library.Service) + e.serviceLogs = make(map[string]*library.Log) + e.serviceLogs[e.pipeline.Services[0].ID] = new(library.Log) + e.services = make(map[string]*library.Service) + e.services[e.pipeline.Services[0].ID] = new(library.Service) // run test got := e.ExecService(context.Background(), e.pipeline.Services[0]) diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 7d9aa628..9c020c51 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -305,8 +305,10 @@ func TestExecutor_ExecStep_Success(t *testing.T) { AllowDeploy: vela.Bool(false), AllowTag: vela.Bool(false), }) - e.stepLog = new(library.Log) - e.step = new(library.Step) + e.stepLogs = make(map[string]*library.Log) + e.stepLogs[e.pipeline.Steps[0].ID] = new(library.Log) + e.steps = make(map[string]*library.Step) + e.steps[e.pipeline.Steps[0].ID] = new(library.Step) // run test got := e.ExecStep(context.Background(), e.pipeline.Steps[0]) diff --git a/go.mod b/go.mod index 2f5902a6..7aae6a5a 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.3 + github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712 github.com/go-vela/sdk-go v0.1.3 github.com/go-vela/types v0.1.3 github.com/google/go-cmp v0.3.1 diff --git a/go.sum b/go.sum index 10538f86..43d30301 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,8 @@ github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/mock v0.1.3 h1:YDOPugUeGgrd0CylHzwKhcLqxY50HZayJuwkaIyWuV4= github.com/go-vela/mock v0.1.3/go.mod h1:3TgNZmhaNsptHvtnKTPVrsdBpH3DKAacymSaGS6vrSA= +github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712 h1:GSSCavSIoayW4tTiBg5R6Jp2GvX+pGxLnXvM2SFzqoE= +github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712/go.mod h1:3TgNZmhaNsptHvtnKTPVrsdBpH3DKAacymSaGS6vrSA= github.com/go-vela/sdk-go v0.1.3 h1:PeQ3iDxcmg5P4Ra/xBvu/J5CfqAYR/8kv/FnLdXFUyM= github.com/go-vela/sdk-go v0.1.3/go.mod h1:C7/f6RxfJhSlXCY+Eppx6ze/2HTH4WdbToR5/HhetUE= github.com/go-vela/types v0.1.3 h1:y7PRarTVNZdu9x8v3vah+0+hB4NuNHYqY5Uq6MVJ04U= From 6a1160d5833014571ff8a74b4e954376ae51e3cd Mon Sep 17 00:00:00 2001 From: Neal Coleman Date: Thu, 14 Nov 2019 13:59:02 -0600 Subject: [PATCH 028/430] fix(client fields): remove unused fields within client struct --- executor/linux/linux.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index ef8ec8c5..05765da5 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -24,20 +24,15 @@ type client struct { Hostname string // private fields - logger *logrus.Entry - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - service *library.Service - serviceLog *library.Log - step *library.Step - stepLog *library.Log - user *library.User - + logger *logrus.Entry + build *library.Build + pipeline *pipeline.Build + repo *library.Repo services map[string]*library.Service serviceLogs map[string]*library.Log steps map[string]*library.Step stepLogs map[string]*library.Log + user *library.User } // New returns an Executor implementation that integrates with a Linux instance. From 5019e853abbe0ca9638d0acd006b39a7bdd7d124 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 14 Nov 2019 15:07:23 -0600 Subject: [PATCH 029/430] fix(deps): update Vela dependencies for bug fixes --- go.mod | 6 +++--- go.sum | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 7aae6a5a..a3560d62 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712 - github.com/go-vela/sdk-go v0.1.3 - github.com/go-vela/types v0.1.3 + github.com/go-vela/mock v0.1.4 + github.com/go-vela/sdk-go v0.1.4 + github.com/go-vela/types v0.1.4 github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 43d30301..476ad556 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -45,14 +46,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.1.3 h1:YDOPugUeGgrd0CylHzwKhcLqxY50HZayJuwkaIyWuV4= -github.com/go-vela/mock v0.1.3/go.mod h1:3TgNZmhaNsptHvtnKTPVrsdBpH3DKAacymSaGS6vrSA= -github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712 h1:GSSCavSIoayW4tTiBg5R6Jp2GvX+pGxLnXvM2SFzqoE= -github.com/go-vela/mock v0.1.4-0.20191114184817-0f96f3867712/go.mod h1:3TgNZmhaNsptHvtnKTPVrsdBpH3DKAacymSaGS6vrSA= -github.com/go-vela/sdk-go v0.1.3 h1:PeQ3iDxcmg5P4Ra/xBvu/J5CfqAYR/8kv/FnLdXFUyM= -github.com/go-vela/sdk-go v0.1.3/go.mod h1:C7/f6RxfJhSlXCY+Eppx6ze/2HTH4WdbToR5/HhetUE= -github.com/go-vela/types v0.1.3 h1:y7PRarTVNZdu9x8v3vah+0+hB4NuNHYqY5Uq6MVJ04U= -github.com/go-vela/types v0.1.3/go.mod h1:JR5jxRuE5A+RZyyQqMd4lJoUApVFo/Iq9iABbQzPCj0= +github.com/go-vela/mock v0.1.4 h1:t0uG+Ot12nZ42pt4sYnDCFE4UGqMnk1aUxD3ejjAURw= +github.com/go-vela/mock v0.1.4/go.mod h1:13CEKboQJNehsj6kEpo993foP8VXdqQ0Ik2W4f75HiY= +github.com/go-vela/sdk-go v0.1.4 h1:WfM77H7jWx57L0rE0BBAMiRt1VtkJVaNaBWu3CEnWOg= +github.com/go-vela/sdk-go v0.1.4/go.mod h1:s3WbOJ+7Ir4b/zz5wgDzdOS2snccMJJK7zSQkRpYmfQ= +github.com/go-vela/types v0.1.4 h1:QrI6QlvhSn3/Uvv+XYFtLQauhtr8CsuOBnOmHp0HPg8= +github.com/go-vela/types v0.1.4/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= From 7e0d58b232c2451791be268e7f8ff98c8420fc4f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 14 Nov 2019 15:13:46 -0600 Subject: [PATCH 030/430] build(version): upgrade version to v0.1.5 --- router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 63b8ee52..8c40dbac 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.1.4" + wantVersion := "0.1.5" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.4" + wantVersion := "0.1.5" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.1.4" + wantVersion := "0.1.5" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.4" + wantVersion := "0.1.5" // setup context resp := httptest.NewRecorder() diff --git a/version/version.go b/version/version.go index 61e526a0..3ddb268d 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 1 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 4 + VersionPatch int64 = 5 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From 9ef6a76393b28cf2dd43bd5c87956160401f637f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 19 Nov 2019 13:23:57 -0600 Subject: [PATCH 031/430] docs(readme): add disclaimer to readme (#20) --- .github/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/README.md b/.github/README.md index 5f565978..f2d0917d 100644 --- a/.github/README.md +++ b/.github/README.md @@ -4,6 +4,10 @@ [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) [![Coverage Status](https://coveralls.io/repos/github/go-vela/worker/badge.svg?branch=master)](https://coveralls.io/github/go-vela/worker?branch=master) +> Vela is in active development and is a pre-release product. Please use at your own risk in production. +> +> Feel free to send us feedback at https://github.com/go-vela/community/issues/new. + Vela is a Pipeline Automation (CI/CD) framework built on [Linux container](https://linuxcontainers.org/) technology written in [Golang](https://golang.org/). Vela uses a syntax similar to [Docker Compose](https://docs.docker.com/compose/) to define its configuration. This structure for repeated use, within the application, is called a pipeline and a single execution of a pipeline is referenced as a build. From ce6d52eb46fb80e3b28af55b654b7ca35f6b5c6e Mon Sep 17 00:00:00 2001 From: Neal Date: Wed, 20 Nov 2019 10:09:50 -0600 Subject: [PATCH 032/430] feat(routing): add the ability to route builds (#21) --- cmd/server/main.go | 6 ++++++ cmd/server/operate.go | 2 +- cmd/server/queue.go | 6 +++++- cmd/server/runtime.go | 1 + cmd/server/server.go | 8 ++++---- docker-compose.yml | 2 ++ go.mod | 2 +- go.sum | 2 ++ queue/queue.go | 4 ++-- queue/redis/pull.go | 6 +++--- queue/redis/redis.go | 10 ++++++---- 11 files changed, 33 insertions(+), 16 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 061e45c8..5b8bef5e 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -73,6 +73,12 @@ func main() { Name: "queue-cluster", Usage: "queue client is setup for clusters", }, + // By default all builds are pushed to the "vela" route + cli.StringSliceFlag{ + EnvVar: "VELA_QUEUE_WORKER_ROUTES,QUEUE_WORKER_ROUTES", + Name: "queue-worker-routes", + Usage: "queue worker routes is configuration for routing builds", + }, // Runtime Flags cli.StringFlag{ diff --git a/cmd/server/operate.go b/cmd/server/operate.go index f332f6a5..fa3f34e4 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -23,7 +23,7 @@ func operate(queue queue.Service, executors map[int]executor.Engine) (err error) threads.Go(func() error { for { ctx := context.Background() - item, err := queue.Pull("vela") + item, err := queue.Pop() if err != nil { return err } diff --git a/cmd/server/queue.go b/cmd/server/queue.go index 43f2714a..25462ed0 100644 --- a/cmd/server/queue.go +++ b/cmd/server/queue.go @@ -38,11 +38,15 @@ func setupKafka(c *cli.Context) (queue.Service, error) { // helper function to setup the Redis queue from the CLI arguments. func setupRedis(c *cli.Context) (queue.Service, error) { + + // setup routes + routes := append(c.StringSlice("queue-worker-routes"), constants.DefaultRoute) + if c.Bool("queue-cluster") { logrus.Tracef("Creating %s queue cluster client from CLI configuration", constants.DriverRedis) return redis.NewCluster(c.String("queue-config"), "vela") } logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverRedis) - return redis.New(c.String("queue-config"), "vela") + return redis.New(c.String("queue-config"), routes...) } diff --git a/cmd/server/runtime.go b/cmd/server/runtime.go index 9e91a5c7..d3489025 100644 --- a/cmd/server/runtime.go +++ b/cmd/server/runtime.go @@ -19,6 +19,7 @@ import ( // helper function to setup the runtime from the CLI arguments. func setupRuntime(c *cli.Context) (runtime.Engine, error) { logrus.Debug("Creating runtime client from CLI configuration") + switch c.String("runtime-driver") { case constants.DriverDocker: return setupDocker(c) diff --git a/cmd/server/server.go b/cmd/server/server.go index 82a4efc5..c317e9ac 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -57,14 +57,14 @@ func server(c *cli.Context) error { return err } - // create a queue client - queue, err := setupQueue(c) + // create a runtime client + runtime, err := setupRuntime(c) if err != nil { return err } - // create a runtime client - runtime, err := setupRuntime(c) + // create a queue client + queue, err := setupQueue(c) if err != nil { return err } diff --git a/docker-compose.yml b/docker-compose.yml index afd7d7e8..21f25743 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,7 @@ services: VELA_LOG_LEVEL: debug VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 + VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker VELA_RUNTIME_DRIVER: docker VELA_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh VELA_VAULT_ADDR: http://vault:8200 @@ -39,6 +40,7 @@ services: VELA_LOG_LEVEL: debug VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 + VELA_QUEUE_WORKER_ROUTES: small,docker,small:docker VELA_RUNTIME_DRIVER: docker VELA_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh VELA_VAULT_ADDR: http://vault:8200 diff --git a/go.mod b/go.mod index a3560d62..9e6d893b 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.1.4 github.com/go-vela/sdk-go v0.1.4 - github.com/go-vela/types v0.1.4 + github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 476ad556..f92c81f3 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ github.com/go-vela/sdk-go v0.1.4 h1:WfM77H7jWx57L0rE0BBAMiRt1VtkJVaNaBWu3CEnWOg= github.com/go-vela/sdk-go v0.1.4/go.mod h1:s3WbOJ+7Ir4b/zz5wgDzdOS2snccMJJK7zSQkRpYmfQ= github.com/go-vela/types v0.1.4 h1:QrI6QlvhSn3/Uvv+XYFtLQauhtr8CsuOBnOmHp0HPg8= github.com/go-vela/types v0.1.4/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 h1:SbkNzV2t5gFTzgFQndzgd5NX1DPmT4G48dPtkplZsKw= +github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= diff --git a/queue/queue.go b/queue/queue.go index d1fc6464..35ebc7e2 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -11,6 +11,6 @@ import ( // Service represents the interface for Vela integrating // with the different supported Queue backends. type Service interface { - // Pull defines a function that pops an item off the queue. - Pull(string) (*types.Item, error) + // Pop defines a function that grabs an item off the queue. + Pop() (*types.Item, error) } diff --git a/queue/redis/pull.go b/queue/redis/pull.go index 40bfccd2..21c5709d 100644 --- a/queue/redis/pull.go +++ b/queue/redis/pull.go @@ -11,10 +11,10 @@ import ( "github.com/go-vela/types" ) -// Pull pops an item from the specified channel off the queue. -func (c *client) Pull(channel string) (*types.Item, error) { +// Pop grabs an item from the specified channel off the queue. +func (c *client) Pop() (*types.Item, error) { // blocking list pop item from queue - result, err := c.Queue.BLPop(0, channel).Result() + result, err := c.Queue.BLPop(0, c.Channels...).Result() if err != nil { return nil, fmt.Errorf("unable to pop item from queue: %w", err) } diff --git a/queue/redis/redis.go b/queue/redis/redis.go index 21baf5da..7577f98b 100644 --- a/queue/redis/redis.go +++ b/queue/redis/redis.go @@ -14,8 +14,9 @@ import ( ) type client struct { - Queue *redis.Client - Options *redis.Options + Queue *redis.Client + Options *redis.Options + Channels []string } // New returns a Queue implementation that @@ -38,8 +39,9 @@ func New(url string, channels ...string) (*client, error) { // create the client object client := &client{ - Queue: queue, - Options: options, + Queue: queue, + Options: options, + Channels: channels, } return client, nil From ee8cd14a9c9da906516e3c0ad1e8f4749c4f3502 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 21 Nov 2019 15:03:02 -0600 Subject: [PATCH 033/430] Respect YAML pull tag in step configuration (#23) --- executor/linux/build.go | 7 ++-- executor/linux/service_test.go | 1 + executor/linux/stage.go | 2 +- runtime/docker/container.go | 60 ++++++++++++++++++++++++++------ runtime/docker/container_test.go | 5 +-- 5 files changed, 56 insertions(+), 19 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index a99925b2..16261a83 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -88,6 +88,10 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the services for the pipeline for _, s := range p.Services { + // TODO: remove this; but we need it for tests + s.Detach = true + s.Pull = true + c.logger.Infof("creating %s service", s.Name) // create the service err = c.CreateService(ctx, s) @@ -150,9 +154,6 @@ func (c *client) ExecBuild(ctx context.Context) error { // execute the services for the pipeline for _, s := range p.Services { - // TODO: remove this; but we need it for tests - s.Detach = true - c.logger.Infof("planning %s service", s.Name) // plan the service err = c.PlanService(ctx, s) diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 1c29cdd1..8989e30a 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -38,6 +38,7 @@ func TestExecutor_CreateService_Success(t *testing.T) { Image: "postgres:11-alpine", Name: "postgres", Ports: []string{"5432:5432"}, + Pull: true, }, }, }) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index fe1ab5a9..ae194784 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -84,7 +84,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] // plan the step err := c.PlanStep(ctx, step) if err != nil { - return fmt.Errorf("unable to plan step: %w", err) + return fmt.Errorf("unable to plan step %s: %w", step.Name, err) } logger.Debugf("executing %s step", step.Name) diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 26ccf1da..8acc1eae 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -16,6 +16,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" + docker "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" "github.com/sirupsen/logrus" @@ -121,22 +122,59 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er return err } - logrus.Tracef("Pulling image %s", image) + // check if the container should be updated + if ctn.Pull { + logrus.Tracef("Pulling configured image %s", image) + // create options for pulling image + opts := types.ImagePullOptions{} - // create options for pulling image - opts := types.ImagePullOptions{} + // send API call to pull the image for the container + reader, err := c.Runtime.ImagePull(ctx, image, opts) + if err != nil { + return err + } + defer reader.Close() - // send API call to pull the image for the container - reader, err := c.Runtime.ImagePull(ctx, image, opts) - defer reader.Close() - if err != nil { - return err + // copy output from image pull to standard output + _, err = io.Copy(os.Stdout, reader) + if err != nil { + return err + } + + return nil } - // copy output from image pull to standard output - io.Copy(os.Stdout, reader) + // check if the container image exists on the host + _, _, err = c.Runtime.ImageInspectWithRaw(ctx, image) + if err == nil { + return nil + } - return nil + // if the container image does not exist on the host + // we attempt to capture it for executing the pipeline + if docker.IsErrNotFound(err) { + logrus.Tracef("Pulling unfound image %s", image) + + // create options for pulling image + opts := types.ImagePullOptions{} + + // send API call to pull the image for the container + reader, err := c.Runtime.ImagePull(ctx, image, opts) + if err != nil { + return err + } + defer reader.Close() + + // copy output from image pull to standard output + _, err = io.Copy(os.Stdout, reader) + if err != nil { + return err + } + + return nil + } + + return err } // TailContainer captures the logs for the pipeline container. diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index f178f3c0..8bc97826 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -129,12 +129,9 @@ func TestDocker_SetupContainer_Success(t *testing.T) { got := c.SetupContainer(context.Background(), &pipeline.Container{ ID: "container_id", Image: "alpine:latest", + Pull: true, }) - if got != nil { - t.Error("SetupContainer should not have returned err: ", got) - } - if got != nil { t.Errorf("SetupContainer is %v, want nil", got) } From a477157698979173e2897828b942d3a1a54253e6 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 22 Nov 2019 08:03:24 -0600 Subject: [PATCH 034/430] Add worker http endpoints (#24) * feat(api): add worker http endpoints * fix(routes): Add handlers to router --- api/build.go | 26 ++++++++++++++++++++++++++ api/executor.go | 23 +++++++++++++++++++++++ api/shutdown.go | 21 +++++++++++++++++++++ router/build.go | 31 +++++++++++++++++++++++++++++++ router/executor.go | 38 ++++++++++++++++++++++++++++++++++++++ router/router.go | 9 +++++++++ 6 files changed, 148 insertions(+) create mode 100644 api/build.go create mode 100644 api/executor.go create mode 100644 api/shutdown.go create mode 100644 router/build.go create mode 100644 router/executor.go diff --git a/api/build.go b/api/build.go new file mode 100644 index 00000000..c1e72f19 --- /dev/null +++ b/api/build.go @@ -0,0 +1,26 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// GetBuild represents the API handler to capture the +// build currently running on an executor. +func GetBuild(c *gin.Context) { + c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") +} + +// KillBuild represents the API handler to kill a +// build currently running on an executor. +// +// This function performs a hard cancellation of a build on worker. +// Any build running during this time will immediately be stopped. +func KillBuild(c *gin.Context) { + c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") +} diff --git a/api/executor.go b/api/executor.go new file mode 100644 index 00000000..fa313239 --- /dev/null +++ b/api/executor.go @@ -0,0 +1,23 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// GetExecutor represents the API handler to capture the +// executor currently running on a worker. +func GetExecutor(c *gin.Context) { + c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") +} + +// GetExecutors represents the API handler to capture the +// executors currently running on a worker. +func GetExecutors(c *gin.Context) { + c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") +} diff --git a/api/shutdown.go b/api/shutdown.go new file mode 100644 index 00000000..f7c109b8 --- /dev/null +++ b/api/shutdown.go @@ -0,0 +1,21 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// Shutdown represents the API handler to shutdown a +// executors currently running on an worker. +// +// This function performs a soft shut down of a worker. +// Any build running during this time will safely complete, then +// the worker will safely shut itself down. +func Shutdown(c *gin.Context) { + c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") +} diff --git a/router/build.go b/router/build.go new file mode 100644 index 00000000..1c5fa65c --- /dev/null +++ b/router/build.go @@ -0,0 +1,31 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" +) + +// buildHandlers is a function that extends the provided base router group +// with the API handlers for build functionality. +// +// GET /api/v1/executors/:executor/builds/:build +// PATCH /api/v1/executors/:executor/builds/:build/kill +func buildHandlers(base *gin.RouterGroup) { + + // builds endpoints + builds := base.Group("/builds") + { + + // build endpoints + build := builds.Group("/:build") + { + build.GET("", api.GetBuild) + build.PATCH("/kill", api.KillBuild) + } // end of build endpoints + + } // end of builds endpoints +} diff --git a/router/executor.go b/router/executor.go new file mode 100644 index 00000000..07c2e335 --- /dev/null +++ b/router/executor.go @@ -0,0 +1,38 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" +) + +// executorHandlers is a function that extends the provided base router group +// with the API handlers for build functionality. +// +// GET /api/v1/executors +// GET /api/v1/executors/:executor +// GET /api/v1/executors/:executor/builds/:build +// PATCH /api/v1/executors/:executor/builds/:build/kill +func executorHandlers(base *gin.RouterGroup) { + + // executors endpoints + executors := base.Group("/executors") + { + + executors.GET("", api.GetExecutors) + + // exector endpoints + executor := executors.Group("/:executor") + { + executor.GET("", api.GetExecutor) + + // build endpoints + buildHandlers(executor) + + } // end of executor endpoints + + } // end of executors endpoints +} diff --git a/router/router.go b/router/router.go index 946e912e..3ca0f667 100644 --- a/router/router.go +++ b/router/router.go @@ -29,6 +29,15 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { r.GET("/health", api.Health) r.GET("/metrics", gin.WrapH(api.Metrics())) + r.POST("/shutdown", api.Shutdown) + + // api endpoints + baseAPI := r.Group(base) + { + // executor endpoints + executorHandlers(baseAPI) + + } // end of api return r } From 7da8c292df02ada81eb879da6f9043c5c2c54f49 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 22 Nov 2019 11:04:33 -0600 Subject: [PATCH 035/430] Add timeout for builds (#25) --- cmd/server/main.go | 7 +++++++ cmd/server/operate.go | 40 +++++++++++++++++++++++++++++++--------- cmd/server/server.go | 2 +- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 5b8bef5e..5f0cc733 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,6 +6,7 @@ package main import ( "os" + "time" "github.com/go-vela/worker/version" @@ -56,6 +57,12 @@ func main() { Usage: "number of executor threads to create", Value: 1, }, + cli.DurationFlag{ + EnvVar: "VELA_EXECUTOR_TIMEOUT,EXECUTOR_TIMEOUT", + Name: "executor-timeout", + Usage: "max time an executor will run a build", + Value: 60 * time.Minute, + }, // Queue Flags cli.StringFlag{ diff --git a/cmd/server/operate.go b/cmd/server/operate.go index fa3f34e4..82ae5c1b 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -6,6 +6,7 @@ package main import ( "context" + "time" "github.com/go-vela/worker/executor" @@ -15,46 +16,67 @@ import ( "golang.org/x/sync/errgroup" ) -func operate(queue queue.Service, executors map[int]executor.Engine) (err error) { +func operate(queue queue.Service, executors map[int]executor.Engine, timeout time.Duration) (err error) { threads := new(errgroup.Group) for id, e := range executors { logrus.Infof("Thread ID %d listening to queue...", id) threads.Go(func() error { for { - ctx := context.Background() + // pop an item from the queue item, err := queue.Pop() if err != nil { return err } + // create logger with extra metadata + logger := logrus.WithFields(logrus.Fields{ + "build": item.Build.GetNumber(), + "repo": item.Repo.GetFullName(), + }) + + // add build metadata to the executor e.WithBuild(item.Build) e.WithPipeline(item.Pipeline) e.WithRepo(item.Repo) e.WithUser(item.User) - logrus.Infof("creating %s build", item.Repo.GetFullName()) + // check if the repository has a custom timeout + if item.Repo.GetTimeout() > 0 { + // update timeout variable to repository custom timeout + timeout = time.Duration(item.Repo.GetTimeout()) * time.Minute + } + + // create a copy of the background context with a timeout + // built in for ensuring a build doesn't run forever + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + // create the build on the executor + logger.Infof("creating build") err = e.CreateBuild(ctx) if err != nil { - logrus.Errorf("unable to create build: %w", err) + logger.Errorf("unable to create build: %w", err) return err } - logrus.Infof("executing %s build", item.Repo.GetFullName()) + // execute the build on the executor + logger.Infof("executing build") err = e.ExecBuild(ctx) if err != nil { - logrus.Errorf("unable to execute build: %w", err) + logger.Errorf("unable to execute build: %w", err) return err } - logrus.Infof("destroying %s build", item.Repo.GetFullName()) + // destroy the build on the executor + logger.Info("destroying build") err = e.DestroyBuild(ctx) if err != nil { - logrus.Errorf("unable to destroy build: %w", err) + logger.Errorf("unable to destroy build: %w", err) return err } - logrus.Infof("completed %s build", item.Repo.GetFullName()) + logger.Info("completed build") } }) } diff --git a/cmd/server/server.go b/cmd/server/server.go index c317e9ac..857c11c1 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -102,7 +102,7 @@ func server(c *cli.Context) error { go func() { logrus.Info("Starting operator...") // TODO: refactor due to one thread killing entire worker - err := operate(queue, executors) + err := operate(queue, executors, c.Duration("executor-timeout")) if err != nil { tomb.Kill(err) } From 2f2a5c95537b173a575f30c86430e9926fd644c9 Mon Sep 17 00:00:00 2001 From: Neal Date: Tue, 26 Nov 2019 21:34:03 -0600 Subject: [PATCH 036/430] feat(auth): Allow only server to make API calls with secret (#26) * feat(auth): Allow only server to make API calls with secret * Add godoc files * fix(err): catch error from gin * Fix(log): fix package name * fix(test): correct test data --- cmd/server/server.go | 1 + go.mod | 7 ++ go.sum | 31 +++++ router/middleware/perm/doc.go | 13 +++ router/middleware/perm/perm.go | 35 ++++++ router/middleware/perm/perm_test.go | 90 ++++++++++++++ router/middleware/secret.go | 18 +++ router/middleware/token/doc.go | 13 +++ router/middleware/token/token.go | 30 +++++ router/middleware/token/token_test.go | 46 ++++++++ router/middleware/user/context.go | 39 +++++++ router/middleware/user/context_test.go | 90 ++++++++++++++ router/middleware/user/doc.go | 13 +++ router/middleware/user/user.go | 44 +++++++ router/middleware/user/user_test.go | 156 +++++++++++++++++++++++++ router/router.go | 6 +- 16 files changed, 630 insertions(+), 2 deletions(-) create mode 100644 router/middleware/perm/doc.go create mode 100644 router/middleware/perm/perm.go create mode 100644 router/middleware/perm/perm_test.go create mode 100644 router/middleware/secret.go create mode 100644 router/middleware/token/doc.go create mode 100644 router/middleware/token/token.go create mode 100644 router/middleware/token/token_test.go create mode 100644 router/middleware/user/context.go create mode 100644 router/middleware/user/context_test.go create mode 100644 router/middleware/user/doc.go create mode 100644 router/middleware/user/user.go create mode 100644 router/middleware/user/user_test.go diff --git a/cmd/server/server.go b/cmd/server/server.go index 857c11c1..1df5cf09 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -83,6 +83,7 @@ func server(c *cli.Context) error { router := router.Load( middleware.RequestVersion, // TODO: middleware.Executor(executors), + middleware.Secret(c.String("vela-secret")), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) diff --git a/go.mod b/go.mod index 9e6d893b..9ef2af2f 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,10 @@ require ( github.com/go-vela/mock v0.1.4 github.com/go-vela/sdk-go v0.1.4 github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 + github.com/gogo/protobuf v1.2.0 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/onsi/ginkgo v1.10.3 // indirect github.com/onsi/gomega v1.7.1 // indirect @@ -26,9 +28,14 @@ require ( github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.4.2 github.com/urfave/cli v1.22.1 + golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect google.golang.org/grpc v1.24.0 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 + gopkg.in/yaml.v2 v2.2.5 // indirect gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index f92c81f3..fcbab76b 100644 --- a/go.sum +++ b/go.sum @@ -56,6 +56,8 @@ github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 h1:SbkNzV2t5gFTzgF github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -81,6 +83,11 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= @@ -144,20 +151,30 @@ github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -169,18 +186,29 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/nt golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= @@ -195,6 +223,9 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go new file mode 100644 index 00000000..694d86e2 --- /dev/null +++ b/router/middleware/perm/doc.go @@ -0,0 +1,13 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package perm provides the ability for inserting +// Vela user permissions resources into or extracting Vela user permissions +// resources from the middleware chain for the API. +// +// Usage: +// +// import "github.com/go-vela/worker/router/middleware/perm" + +package perm diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go new file mode 100644 index 00000000..3060fb2f --- /dev/null +++ b/router/middleware/perm/perm.go @@ -0,0 +1,35 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package perm + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-vela/types" + "github.com/go-vela/worker/router/middleware/user" + + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" +) + +// MustServer ensures the user is the vela server +func MustServer() gin.HandlerFunc { + return func(c *gin.Context) { + u := user.Retrieve(c) + + if strings.EqualFold(u.GetName(), "vela-server") { + return + } + + msg := fmt.Sprintf("User %s is not a platform admin", u.GetName()) + err := c.Error(fmt.Errorf(msg)) + if err != nil { + logrus.Error(err) + } + c.AbortWithStatusJSON(http.StatusUnauthorized, types.Error{Message: &msg}) + } +} diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go new file mode 100644 index 00000000..3c1b41bd --- /dev/null +++ b/router/middleware/perm/perm_test.go @@ -0,0 +1,90 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package perm + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" + + "github.com/go-vela/worker/router/middleware/user" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" +) + +func TestPerm_MustServer_success(t *testing.T) { + // setup types + secret := "superSecret" + + u := new(library.User) + u.SetID(1) + u.SetName("vela-server") + u.SetToken("bar") + u.SetHash("baz") + u.SetAdmin(true) + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) + context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + + // setup vela mock server + engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) + engine.Use(user.Establish()) + engine.Use(MustServer()) + engine.GET("/server/users", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + s1 := httptest.NewServer(engine) + defer s1.Close() + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("MustServer returned %v, want %v", resp.Code, http.StatusOK) + } +} + +func TestPerm_MustServer_failure(t *testing.T) { + // setup types + secret := "foo" + + u := new(library.User) + u.SetID(1) + u.SetName("not-vela-server") + u.SetToken("bar") + u.SetHash("baz") + u.SetAdmin(true) + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) + context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + + // setup vela mock server + engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) + engine.Use(user.Establish()) + engine.Use(MustServer()) + engine.GET("/server/users", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + s1 := httptest.NewServer(engine) + defer s1.Close() + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("MustServer returned %v, want %v", resp.Code, http.StatusUnauthorized) + } +} diff --git a/router/middleware/secret.go b/router/middleware/secret.go new file mode 100644 index 00000000..304aaa30 --- /dev/null +++ b/router/middleware/secret.go @@ -0,0 +1,18 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "github.com/gin-gonic/gin" +) + +// Secret is a middleware function that attaches the secret used for +// server <-> agent communication to the context of every http.Request. +func Secret(secret string) gin.HandlerFunc { + return func(c *gin.Context) { + c.Set("secret", secret) + c.Next() + } +} diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go new file mode 100644 index 00000000..3c1a6f0e --- /dev/null +++ b/router/middleware/token/doc.go @@ -0,0 +1,13 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package token provides the ability for inserting +// Vela token resources into or extracting Vela token +// resources from the middleware chain for the API. +// +// Usage: +// +// import "github.com/go-vela/worker/router/middleware/token" + +package token diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go new file mode 100644 index 00000000..9bab937b --- /dev/null +++ b/router/middleware/token/token.go @@ -0,0 +1,30 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package token + +import ( + "fmt" + "net/http" + "strings" +) + +// Retrieve gets the token from the provided request http.Request +// to be parsed and validated. This is called on every request +// to enable capturing the user making the request and validating +// they have the proper access. The following methods of providing +// authentication to Vela are supported: +// +// * Bearer token in `Authorization` header +func Retrieve(r *http.Request) (string, error) { + // get the token from the `Authorization` header + token := r.Header.Get("Authorization") + if len(token) > 0 { + if strings.Contains(token, "Bearer") { + return strings.Split(token, "Bearer ")[1], nil + } + } + + return "", fmt.Errorf("No token provided in Authorization header") +} diff --git a/router/middleware/token/token_test.go b/router/middleware/token/token_test.go new file mode 100644 index 00000000..bdb305b3 --- /dev/null +++ b/router/middleware/token/token_test.go @@ -0,0 +1,46 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package token + +import ( + "fmt" + "net/http" + "strings" + "testing" +) + +func TestToken_Retrieve(t *testing.T) { + // setup types + want := "foobar" + + header := fmt.Sprintf("Bearer %s", want) + request, _ := http.NewRequest(http.MethodGet, "/test", nil) + request.Header.Set("Authorization", header) + + // run test + got, err := Retrieve(request) + if err != nil { + t.Errorf("Retrieve returned err: %v", err) + } + + if !strings.EqualFold(got, want) { + t.Errorf("Retrieve is %v, want %v", got, want) + } +} + +func TestToken_Retrieve_Error(t *testing.T) { + // setup types + request, _ := http.NewRequest(http.MethodGet, "/test", nil) + + // run test + got, err := Retrieve(request) + if err == nil { + t.Errorf("Retrieve should have returned err") + } + + if len(got) > 0 { + t.Errorf("Retrieve is %v, want \"\"", got) + } +} diff --git a/router/middleware/user/context.go b/router/middleware/user/context.go new file mode 100644 index 00000000..83261ebf --- /dev/null +++ b/router/middleware/user/context.go @@ -0,0 +1,39 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package user + +import ( + "context" + + "github.com/go-vela/types/library" +) + +const key = "user" + +// Setter defines a context that enables setting values. +type Setter interface { + Set(string, interface{}) +} + +// FromContext returns the User associated with this context. +func FromContext(c context.Context) *library.User { + value := c.Value(key) + if value == nil { + return nil + } + + u, ok := value.(*library.User) + if !ok { + return nil + } + + return u +} + +// ToContext adds the User to this context if it supports +// the Setter interface. +func ToContext(c Setter, u *library.User) { + c.Set(key, u) +} diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go new file mode 100644 index 00000000..5ed27789 --- /dev/null +++ b/router/middleware/user/context_test.go @@ -0,0 +1,90 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package user + +import ( + "testing" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" +) + +func TestUser_FromContext(t *testing.T) { + // setup types + uID := int64(1) + want := &library.User{ID: &uID} + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, want) + + // run test + got := FromContext(context) + + if got != want { + t.Errorf("FromContext is %v, want %v", got, want) + } +} + +func TestUser_FromContext_Bad(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, nil) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestUser_FromContext_WrongType(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, 1) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestUser_FromContext_Empty(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestUser_ToContext(t *testing.T) { + // setup types + uID := int64(1) + want := &library.User{ID: &uID} + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + ToContext(context, want) + + // run test + got := context.Value(key) + + if got != want { + t.Errorf("ToContext is %v, want %v", got, want) + } +} diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go new file mode 100644 index 00000000..8d3ac9e2 --- /dev/null +++ b/router/middleware/user/doc.go @@ -0,0 +1,13 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package user provides the ability for inserting +// Vela user resources into or extracting Vela user +// resources from the middleware chain for the API. +// +// Usage: +// +// import "github.com/go-vela/worker/router/middleware/user" + +package user diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go new file mode 100644 index 00000000..8a3b9344 --- /dev/null +++ b/router/middleware/user/user.go @@ -0,0 +1,44 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package user + +import ( + "net/http" + "strings" + + "github.com/go-vela/worker/router/middleware/token" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" +) + +// Retrieve gets the user in the given context +func Retrieve(c *gin.Context) *library.User { + return FromContext(c) +} + +// Establish sets the user in the given context +func Establish() gin.HandlerFunc { + return func(c *gin.Context) { + u := new(library.User) + + t, err := token.Retrieve(c.Request) + if err != nil { + c.AbortWithStatusJSON(http.StatusUnauthorized, err.Error()) + return + } + + secret := c.MustGet("secret").(string) + if strings.EqualFold(t, secret) { + u.SetName("vela-server") + u.SetActive(true) + u.SetAdmin(true) + } + + ToContext(c, u) + c.Next() + } +} diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go new file mode 100644 index 00000000..3d204f3e --- /dev/null +++ b/router/middleware/user/user_test.go @@ -0,0 +1,156 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package user + +import ( + "fmt" + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" +) + +func TestUser_Retrieve(t *testing.T) { + // setup types + want := new(library.User) + want.SetID(1) + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + ToContext(context, want) + + // run test + got := Retrieve(context) + + if got != want { + t.Errorf("Retrieve is %v, want %v", got, want) + } +} + +func TestUser_Establish(t *testing.T) { + // setup types + secret := "superSecret" + got := new(library.User) + want := new(library.User) + want.SetName("vela-server") + want.SetActive(true) + want.SetAdmin(true) + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) + context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + + // setup vela mock server + engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) + engine.Use(Establish()) + engine.GET("/users/:user", func(c *gin.Context) { + got = Retrieve(c) + + c.Status(http.StatusOK) + }) + s1 := httptest.NewServer(engine) + defer s1.Close() + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Establish is %v, want %v", got, want) + } +} + +func TestUser_Establish_NoToken(t *testing.T) { + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo", nil) + + // setup mock server + engine.Use(Establish()) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusUnauthorized { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusUnauthorized) + } +} + +func TestUser_Establish_SecretValid(t *testing.T) { + // setup types + secret := "superSecret" + + want := new(library.User) + want.SetName("vela-server") + want.SetActive(true) + want.SetAdmin(true) + + got := new(library.User) + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) + context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + + // setup vela mock server + engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) + engine.Use(Establish()) + engine.GET("/users/:user", func(c *gin.Context) { + got = Retrieve(c) + + c.Status(http.StatusOK) + }) + s := httptest.NewServer(engine) + defer s.Close() + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Establish is %v, want %v", got, want) + } +} + +func TestUser_Establish_NoAuthorizeUser(t *testing.T) { + + // setup types + secret := "superSecret" + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo?access_token=bar", nil) + + // setup vela mock server + engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) + engine.Use(Establish()) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusUnauthorized { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusUnauthorized) + } +} diff --git a/router/router.go b/router/router.go index 3ca0f667..950e8244 100644 --- a/router/router.go +++ b/router/router.go @@ -8,6 +8,8 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware" + "github.com/go-vela/worker/router/middleware/perm" + "github.com/go-vela/worker/router/middleware/user" ) const ( @@ -29,13 +31,13 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { r.GET("/health", api.Health) r.GET("/metrics", gin.WrapH(api.Metrics())) - r.POST("/shutdown", api.Shutdown) // api endpoints - baseAPI := r.Group(base) + baseAPI := r.Group(base, user.Establish(), perm.MustServer()) { // executor endpoints executorHandlers(baseAPI) + baseAPI.POST("/shutdown", api.Shutdown) } // end of api From ac2791d9c68ada680d545ee865ca049c237dbfef Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 27 Nov 2019 10:24:09 -0600 Subject: [PATCH 037/430] Use setters for Vela resources (#27) --- cmd/server/operate.go | 18 ++++++++++---- executor/linux/build.go | 52 +++++++++++++++++---------------------- executor/linux/service.go | 18 ++++++-------- executor/linux/stage.go | 9 +++---- executor/linux/step.go | 25 +++++++++---------- 5 files changed, 58 insertions(+), 64 deletions(-) diff --git a/cmd/server/operate.go b/cmd/server/operate.go index 82ae5c1b..23e54fd1 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -52,19 +52,27 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() + logger.Info("pulling secrets") + // pull secrets for the build on the executor + err = e.PullSecret(ctx) + if err != nil { + logger.Errorf("unable to pull secrets: %v", err) + return err + } + // create the build on the executor - logger.Infof("creating build") + logger.Info("creating build") err = e.CreateBuild(ctx) if err != nil { - logger.Errorf("unable to create build: %w", err) + logger.Errorf("unable to create build: %v", err) return err } // execute the build on the executor - logger.Infof("executing build") + logger.Info("executing build") err = e.ExecBuild(ctx) if err != nil { - logger.Errorf("unable to execute build: %w", err) + logger.Errorf("unable to execute build: %v", err) return err } @@ -72,7 +80,7 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim logger.Info("destroying build") err = e.DestroyBuild(ctx) if err != nil { - logger.Errorf("unable to destroy build: %w", err) + logger.Errorf("unable to destroy build: %v", err) return err } diff --git a/executor/linux/build.go b/executor/linux/build.go index 16261a83..e64d4d77 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/go-vela/sdk-go/vela" "golang.org/x/sync/errgroup" "github.com/go-vela/types/constants" @@ -37,9 +36,9 @@ func (c *client) CreateBuild(ctx context.Context) error { // because it is worker related and not build. if err != nil { // update the build fields - b.Finished = vela.Int64(time.Now().UTC().Unix()) - b.Status = vela.String(constants.StatusError) - b.Error = vela.String(err.Error()) + b.SetFinished(time.Now().UTC().Unix()) + b.SetStatus(constants.StatusError) + b.SetError(err.Error()) c.logger.Info("uploading errored stated") // send API call to update the build @@ -51,12 +50,12 @@ func (c *client) CreateBuild(ctx context.Context) error { }() // update the build fields - b.Status = vela.String(constants.StatusRunning) - b.Started = vela.Int64(time.Now().UTC().Unix()) - b.Host = vela.String(c.Hostname) + b.SetStatus(constants.StatusRunning) + b.SetStarted(time.Now().UTC().Unix()) + b.SetHost(c.Hostname) // TODO: This should not be hardcoded - b.Distribution = vela.String("linux") - b.Runtime = vela.String("docker") + b.SetDistribution("linux") + b.SetRuntime("docker") c.logger.Info("uploading build state") // send API call to update the build @@ -79,13 +78,6 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to create volume: %w", err) } - c.logger.Info("pulling secrets") - // pull secrets for the pipeline - err = c.PullSecret(ctx) - if err != nil { - return fmt.Errorf("unable to pull secrets: %w", err) - } - // create the services for the pipeline for _, s := range p.Services { // TODO: remove this; but we need it for tests @@ -120,7 +112,7 @@ func (c *client) CreateBuild(ctx context.Context) error { } } - b.Status = vela.String(constants.StatusSuccess) + b.SetStatus(constants.StatusSuccess) c.build = b return nil @@ -139,9 +131,9 @@ func (c *client) ExecBuild(ctx context.Context) error { // because it is worker related and not build. if err != nil { // update the build fields - b.Finished = vela.Int64(time.Now().UTC().Unix()) - b.Status = vela.String(constants.StatusError) - b.Error = vela.String(err.Error()) + b.SetFinished(time.Now().UTC().Unix()) + b.SetStatus(constants.StatusError) + b.SetError(err.Error()) c.logger.Info("uploading errored stated") // send API call to update the build @@ -196,15 +188,15 @@ func (c *client) ExecBuild(ctx context.Context) error { // check if we ignore step failures if !s.Ruleset.Continue { // set build status to failure - b.Status = vela.String(constants.StatusFailure) + b.SetStatus(constants.StatusFailure) } // update the step fields - c.steps[s.ID].ExitCode = vela.Int(s.ExitCode) - c.steps[s.ID].Status = vela.String(constants.StatusFailure) + c.steps[s.ID].SetExitCode(s.ExitCode) + c.steps[s.ID].SetStatus(constants.StatusFailure) } - c.steps[s.ID].Finished = vela.Int64(time.Now().UTC().Unix()) + c.steps[s.ID].SetFinished(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", s.Name) // send API call to update the build _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[s.ID]) @@ -245,7 +237,7 @@ func (c *client) ExecBuild(ctx context.Context) error { return err } - b.Finished = vela.Int64(time.Now().UTC().Unix()) + b.SetFinished(time.Now().UTC().Unix()) c.logger.Info("uploading build state") // send API call to update the build _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) @@ -269,9 +261,9 @@ func (c *client) DestroyBuild(ctx context.Context) error { // because it is worker related and not build. if err != nil { // update the build fields - b.Finished = vela.Int64(time.Now().UTC().Unix()) - b.Status = vela.String(constants.StatusError) - b.Error = vela.String(err.Error()) + b.SetFinished(time.Now().UTC().Unix()) + b.SetStatus(constants.StatusError) + b.SetError(err.Error()) c.logger.Info("uploading errored stated") // send API call to update the build @@ -313,8 +305,8 @@ func (c *client) DestroyBuild(ctx context.Context) error { c.logger.Infof("uploading %s service state", s.Name) // send API call to update the build - c.services[s.ID].ExitCode = vela.Int(s.ExitCode) - c.services[s.ID].Finished = vela.Int64(time.Now().UTC().Unix()) + c.services[s.ID].SetExitCode(s.ExitCode) + c.services[s.ID].SetFinished(time.Now().UTC().Unix()) _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.services[s.ID]) if err != nil { c.logger.Errorf("unable to upload service status: %w", err) diff --git a/executor/linux/service.go b/executor/linux/service.go index 8f2f426f..89972fcb 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -10,7 +10,6 @@ import ( "context" "time" - "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" @@ -47,12 +46,11 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error }) // update the engine service object - s := &library.Service{ - Name: vela.String(ctn.Name), - Number: vela.Int(ctn.Number), - Status: vela.String(constants.StatusRunning), - Started: vela.Int64(time.Now().UTC().Unix()), - } + s := new(library.Service) + s.SetName(ctn.Name) + s.SetNumber(ctn.Number) + s.SetStatus(constants.StatusRunning) + s.SetStarted(time.Now().UTC().Unix()) logger.Debug("uploading service state") // send API call to update the service @@ -60,7 +58,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error if err != nil { return err } - s.Status = vela.String(constants.StatusSuccess) + s.SetStatus(constants.StatusSuccess) // add a service to a map c.services[ctn.ID] = s @@ -133,7 +131,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Trace(logs.String()) // update the existing log with the new bytes - l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) + l.SetData(append(l.GetData(), logs.Bytes()...)) logger.Debug("appending logs") l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) @@ -148,7 +146,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Trace(logs.String()) // update the existing log with the last bytes - l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) + l.SetData(append(l.GetData(), logs.Bytes()...)) logger.Debug("uploading logs") // send API call to update the logs for the service diff --git a/executor/linux/stage.go b/executor/linux/stage.go index ae194784..459c457a 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -9,7 +9,6 @@ import ( "fmt" "time" - "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" @@ -99,15 +98,15 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] // check if we ignore step failures if !step.Ruleset.Continue { // set build status to failure - b.Status = vela.String(constants.StatusFailure) + b.SetStatus(constants.StatusFailure) } // update the step fields - c.steps[step.ID].ExitCode = vela.Int(step.ExitCode) - c.steps[step.ID].Status = vela.String(constants.StatusFailure) + c.steps[step.ID].SetExitCode(step.ExitCode) + c.steps[step.ID].SetStatus(constants.StatusFailure) } - c.steps[step.ID].Finished = vela.Int64(time.Now().UTC().Unix()) + c.steps[step.ID].SetFinished(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", step.Name) // send API call to update the build _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[step.ID]) diff --git a/executor/linux/step.go b/executor/linux/step.go index 605ecb42..b3950f01 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -15,8 +15,6 @@ import ( "github.com/go-vela/worker/version" - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" @@ -103,15 +101,14 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { }) // update the engine step object - s := &library.Step{ - Name: vela.String(ctn.Name), - Number: vela.Int(ctn.Number), - Status: vela.String(constants.StatusRunning), - Started: vela.Int64(time.Now().UTC().Unix()), - Host: vela.String(ctn.Environment["VELA_HOST"]), - Runtime: vela.String(ctn.Environment["VELA_RUNTIME"]), - Distribution: vela.String(ctn.Environment["VELA_DISTRIBUTION"]), - } + s := new(library.Step) + s.SetName(ctn.Name) + s.SetNumber(ctn.Number) + s.SetStatus(constants.StatusRunning) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(ctn.Environment["VELA_HOST"]) + s.SetRuntime(ctn.Environment["VELA_RUNTIME"]) + s.SetDistribution(ctn.Environment["VELA_DISTRIBUTION"]) logger.Debug("uploading step state") // send API call to update the step @@ -119,7 +116,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { if err != nil { return err } - s.Status = vela.String(constants.StatusSuccess) + s.SetStatus(constants.StatusSuccess) // add a step to a map c.steps[ctn.ID] = s @@ -192,7 +189,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Trace(logs.String()) // update the existing log with the new bytes - l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) + l.SetData(append(l.GetData(), logs.Bytes()...)) logger.Debug("appending logs") // send API call to update the logs for the step @@ -208,7 +205,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Trace(logs.String()) // update the existing log with the last bytes - l.Data = vela.Bytes(append(l.GetData(), logs.Bytes()...)) + l.SetData(append(l.GetData(), logs.Bytes()...)) logger.Debug("uploading logs") // send API call to update the logs for the step From 699577057315db77e4039addebb3dfea58d62bc6 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 2 Dec 2019 10:32:23 -0600 Subject: [PATCH 038/430] Update client maps to be sync map (#28) * fix(maps) update client maps to be sync map * fix(error): make error messages more clear --- executor/linux/build.go | 27 ++++++++++++++++++++------- executor/linux/build_test.go | 6 +++--- executor/linux/linux.go | 17 +++++++++-------- executor/linux/service.go | 12 +++++++++--- executor/linux/service_test.go | 6 ++---- executor/linux/stage.go | 15 +++++++++++---- executor/linux/step.go | 11 ++++++++--- executor/linux/step_test.go | 6 ++---- 8 files changed, 64 insertions(+), 36 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index e64d4d77..fcc74668 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -13,6 +13,7 @@ import ( "golang.org/x/sync/errgroup" "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" "github.com/sirupsen/logrus" ) @@ -183,6 +184,12 @@ func (c *client) ExecBuild(ctx context.Context) error { return fmt.Errorf("unable to execute step: %w", err) } + result, ok := c.steps.Load(s.ID) + if !ok { + return fmt.Errorf("unable to get step from client") + } + cStep := result.(*library.Step) + // check the step exit code if s.ExitCode != 0 { // check if we ignore step failures @@ -192,14 +199,14 @@ func (c *client) ExecBuild(ctx context.Context) error { } // update the step fields - c.steps[s.ID].SetExitCode(s.ExitCode) - c.steps[s.ID].SetStatus(constants.StatusFailure) + cStep.SetExitCode(s.ExitCode) + cStep.SetStatus(constants.StatusFailure) } - c.steps[s.ID].SetFinished(time.Now().UTC().Unix()) + cStep.SetFinished(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", s.Name) // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[s.ID]) + _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cStep) if err != nil { return err } @@ -304,10 +311,16 @@ func (c *client) DestroyBuild(ctx context.Context) error { } c.logger.Infof("uploading %s service state", s.Name) + // send API call to update the build - c.services[s.ID].SetExitCode(s.ExitCode) - c.services[s.ID].SetFinished(time.Now().UTC().Unix()) - _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.services[s.ID]) + result, ok := c.services.Load(s.ID) + if !ok { + return fmt.Errorf("unable to get service from client") + } + cService := result.(*library.Service) + cService.SetExitCode(s.ExitCode) + cService.SetFinished(time.Now().UTC().Unix()) + _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cService) if err != nil { c.logger.Errorf("unable to upload service status: %w", err) } diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index ef812063..ae3de8e8 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -625,9 +625,9 @@ func TestExecutor_DestroyBuild_Success(t *testing.T) { e.WithBuild(test.build) e.WithPipeline(test.pipeline) e.WithRepo(test.repo) - e.services = make(map[string]*library.Service) - e.services[e.pipeline.Services[0].ID] = new(library.Service) - e.services[e.pipeline.Services[0].ID].Number = vela.Int(1) + svc := new(library.Service) + svc.SetNumber(1) + e.services.Store(e.pipeline.Services[0].ID, svc) got := e.DestroyBuild(context.Background()) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 05765da5..075c9244 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -7,6 +7,7 @@ package linux import ( "fmt" "os" + "sync" "github.com/go-vela/worker/executor" @@ -28,10 +29,10 @@ type client struct { build *library.Build pipeline *pipeline.Build repo *library.Repo - services map[string]*library.Service - serviceLogs map[string]*library.Log - steps map[string]*library.Step - stepLogs map[string]*library.Log + services sync.Map + serviceLogs sync.Map + steps sync.Map + stepLogs sync.Map user *library.User } @@ -60,10 +61,10 @@ func New(c *vela.Client, r runtime.Engine) (*client, error) { Runtime: r, Hostname: h, logger: l, - services: make(map[string]*library.Service), - serviceLogs: make(map[string]*library.Log), - steps: make(map[string]*library.Step), - stepLogs: make(map[string]*library.Log), + services: sync.Map{}, + serviceLogs: sync.Map{}, + steps: sync.Map{}, + stepLogs: sync.Map{}, }, nil } diff --git a/executor/linux/service.go b/executor/linux/service.go index 89972fcb..330a9ee0 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -8,6 +8,7 @@ import ( "bufio" "bytes" "context" + "fmt" "time" "github.com/go-vela/types/constants" @@ -61,7 +62,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error s.SetStatus(constants.StatusSuccess) // add a service to a map - c.services[ctn.ID] = s + c.services.Store(ctn.ID, s) // get the service log here logger.Debug("retrieve service log") @@ -72,7 +73,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error } // add a step log to a map - c.serviceLogs[ctn.ID] = l + c.serviceLogs.Store(ctn.ID, l) return nil } @@ -81,7 +82,12 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { b := c.build r := c.repo - l := c.serviceLogs[ctn.ID] + + result, ok := c.serviceLogs.Load(ctn.ID) + if !ok { + return fmt.Errorf("unable to get service log from client") + } + l := result.(*library.Log) // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 8989e30a..45e0e7dc 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -193,10 +193,8 @@ func TestExecutor_ExecService_Success(t *testing.T) { AllowDeploy: vela.Bool(false), AllowTag: vela.Bool(false), }) - e.serviceLogs = make(map[string]*library.Log) - e.serviceLogs[e.pipeline.Services[0].ID] = new(library.Log) - e.services = make(map[string]*library.Service) - e.services[e.pipeline.Services[0].ID] = new(library.Service) + e.serviceLogs.Store(e.pipeline.Services[0].ID, new(library.Log)) + e.services.Store(e.pipeline.Services[0].ID, new(library.Service)) // run test got := e.ExecService(context.Background(), e.pipeline.Services[0]) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 459c457a..2f46f1d6 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -10,6 +10,7 @@ import ( "time" "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) @@ -93,6 +94,12 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] return err } + result, ok := c.steps.Load(step.ID) + if !ok { + return fmt.Errorf("unable to get step from client") + } + cStep := result.(*library.Step) + // check the step exit code if step.ExitCode != 0 { // check if we ignore step failures @@ -102,14 +109,14 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] } // update the step fields - c.steps[step.ID].SetExitCode(step.ExitCode) - c.steps[step.ID].SetStatus(constants.StatusFailure) + cStep.SetExitCode(step.ExitCode) + cStep.SetStatus(constants.StatusFailure) } - c.steps[step.ID].SetFinished(time.Now().UTC().Unix()) + cStep.SetFinished(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", step.Name) // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), c.steps[step.ID]) + _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cStep) if err != nil { return err } diff --git a/executor/linux/step.go b/executor/linux/step.go index b3950f01..e23be7b6 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -119,7 +119,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { s.SetStatus(constants.StatusSuccess) // add a step to a map - c.steps[ctn.ID] = s + c.steps.Store(ctn.ID, s) // get the step log here logger.Debug("retrieve step log") @@ -130,7 +130,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { } // add a step log to a map - c.stepLogs[ctn.ID] = l + c.stepLogs.Store(ctn.ID, l) return nil } @@ -139,7 +139,12 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { b := c.build r := c.repo - l := c.stepLogs[ctn.ID] + + result, ok := c.stepLogs.Load(ctn.ID) + if !ok { + return fmt.Errorf("unable to get step log from client") + } + l := result.(*library.Log) // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 9c020c51..d435b41c 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -305,10 +305,8 @@ func TestExecutor_ExecStep_Success(t *testing.T) { AllowDeploy: vela.Bool(false), AllowTag: vela.Bool(false), }) - e.stepLogs = make(map[string]*library.Log) - e.stepLogs[e.pipeline.Steps[0].ID] = new(library.Log) - e.steps = make(map[string]*library.Step) - e.steps[e.pipeline.Steps[0].ID] = new(library.Step) + e.stepLogs.Store(e.pipeline.Steps[0].ID, new(library.Log)) + e.steps.Store(e.pipeline.Steps[0].ID, new(library.Step)) // run test got := e.ExecStep(context.Background(), e.pipeline.Steps[0]) From 2d99ee64a84a481eb09502015d6af96a3b56bdb8 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 2 Dec 2019 10:40:06 -0600 Subject: [PATCH 039/430] fix(logs): upload detached container logs (#29) --- executor/linux/service.go | 17 +++++------------ executor/linux/step.go | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/executor/linux/service.go b/executor/linux/service.go index 330a9ee0..93e60f93 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -94,18 +94,6 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error "service": ctn.Name, }) - // run the container in a detached state - if ctn.Detach { - logger.Debug("running container in detach mode") - // run the runtime container - err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) - if err != nil { - return err - } - - return nil - } - logger.Debug("running container") // run the runtime container err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) @@ -164,6 +152,11 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error return nil }() + // do not wait for detached containers + if ctn.Detach { + return nil + } + logger.Debug("waiting for container") // wait for the runtime container err = c.Runtime.WaitContainer(ctx, ctn) diff --git a/executor/linux/step.go b/executor/linux/step.go index e23be7b6..3e250305 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -151,18 +151,6 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { "step": ctn.Name, }) - // run the container in a detached state - if ctn.Detach { - logger.Debug("running container in detach mode") - // run the runtime container - err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) - if err != nil { - return err - } - - return nil - } - logger.Debug("running container") // run the runtime container err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) @@ -222,6 +210,11 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { return nil }() + // do not wait for detached containers + if ctn.Detach { + return nil + } + logger.Debug("waiting for container") // wait for the runtime container err = c.Runtime.WaitContainer(ctx, ctn) From 65cf7752e7a86b04fb201155b6ed106576e713a8 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 2 Dec 2019 11:18:35 -0600 Subject: [PATCH 040/430] Capture ID from runtime network/volume (#30) * improvement: capture network id from runtime * improvement: capture volume id from runtime --- executor/linux/build.go | 4 ++-- runtime/docker/network.go | 8 ++++---- runtime/docker/network_test.go | 4 ++-- runtime/docker/volume.go | 8 ++++---- runtime/docker/volume_test.go | 4 ++-- runtime/runtime.go | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index fcc74668..7845a3fe 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -67,14 +67,14 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Info("creating network") // create the runtime network for the pipeline - err = c.Runtime.CreateNetwork(ctx, p) + _, err = c.Runtime.CreateNetwork(ctx, p) if err != nil { return fmt.Errorf("unable to create network: %w", err) } c.logger.Info("creating volume") // create the runtime volume for the pipeline - err = c.Runtime.CreateVolume(ctx, p) + _, err = c.Runtime.CreateVolume(ctx, p) if err != nil { return fmt.Errorf("unable to create volume: %w", err) } diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 0ce14f08..5fd790b5 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -14,7 +14,7 @@ import ( ) // CreateNetwork creates the pipeline network -func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { +func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) (string, error) { logrus.Tracef("Creating network for pipeline %s", b.ID) // create options for creating network @@ -23,12 +23,12 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { } // send API call to create the network - _, err := c.Runtime.NetworkCreate(ctx, b.ID, opts) + n, err := c.Runtime.NetworkCreate(ctx, b.ID, opts) if err != nil { - return err + return "", err } - return nil + return n.ID, nil } // RemoveNetwork deletes the pipeline network diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 9d9c2b0c..b268d3f7 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -17,7 +17,7 @@ func TestDocker_CreateNetwork_Success(t *testing.T) { c, _ := NewMock() // run test - got := c.CreateNetwork(context.Background(), &pipeline.Build{ + _, got := c.CreateNetwork(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) @@ -38,7 +38,7 @@ func TestDocker_CreateNetwork_Failure(t *testing.T) { c, _ := NewMock() // run test - got := c.CreateNetwork(context.Background(), &pipeline.Build{ + _, got := c.CreateNetwork(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index b1c4d82a..d78c6b85 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -13,7 +13,7 @@ import ( ) // CreateVolume creates the pipeline volume. -func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { +func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) (string, error) { logrus.Tracef("Creating volume for pipeline %s", b.ID) // create options for creating volume @@ -23,12 +23,12 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { } // send API call to create the volume - _, err := c.Runtime.VolumeCreate(ctx, opts) + v, err := c.Runtime.VolumeCreate(ctx, opts) if err != nil { - return err + return "", err } - return nil + return v.Name, nil } // RemoveVolume deletes the pipeline volume. diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 13cbf8b3..2b5df6d9 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -17,7 +17,7 @@ func TestDocker_CreateVolume_Success(t *testing.T) { c, _ := NewMock() // run test - got := c.CreateVolume(context.Background(), &pipeline.Build{ + _, got := c.CreateVolume(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) @@ -38,7 +38,7 @@ func TestDocker_CreateVolume_Failure(t *testing.T) { c, _ := NewMock() // run test - got := c.CreateVolume(context.Background(), &pipeline.Build{ + _, got := c.CreateVolume(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) diff --git a/runtime/runtime.go b/runtime/runtime.go index a91e328a..4e528fed 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -40,7 +40,7 @@ type Engine interface { // CreateNetwork defines a function that // creates the pipeline network. - CreateNetwork(context.Context, *pipeline.Build) error + CreateNetwork(context.Context, *pipeline.Build) (string, error) // RemoveNetwork defines a function that // deletes the pipeline network. RemoveNetwork(context.Context, *pipeline.Build) error @@ -49,7 +49,7 @@ type Engine interface { // CreateVolume defines a function that // creates the pipeline volume. - CreateVolume(context.Context, *pipeline.Build) error + CreateVolume(context.Context, *pipeline.Build) (string, error) // RemoveVolume defines a function that // deletes the pipeline volume. RemoveVolume(context.Context, *pipeline.Build) error From 9b001db3ead3bb8338ce52ef84fb0a7cfcdeab33 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 3 Dec 2019 09:51:53 -0600 Subject: [PATCH 041/430] feat: add ability to inspect runtime resources (#31) * feat: enable inspecting runtime network * feat: enable inspecting runtime volume * improvement: update inspecting runtime container --- executor/linux/service.go | 4 ++-- executor/linux/step.go | 2 +- runtime/docker/container.go | 8 ++++---- runtime/docker/container_test.go | 8 ++++---- runtime/docker/network.go | 20 ++++++++++++++++++-- runtime/docker/volume.go | 13 +++++++++++++ runtime/runtime.go | 12 +++++++++--- 7 files changed, 51 insertions(+), 16 deletions(-) diff --git a/executor/linux/service.go b/executor/linux/service.go index 93e60f93..a279b1e2 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -166,7 +166,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Debug("inspecting container") // inspect the runtime container - err = c.Runtime.InfoContainer(ctx, ctn) + _, err = c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } @@ -183,7 +183,7 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er logger.Debug("inspecting container") // inspect the runtime container - err := c.Runtime.InfoContainer(ctx, ctn) + _, err := c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } diff --git a/executor/linux/step.go b/executor/linux/step.go index 3e250305..da748b3a 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -224,7 +224,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Debug("inspecting container") // inspect the runtime container - err = c.Runtime.InfoContainer(ctx, ctn) + _, err = c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 8acc1eae..0d1c9ba1 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -22,20 +22,20 @@ import ( "github.com/sirupsen/logrus" ) -// InfoContainer gets information on the pipeline container. -func (c *client) InfoContainer(ctx context.Context, ctn *pipeline.Container) error { +// InspectContainer inspects the pipeline container. +func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { logrus.Tracef("Inspecting container for step %s", ctn.ID) // send API call to inspect the container container, err := c.Runtime.ContainerInspect(ctx, ctn.ID) if err != nil { - return err + return nil, err } // set the exit code ctn.ExitCode = container.State.ExitCode - return nil + return []byte(container.Image + "\n"), nil } // RemoveContainer deletes (kill, remove) the pipeline container. diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index 8bc97826..7e61ceea 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -11,13 +11,13 @@ import ( "github.com/go-vela/types/pipeline" ) -func TestDocker_InfoContainer_Success(t *testing.T) { +func TestDocker_InspectContainer_Success(t *testing.T) { // setup Docker c, _ := NewMock() // run test - got := c.InfoContainer(context.Background(), &pipeline.Container{ + _, got := c.InspectContainer(context.Background(), &pipeline.Container{ ID: "container_id", Image: "alpine:latest", }) @@ -31,13 +31,13 @@ func TestDocker_InfoContainer_Success(t *testing.T) { } } -func TestDocker_InfoContainer_Failure(t *testing.T) { +func TestDocker_InspectContainer_Failure(t *testing.T) { // setup Docker c, _ := NewMock() // run test - got := c.InfoContainer(context.Background(), &pipeline.Container{}) + _, got := c.InspectContainer(context.Background(), &pipeline.Container{}) if got == nil { t.Errorf("InfoContainer should have returned err: %+v", got) diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 5fd790b5..01df0891 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -13,7 +13,7 @@ import ( "github.com/sirupsen/logrus" ) -// CreateNetwork creates the pipeline network +// CreateNetwork creates the pipeline network. func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) (string, error) { logrus.Tracef("Creating network for pipeline %s", b.ID) @@ -31,7 +31,23 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) (string, return n.ID, nil } -// RemoveNetwork deletes the pipeline network +// InspectNetwork inspects the pipeline network. +func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("Inspecting network for pipeline %s", b.ID) + + // create options for inspecting network + opts := types.NetworkInspectOptions{} + + // send API call to inspect the network + n, err := c.Runtime.NetworkInspect(ctx, b.ID, opts) + if err != nil { + return nil, err + } + + return []byte(n.ID + "\n"), nil +} + +// RemoveNetwork deletes the pipeline network. func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { logrus.Tracef("Removing volume for pipeline %s", b.ID) diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index d78c6b85..8a10e1f7 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -31,6 +31,19 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) (string, e return v.Name, nil } +// InspectVolume inspects the pipeline volume. +func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("Inspecting volume for pipeline %s", b.ID) + + // send API call to inspect the volume + v, err := c.Runtime.VolumeInspect(ctx, b.ID) + if err != nil { + return nil, err + } + + return []byte(v.Name + "\n"), nil +} + // RemoveVolume deletes the pipeline volume. func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { logrus.Tracef("Removing volume for pipeline %s", b.ID) diff --git a/runtime/runtime.go b/runtime/runtime.go index 4e528fed..7d74addf 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -17,9 +17,9 @@ type Engine interface { // Container Engine interface functions - // InfoContainer defines a function that gets - // information on the pipeline container. - InfoContainer(context.Context, *pipeline.Container) error + // InspectContainer defines a function that inspects + // the pipeline container. + InspectContainer(context.Context, *pipeline.Container) ([]byte, error) // RemoveContainer defines a function that deletes // (kill, remove) the pipeline container. RemoveContainer(context.Context, *pipeline.Container) error @@ -41,6 +41,9 @@ type Engine interface { // CreateNetwork defines a function that // creates the pipeline network. CreateNetwork(context.Context, *pipeline.Build) (string, error) + // InspectNetwork defines a function that + // inspects the pipeline network. + InspectNetwork(context.Context, *pipeline.Build) ([]byte, error) // RemoveNetwork defines a function that // deletes the pipeline network. RemoveNetwork(context.Context, *pipeline.Build) error @@ -50,6 +53,9 @@ type Engine interface { // CreateVolume defines a function that // creates the pipeline volume. CreateVolume(context.Context, *pipeline.Build) (string, error) + // InspectVolume defines a function that + // inspects the pipeline volume. + InspectVolume(context.Context, *pipeline.Build) ([]byte, error) // RemoveVolume defines a function that // deletes the pipeline volume. RemoveVolume(context.Context, *pipeline.Build) error From 99a3e4e3ef5ffdbb05c43ac47f4c7f09ea1ce9cb Mon Sep 17 00:00:00 2001 From: David Vader <48764154+davidvader@users.noreply.github.com> Date: Tue, 3 Dec 2019 11:25:59 -0600 Subject: [PATCH 042/430] go get -u sdk-go (#32) --- go.mod | 6 +++--- go.sum | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 9ef2af2f..0932d151 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.1.4 - github.com/go-vela/sdk-go v0.1.4 - github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 + github.com/go-vela/mock v0.2.0-rc1 + github.com/go-vela/sdk-go v0.2.0-rc1 + github.com/go-vela/types v0.2.0-rc1 github.com/gogo/protobuf v1.2.0 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index fcbab76b..470117f7 100644 --- a/go.sum +++ b/go.sum @@ -46,14 +46,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.1.4 h1:t0uG+Ot12nZ42pt4sYnDCFE4UGqMnk1aUxD3ejjAURw= -github.com/go-vela/mock v0.1.4/go.mod h1:13CEKboQJNehsj6kEpo993foP8VXdqQ0Ik2W4f75HiY= -github.com/go-vela/sdk-go v0.1.4 h1:WfM77H7jWx57L0rE0BBAMiRt1VtkJVaNaBWu3CEnWOg= -github.com/go-vela/sdk-go v0.1.4/go.mod h1:s3WbOJ+7Ir4b/zz5wgDzdOS2snccMJJK7zSQkRpYmfQ= -github.com/go-vela/types v0.1.4 h1:QrI6QlvhSn3/Uvv+XYFtLQauhtr8CsuOBnOmHp0HPg8= -github.com/go-vela/types v0.1.4/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= -github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405 h1:SbkNzV2t5gFTzgFQndzgd5NX1DPmT4G48dPtkplZsKw= -github.com/go-vela/types v0.1.5-0.20191119211417-27d1fc0f8405/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.2.0-rc1 h1:OTAyR376Z1YSBEnyEfvwWveOOOjAT+F7Wkw51aDvOoQ= +github.com/go-vela/mock v0.2.0-rc1/go.mod h1:igk2eLxOnsRHfZBnnHrpNrqmnUfRAd7d5Sf+QXLy834= +github.com/go-vela/sdk-go v0.2.0-rc1 h1:a+w/5m8B6HQlxcZYhkdzxg1JlwYEASer5T6KS1Q0VWU= +github.com/go-vela/sdk-go v0.2.0-rc1/go.mod h1:d5/rlzAEATosTJZG1VjyuCcH3XBFjYhrxpQd/c+RRkM= +github.com/go-vela/types v0.2.0-rc1 h1:UqDrFi/mBAEPy27TK2eyIzd2VQkn+JXkS8FKWr6lsnc= +github.com/go-vela/types v0.2.0-rc1/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= From 8096a93c8ac957fc686ef260803ba8032ebb5d8c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 4 Dec 2019 12:58:05 -0600 Subject: [PATCH 043/430] Add ability to inspect Runtime image (#33) --- executor/linux/build.go | 4 +-- executor/linux/service.go | 4 +-- executor/linux/step.go | 2 +- runtime/docker/container.go | 20 ++------------ runtime/docker/container_test.go | 10 +++---- runtime/docker/image.go | 47 ++++++++++++++++++++++++++++++++ runtime/docker/network.go | 8 +++--- runtime/docker/network_test.go | 4 +-- runtime/docker/volume.go | 8 +++--- runtime/docker/volume_test.go | 4 +-- runtime/runtime.go | 18 ++++++++---- 11 files changed, 84 insertions(+), 45 deletions(-) create mode 100644 runtime/docker/image.go diff --git a/executor/linux/build.go b/executor/linux/build.go index 7845a3fe..fcc74668 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -67,14 +67,14 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Info("creating network") // create the runtime network for the pipeline - _, err = c.Runtime.CreateNetwork(ctx, p) + err = c.Runtime.CreateNetwork(ctx, p) if err != nil { return fmt.Errorf("unable to create network: %w", err) } c.logger.Info("creating volume") // create the runtime volume for the pipeline - _, err = c.Runtime.CreateVolume(ctx, p) + err = c.Runtime.CreateVolume(ctx, p) if err != nil { return fmt.Errorf("unable to create volume: %w", err) } diff --git a/executor/linux/service.go b/executor/linux/service.go index a279b1e2..8464764d 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -166,7 +166,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Debug("inspecting container") // inspect the runtime container - _, err = c.Runtime.InspectContainer(ctx, ctn) + err = c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } @@ -183,7 +183,7 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er logger.Debug("inspecting container") // inspect the runtime container - _, err := c.Runtime.InspectContainer(ctx, ctn) + err := c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } diff --git a/executor/linux/step.go b/executor/linux/step.go index da748b3a..fc1c63cc 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -224,7 +224,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Debug("inspecting container") // inspect the runtime container - _, err = c.Runtime.InspectContainer(ctx, ctn) + err = c.Runtime.InspectContainer(ctx, ctn) if err != nil { return err } diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 0d1c9ba1..2673d028 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -12,7 +12,6 @@ import ( "github.com/go-vela/types/pipeline" - "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" @@ -23,19 +22,19 @@ import ( ) // InspectContainer inspects the pipeline container. -func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { +func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { logrus.Tracef("Inspecting container for step %s", ctn.ID) // send API call to inspect the container container, err := c.Runtime.ContainerInspect(ctx, ctn.ID) if err != nil { - return nil, err + return err } // set the exit code ctn.ExitCode = container.State.ExitCode - return []byte(container.Image + "\n"), nil + return nil } // RemoveContainer deletes (kill, remove) the pipeline container. @@ -292,16 +291,3 @@ func hostConfig(id string) *container.HostConfig { }, } } - -// parseImage is a helper function to parse -// the image for the provided container. -func parseImage(s string) (string, error) { - // create fully qualified reference - image, err := reference.ParseNormalizedNamed(s) - if err != nil { - return "", err - } - - // add latest tag to image if no tag was provided - return reference.TagNameOnly(image).String(), nil -} diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index 7e61ceea..9a4a8075 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -17,17 +17,17 @@ func TestDocker_InspectContainer_Success(t *testing.T) { c, _ := NewMock() // run test - _, got := c.InspectContainer(context.Background(), &pipeline.Container{ + got := c.InspectContainer(context.Background(), &pipeline.Container{ ID: "container_id", Image: "alpine:latest", }) if got != nil { - t.Error("InfoContainer should not have returned err: ", got) + t.Error("InspectContainer should not have returned err: ", got) } if got != nil { - t.Errorf("InfoContainer is %v, want nil", got) + t.Errorf("InspectContainer is %v, want nil", got) } } @@ -37,10 +37,10 @@ func TestDocker_InspectContainer_Failure(t *testing.T) { c, _ := NewMock() // run test - _, got := c.InspectContainer(context.Background(), &pipeline.Container{}) + got := c.InspectContainer(context.Background(), &pipeline.Container{}) if got == nil { - t.Errorf("InfoContainer should have returned err: %+v", got) + t.Errorf("InspectContainer should have returned err: %+v", got) } } diff --git a/runtime/docker/image.go b/runtime/docker/image.go new file mode 100644 index 00000000..97e56222 --- /dev/null +++ b/runtime/docker/image.go @@ -0,0 +1,47 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/go-vela/types/pipeline" + + "github.com/docker/distribution/reference" + + "github.com/sirupsen/logrus" +) + +// InspectImage inspects the pipeline container image. +func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { + logrus.Tracef("Parsing image %s", ctn.Image) + + // parse image from container + image, err := parseImage(ctn.Image) + if err != nil { + return nil, err + } + + // send API call to inspect the image + i, _, err := c.Runtime.ImageInspectWithRaw(ctx, image) + if err != nil { + return nil, err + } + + return []byte(i.ID + "\n"), nil +} + +// parseImage is a helper function to parse +// the image for the provided container. +func parseImage(s string) (string, error) { + // create fully qualified reference + image, err := reference.ParseNormalizedNamed(s) + if err != nil { + return "", err + } + + // add latest tag to image if no tag was provided + return reference.TagNameOnly(image).String(), nil +} diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 01df0891..02159011 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -14,7 +14,7 @@ import ( ) // CreateNetwork creates the pipeline network. -func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) (string, error) { +func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { logrus.Tracef("Creating network for pipeline %s", b.ID) // create options for creating network @@ -23,12 +23,12 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) (string, } // send API call to create the network - n, err := c.Runtime.NetworkCreate(ctx, b.ID, opts) + _, err := c.Runtime.NetworkCreate(ctx, b.ID, opts) if err != nil { - return "", err + return err } - return n.ID, nil + return nil } // InspectNetwork inspects the pipeline network. diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index b268d3f7..9d9c2b0c 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -17,7 +17,7 @@ func TestDocker_CreateNetwork_Success(t *testing.T) { c, _ := NewMock() // run test - _, got := c.CreateNetwork(context.Background(), &pipeline.Build{ + got := c.CreateNetwork(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) @@ -38,7 +38,7 @@ func TestDocker_CreateNetwork_Failure(t *testing.T) { c, _ := NewMock() // run test - _, got := c.CreateNetwork(context.Background(), &pipeline.Build{ + got := c.CreateNetwork(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 8a10e1f7..f77e025c 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -13,7 +13,7 @@ import ( ) // CreateVolume creates the pipeline volume. -func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) (string, error) { +func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { logrus.Tracef("Creating volume for pipeline %s", b.ID) // create options for creating volume @@ -23,12 +23,12 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) (string, e } // send API call to create the volume - v, err := c.Runtime.VolumeCreate(ctx, opts) + _, err := c.Runtime.VolumeCreate(ctx, opts) if err != nil { - return "", err + return err } - return v.Name, nil + return nil } // InspectVolume inspects the pipeline volume. diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 2b5df6d9..13cbf8b3 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -17,7 +17,7 @@ func TestDocker_CreateVolume_Success(t *testing.T) { c, _ := NewMock() // run test - _, got := c.CreateVolume(context.Background(), &pipeline.Build{ + got := c.CreateVolume(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) @@ -38,7 +38,7 @@ func TestDocker_CreateVolume_Failure(t *testing.T) { c, _ := NewMock() // run test - _, got := c.CreateVolume(context.Background(), &pipeline.Build{ + got := c.CreateVolume(context.Background(), &pipeline.Build{ Version: "1", ID: "__0"}) diff --git a/runtime/runtime.go b/runtime/runtime.go index 7d74addf..c89be062 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -15,11 +15,11 @@ import ( // with the different supported Runtime environments. type Engine interface { - // Container Engine interface functions + // Container Engine Interface Functions // InspectContainer defines a function that inspects // the pipeline container. - InspectContainer(context.Context, *pipeline.Container) ([]byte, error) + InspectContainer(context.Context, *pipeline.Container) error // RemoveContainer defines a function that deletes // (kill, remove) the pipeline container. RemoveContainer(context.Context, *pipeline.Container) error @@ -36,11 +36,17 @@ type Engine interface { // until the pipeline container completes. WaitContainer(context.Context, *pipeline.Container) error - // Network Engine interface functions + // Image Engine Interface Functions + + // InspectImage defines a function that + // inspects the pipeline container image. + InspectImage(context.Context, *pipeline.Container) ([]byte, error) + + // Network Engine Interface Functions // CreateNetwork defines a function that // creates the pipeline network. - CreateNetwork(context.Context, *pipeline.Build) (string, error) + CreateNetwork(context.Context, *pipeline.Build) error // InspectNetwork defines a function that // inspects the pipeline network. InspectNetwork(context.Context, *pipeline.Build) ([]byte, error) @@ -48,11 +54,11 @@ type Engine interface { // deletes the pipeline network. RemoveNetwork(context.Context, *pipeline.Build) error - // Volume Engine interface functions + // Volume Engine Interface Functions // CreateVolume defines a function that // creates the pipeline volume. - CreateVolume(context.Context, *pipeline.Build) (string, error) + CreateVolume(context.Context, *pipeline.Build) error // InspectVolume defines a function that // inspects the pipeline volume. InspectVolume(context.Context, *pipeline.Build) ([]byte, error) From 90c71e368c1f4fd26112303ba98682787a4e4786 Mon Sep 17 00:00:00 2001 From: Neal Date: Wed, 4 Dec 2019 14:40:00 -0600 Subject: [PATCH 044/430] fix(queue): use routes env for cluster (#34) --- cmd/server/queue.go | 2 +- queue/redis/redis.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/server/queue.go b/cmd/server/queue.go index 25462ed0..aee88b20 100644 --- a/cmd/server/queue.go +++ b/cmd/server/queue.go @@ -44,7 +44,7 @@ func setupRedis(c *cli.Context) (queue.Service, error) { if c.Bool("queue-cluster") { logrus.Tracef("Creating %s queue cluster client from CLI configuration", constants.DriverRedis) - return redis.NewCluster(c.String("queue-config"), "vela") + return redis.NewCluster(c.String("queue-config"), routes...) } logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverRedis) diff --git a/queue/redis/redis.go b/queue/redis/redis.go index 7577f98b..59ddaac8 100644 --- a/queue/redis/redis.go +++ b/queue/redis/redis.go @@ -67,8 +67,9 @@ func NewCluster(config string, channels ...string) (*client, error) { // create the client object client := &client{ - Queue: queue, - Options: options, + Queue: queue, + Options: options, + Channels: channels, } return client, nil From e294603f544a6f6b471d2d1745920f7d01706400 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 5 Dec 2019 09:34:38 -0600 Subject: [PATCH 045/430] test(docker): add tests for image inspect (#36) --- runtime/docker/image_test.go | 75 +++++++++++++++++++++++ runtime/docker/testdata/mock/docker.go | 17 +----- runtime/docker/testdata/mock/images.go | 82 +++++++++++++++++++++++++- 3 files changed, 159 insertions(+), 15 deletions(-) create mode 100644 runtime/docker/image_test.go diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go new file mode 100644 index 00000000..3973d411 --- /dev/null +++ b/runtime/docker/image_test.go @@ -0,0 +1,75 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_InspectImage(t *testing.T) { + // setup types + p := &pipeline.Container{ + ID: "container_id", + Image: "alpine:latest", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectImage(context.Background(), p) + + if err != nil { + t.Errorf("InspectImage returned err: %v", err) + } + + if got == nil { + t.Errorf("InspectImage is nil, want %v", got) + } +} + +func TestDocker_InspectImage_BadImage(t *testing.T) { + // setup types + p := &pipeline.Container{ + ID: "container_id", + Image: "alpine:notfound", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectImage(context.Background(), p) + + if err == nil { + t.Errorf("InspectImage should have returned err") + } + + if got != nil { + t.Errorf("InspectImage is %v, want nil", got) + } +} + +func TestDocker_InspectImage_NoImage(t *testing.T) { + // setup types + p := new(pipeline.Container) + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectImage(context.Background(), p) + + if err == nil { + t.Errorf("InspectImage should have returned err") + } + + if got != nil { + t.Errorf("InspectImage is %v, want nil", got) + } +} diff --git a/runtime/docker/testdata/mock/docker.go b/runtime/docker/testdata/mock/docker.go index aaacd08c..f147f5b1 100644 --- a/runtime/docker/testdata/mock/docker.go +++ b/runtime/docker/testdata/mock/docker.go @@ -48,22 +48,11 @@ func Router(r *http.Request) (*http.Response, error) { } } - // get image id - image := "" - if strings.HasPrefix(path, "/images/") && r.Method == http.MethodDelete { - id := strings.TrimPrefix(path, "/images/") - image = strings.Split(id, "/")[0] - } - switch { - // Container endpoints - case path == "/images/create": - return createImage(r) - case path == "/images/json": - return listImages(r) - case path == fmt.Sprintf("/images/%s", image): - return deleteImage(r, image) + // Image endpoints + case strings.HasPrefix(path, "/images/"): + return imageRoutes(r, path) // Container endpoints case path == "/containers/create": diff --git a/runtime/docker/testdata/mock/images.go b/runtime/docker/testdata/mock/images.go index 7caafd4a..18c7f397 100644 --- a/runtime/docker/testdata/mock/images.go +++ b/runtime/docker/testdata/mock/images.go @@ -3,13 +3,40 @@ package mock import ( "bytes" "encoding/json" + "fmt" "io/ioutil" "net/http" + "strings" + "time" "github.com/docker/docker/api/types" "github.com/sirupsen/logrus" ) +// helper function to specify the routes for the Docker Image APIs +func imageRoutes(r *http.Request, path string) (*http.Response, error) { + + // get image id + image := "" + if strings.HasPrefix(path, "/images/") { + image = strings.TrimPrefix(path, "/images/") + } + + switch { + case path == "/images/create": + return createImage(r) + case path == "/images/json": + return listImages(r) + case path == fmt.Sprintf("/images/%s", image): + if r.Method == http.MethodDelete { + return deleteImage(r, image) + } + return inspectImage(r, image) + } + + return nil, nil +} + // helper function to return the mock results from an image create func createImage(r *http.Request) (*http.Response, error) { @@ -26,6 +53,59 @@ func createImage(r *http.Request) (*http.Response, error) { }, nil } +// helper function to return the mock results from an image inspect +func inspectImage(r *http.Request, image string) (*http.Response, error) { + logrus.Infof("Docker mock inspecting image %s", image) + + if strings.Contains(image, "notfound") { + return &http.Response{ + StatusCode: http.StatusNotFound, + Body: ioutil.NopCloser(bytes.NewReader([]byte("image not found"))), + }, nil + } + + // $ docker pull alpine:latest + // + // $ docker image inspect alpine:latest + resp := types.ImageInspect{ + ID: "sha256:965ea09ff2ebd2b9eeec88cd822ce156f6674c7e99be082c7efac3c62f3ff652", + RepoTags: []string{"alpine:latest"}, + RepoDigests: []string{"alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a"}, + Parent: "", + Comment: "", + Created: "2019-10-21T17:21:42.387111039Z", + Container: "baae288169b1ae2f6bd82e7b605d8eb35a79e846385800e305eccc55b9bd5986", + ContainerConfig: nil, + DockerVersion: "18.06.1-ce", + Author: "", + Config: nil, + Architecture: "amd64", + Os: "linux", + Size: 5552690, + VirtualSize: 5552690, + GraphDriver: types.GraphDriverData{ + Data: map[string]string{ + "MergedDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/merged", + "UpperDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/diff", + "WorkDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/work", + }, + Name: "overlay2", + }, + RootFS: types.RootFS{ + Type: "layers", + Layers: []string{"sha256:77cae8ab23bf486355d1b3191259705374f4a11d483b24964d2f729dd8c076a0"}, + }, + Metadata: types.ImageMetadata{LastTagTime: time.Now()}, + } + + b, _ := json.Marshal(resp) + + return &http.Response{ + StatusCode: http.StatusOK, + Body: ioutil.NopCloser(bytes.NewReader(b)), + }, nil +} + // helper function to return the mock results from an image list func listImages(r *http.Request) (*http.Response, error) { @@ -43,7 +123,7 @@ func listImages(r *http.Request) (*http.Response, error) { // helper function to return the mock results from an image delete func deleteImage(r *http.Request, image string) (*http.Response, error) { - logrus.Infof("Deleting a image %s", image) + logrus.Infof("Deleting image %s", image) b, _ := json.Marshal([]types.ImageDeleteResponseItem{ {Untagged: image}, {Deleted: image}, From 7e0aa9f4cd9aea563be2b6e45c2dce78190a9ad0 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 5 Dec 2019 15:09:17 -0600 Subject: [PATCH 046/430] test(docker): add tests for network/volume inspect (#37) --- runtime/docker/network_test.go | 42 ++++++++++++++++ runtime/docker/testdata/mock/network.go | 67 ++++++++++++++++++++++--- runtime/docker/testdata/mock/volume.go | 50 +++++++++++++++--- runtime/docker/volume_test.go | 42 ++++++++++++++++ 4 files changed, 187 insertions(+), 14 deletions(-) diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 9d9c2b0c..395c429f 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -48,6 +48,48 @@ func TestDocker_CreateNetwork_Failure(t *testing.T) { } } +func TestDocker_InspectNetwork_Success(t *testing.T) { + // setup types + p := &pipeline.Build{ + Version: "1", + ID: "__0", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectNetwork(context.Background(), p) + if err != nil { + t.Errorf("InspectNetwork returned err: %v", err) + } + + if got == nil { + t.Errorf("InspectNetwork is nil, want %v", got) + } +} + +func TestDocker_InspectNetwork_Failure(t *testing.T) { + // setup types + p := &pipeline.Build{ + Version: "1", + ID: "notfound", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectNetwork(context.Background(), p) + if err == nil { + t.Errorf("InspectNetwork should have returned err") + } + + if got != nil { + t.Errorf("InspectNetwork is %v, want nil", got) + } +} + func TestDocker_RemoveNetwork_Success(t *testing.T) { // setup Docker diff --git a/runtime/docker/testdata/mock/network.go b/runtime/docker/testdata/mock/network.go index 9ed08929..b9752b7b 100644 --- a/runtime/docker/testdata/mock/network.go +++ b/runtime/docker/testdata/mock/network.go @@ -6,26 +6,36 @@ import ( "io/ioutil" "net/http" "strings" + "time" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/network" "github.com/sirupsen/logrus" ) // helper function to specify the routes for the Docker Network APIs -func networkRoutes(r *http.Request, p string) (*http.Response, error) { +func networkRoutes(r *http.Request, path string) (*http.Response, error) { + + // get network id + net := "" + if strings.HasPrefix(path, "/networks/") { + net = strings.TrimPrefix(path, "/networks/") + } switch { case strings.EqualFold(r.Method, http.MethodPost): // Path: /networks/create return createNetwork(r) + case strings.EqualFold(r.Method, http.MethodGet): // Path: /networks/:network_id + return inspectNetwork(r, net) case strings.EqualFold(r.Method, http.MethodDelete): // Path: /networks/:network_id - id := strings.Split(p, "/")[1] - return removeNetwork(r, id) + // id := strings.Split(p, "/")[1] + return removeNetwork(r, net) } return nil, nil } -// helper function to return the mock results from an network creates +// helper function to return the mock results from a network creates func createNetwork(r *http.Request) (*http.Response, error) { logrus.Infof("Creating a new network") @@ -40,10 +50,53 @@ func createNetwork(r *http.Request) (*http.Response, error) { }, nil } -// helper function to return the mock results from an network remove -func removeNetwork(r *http.Request, id string) (*http.Response, error) { +// helper function to return the mock results from a network inspect +func inspectNetwork(r *http.Request, net string) (*http.Response, error) { + logrus.Infof("Inspecting network %s", net) + + if strings.Contains(net, "notfound") { + return &http.Response{ + StatusCode: http.StatusNotFound, + Body: ioutil.NopCloser(bytes.NewReader([]byte("network not found"))), + }, nil + } + + resp := types.NetworkResource{ + Name: "host", + ID: "d0097728e3575854f5d7e5704304aa0c3afefcdfbf0f037d19d48afa2f1cabeb", + Created: time.Now(), + Scope: "local", + Driver: "host", + EnableIPv6: false, + IPAM: network.IPAM{ + Driver: "default", + Options: map[string]string{}, + Config: []network.IPAMConfig{}, + }, + Internal: false, + Attachable: false, + Ingress: false, + ConfigFrom: network.ConfigReference{ + Network: "", + }, + ConfigOnly: false, + Containers: map[string]types.EndpointResource{}, + Options: map[string]string{}, + Labels: map[string]string{}, + } + + b, _ := json.Marshal(resp) + + return &http.Response{ + StatusCode: http.StatusOK, + Body: ioutil.NopCloser(bytes.NewReader(b)), + }, nil +} + +// helper function to return the mock results from a network remove +func removeNetwork(r *http.Request, net string) (*http.Response, error) { - logrus.Infof("Deleting a network %s", id) + logrus.Infof("Deleting network %s", net) var b []byte return &http.Response{ diff --git a/runtime/docker/testdata/mock/volume.go b/runtime/docker/testdata/mock/volume.go index bfa65a09..307c4453 100644 --- a/runtime/docker/testdata/mock/volume.go +++ b/runtime/docker/testdata/mock/volume.go @@ -12,14 +12,21 @@ import ( ) // helper function to specify the routes for the Docker Volume APIs -func volumeRoutes(r *http.Request, p string) (*http.Response, error) { +func volumeRoutes(r *http.Request, path string) (*http.Response, error) { + + // get volume id + vol := "" + if strings.HasPrefix(path, "/volumes/") { + vol = strings.TrimPrefix(path, "/volumes/") + } switch { - case strings.EqualFold(r.Method, http.MethodPost): // Path: /Volumes/create + case strings.EqualFold(r.Method, http.MethodPost): // Path: /volumes/create return createVolume(r) - case strings.EqualFold(r.Method, http.MethodDelete): // Path: /Volumes/:Volume_id - id := strings.Split(p, "/")[1] - return removeVolume(r, id) + case strings.EqualFold(r.Method, http.MethodGet): // Path: /volumes/:volume_id + return inspectVolume(r, vol) + case strings.EqualFold(r.Method, http.MethodDelete): // Path: /volumes/:volume_id + return removeVolume(r, vol) } return nil, nil @@ -41,10 +48,39 @@ func createVolume(r *http.Request) (*http.Response, error) { }, nil } +// helper function to return the mock results from a network inspect +func inspectVolume(r *http.Request, vol string) (*http.Response, error) { + logrus.Infof("Inspecting volume %s", vol) + + if strings.Contains(vol, "notfound") { + return &http.Response{ + StatusCode: http.StatusNotFound, + Body: ioutil.NopCloser(bytes.NewReader([]byte("volume not found"))), + }, nil + } + + resp := types.Volume{ + CreatedAt: "2019-12-05T12:00:00Z", + Driver: "local", + Labels: map[string]string{}, + Mountpoint: "/var/lib/docker/volumes/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/_data", + Name: "9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2", + Options: map[string]string{}, + Scope: "local", + } + + b, _ := json.Marshal(resp) + + return &http.Response{ + StatusCode: http.StatusOK, + Body: ioutil.NopCloser(bytes.NewReader(b)), + }, nil +} + // helper function to return the mock results from an volume remove -func removeVolume(r *http.Request, id string) (*http.Response, error) { +func removeVolume(r *http.Request, vol string) (*http.Response, error) { - logrus.Infof("Deleting a volume %s", id) + logrus.Infof("Deleting a volume %s", vol) var b []byte return &http.Response{ diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 13cbf8b3..e61ba927 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -48,6 +48,48 @@ func TestDocker_CreateVolume_Failure(t *testing.T) { } } +func TestDocker_InspectVolume_Success(t *testing.T) { + // setup types + p := &pipeline.Build{ + Version: "1", + ID: "__0", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectVolume(context.Background(), p) + if err != nil { + t.Errorf("InspectVolume returned err: %v", got) + } + + if got == nil { + t.Errorf("InspectVolume is nil, want %v", got) + } +} + +func TestDocker_InspectVolume_Failure(t *testing.T) { + // setup types + p := &pipeline.Build{ + Version: "1", + ID: "notfound", + } + + // setup Docker + c, _ := NewMock() + + // run test + got, err := c.InspectVolume(context.Background(), p) + if err == nil { + t.Errorf("InspectVolume should have returned err") + } + + if got != nil { + t.Errorf("InspectVolume is %v, want nil", got) + } +} + func TestDocker_RemoveVolume_Success(t *testing.T) { // setup Docker From 26251a8ec7330e5157d26a78e42c0bd6ee5cb0b4 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 6 Dec 2019 09:35:28 -0600 Subject: [PATCH 047/430] Add logic to handle init stage/step (#35) * docs: fix typos in executor interface * feature: add logic to handle init stage/step * test: fix create stage tests --- executor/executor.go | 4 +- executor/linux/build.go | 181 ++++++++++++++++++++++++++++++++++- executor/linux/stage.go | 36 +++++++ executor/linux/stage_test.go | 25 ++++- executor/linux/step.go | 31 ++++-- 5 files changed, 260 insertions(+), 17 deletions(-) diff --git a/executor/executor.go b/executor/executor.go index eb275d82..e42390e1 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -21,7 +21,7 @@ type Engine interface { // the secrets for a given pipeline. PullSecret(context.Context) error - // Step Engine interface functions + // Service Engine interface functions // CreateService defines a function that // configures the service for execution. @@ -81,7 +81,7 @@ type Engine interface { // With Engine interface functions // WithBuild defines a function that sets - // the library build type in the Engine. + // the library Build type in the Engine. WithBuild(*library.Build) Engine // WithPipeline defines a function that sets // the pipeline Build type in the Engine. diff --git a/executor/linux/build.go b/executor/linux/build.go index fcc74668..445ac448 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -14,6 +14,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" "github.com/sirupsen/logrus" ) @@ -65,6 +66,75 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to upload start state: %w", err) } + // TODO: make this better + init := new(pipeline.Container) + if len(p.Steps) > 0 { + init = p.Steps[0] + + c.logger.Infof("creating %s step", init.Name) + // create the step + err = c.CreateStep(ctx, init) + if err != nil { + return fmt.Errorf("unable to create %s step: %w", init.Name, err) + } + + c.logger.Infof("planning %s step", init.Name) + // plan the step + err = c.PlanStep(ctx, init) + if err != nil { + return fmt.Errorf("unable to plan %s step: %w", init.Name, err) + } + } + + // TODO: make this better + if len(p.Stages) > 0 { + init = p.Stages[0].Steps[0] + + c.logger.Infof("creating %s step", init.Name) + // create the step + err = c.CreateStep(ctx, init) + if err != nil { + return fmt.Errorf("unable to create %s step: %w", init.Name, err) + } + + c.logger.Infof("planning %s step", init.Name) + // plan the step + err = c.PlanStep(ctx, init) + if err != nil { + return fmt.Errorf("unable to plan %s step: %w", init.Name, err) + } + } + + // TODO: make this cleaner + result, ok := c.steps.Load(init.ID) + if !ok { + return fmt.Errorf("unable to get %s step from client", init.Name) + } + s := result.(*library.Step) + + result, ok = c.stepLogs.Load(init.ID) + if !ok { + return fmt.Errorf("unable to get %s step log from client", init.Name) + } + l := result.(*library.Log) + + defer func() { + s.SetFinished(time.Now().UTC().Unix()) + c.logger.Infof("uploading %s step state", init.Name) + // send API call to update the step + s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + c.logger.Errorf("unable to upload %s state: %w", init.Name, err) + } + + c.logger.Infof("uploading %s step logs", init.Name) + // send API call to update the logs for the step + l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), init.Number, l) + if err != nil { + c.logger.Errorf("unable to upload %s logs: %w", init.Name, err) + } + }() + c.logger.Info("creating network") // create the runtime network for the pipeline err = c.Runtime.CreateNetwork(ctx, p) @@ -72,6 +142,18 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to create network: %w", err) } + // update the init log with progress + l.SetData(append(l.GetData(), []byte("$ Inspecting runtime network...\n")...)) + + // inspect the runtime network for the pipeline + network, err := c.Runtime.InspectNetwork(ctx, p) + if err != nil { + return fmt.Errorf("unable to inspect network: %w", err) + } + + // update the init log with network info + l.SetData(append(l.GetData(), network...)) + c.logger.Info("creating volume") // create the runtime volume for the pipeline err = c.Runtime.CreateVolume(ctx, p) @@ -79,38 +161,111 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to create volume: %w", err) } + // update the init log with progress + l.SetData(append(l.GetData(), []byte("$ Inspecting runtime volume...\n")...)) + + // inspect the runtime volume for the pipeline + volume, err := c.Runtime.InspectVolume(ctx, p) + if err != nil { + return fmt.Errorf("unable to inspect volume: %w", err) + } + + // update the init log with volume info + l.SetData(append(l.GetData(), volume...)) + + // update the init log with progress + l.SetData(append(l.GetData(), []byte("$ Pulling service images...\n")...)) + // create the services for the pipeline for _, s := range p.Services { // TODO: remove this; but we need it for tests s.Detach = true s.Pull = true + // TODO: remove hardcoded reference + // update the init log with progress + l.SetData( + append( + l.GetData(), + []byte(fmt.Sprintf(" $ docker image inspect %s\n", s.Image))..., + ), + ) + c.logger.Infof("creating %s service", s.Name) // create the service err = c.CreateService(ctx, s) if err != nil { - return fmt.Errorf("unable to create service: %w", err) + return fmt.Errorf("unable to create %s service: %w", s.Name, err) + } + + c.logger.Infof("inspecting %s service", s.Name) + // inspect the service image + image, err := c.Runtime.InspectImage(ctx, s) + if err != nil { + return fmt.Errorf("unable to inspect %s service: %w", s.Name, err) } + + // update the init log with service image info + l.SetData(append(l.GetData(), image...)) } + // update the init log with progress + l.SetData( + append(l.GetData(), []byte("$ Pulling stage images...\n")...), + ) + // create the stages for the pipeline for _, s := range p.Stages { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + c.logger.Infof("creating %s stage", s.Name) // create the stage err = c.CreateStage(ctx, s) if err != nil { - return fmt.Errorf("unable to create stage: %w", err) + return fmt.Errorf("unable to create %s stage: %w", s.Name, err) } } + // update the init log with progress + l.SetData( + append(l.GetData(), []byte("$ Pulling step images...\n")...), + ) + // create the steps for the pipeline for _, s := range p.Steps { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + + // TODO: make this not hardcoded + // update the init log with progress + l.SetData( + append( + l.GetData(), + []byte(fmt.Sprintf(" $ docker image inspect %s\n", s.Image))..., + ), + ) + c.logger.Infof("creating %s step", s.Name) // create the step err = c.CreateStep(ctx, s) if err != nil { - return fmt.Errorf("unable to create step: %w", err) + return fmt.Errorf("unable to create %s step: %w", s.Name, err) } + + c.logger.Infof("inspecting %s step", s.Name) + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, s) + if err != nil { + return fmt.Errorf("unable to inspect %s step: %w", s.Name, err) + } + + // update the init log with step image info + l.SetData(append(l.GetData(), image...)) } b.SetStatus(constants.StatusSuccess) @@ -164,6 +319,11 @@ func (c *client) ExecBuild(ctx context.Context) error { // execute the steps for the pipeline for _, s := range p.Steps { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + // check if the build status is successful if !strings.EqualFold(b.GetStatus(), constants.StatusSuccess) { // break out of loop to stop running steps @@ -219,6 +379,11 @@ func (c *client) ExecBuild(ctx context.Context) error { // iterate through each stage in the pipeline for _, s := range p.Stages { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + // https://golang.org/doc/faq#closures_and_goroutines stage := s @@ -283,6 +448,11 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the steps for the pipeline for _, s := range p.Steps { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + c.logger.Infof("destroying %s step", s.Name) // destroy the step err = c.DestroyStep(ctx, s) @@ -293,6 +463,11 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the stages for the pipeline for _, s := range p.Stages { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + c.logger.Infof("destroying %s stage", s.Name) // destroy the stage err = c.DestroyStage(ctx, s) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 2f46f1d6..798f9c81 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -17,19 +17,55 @@ import ( // CreateStage prepares the stage for execution. func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { + init := c.pipeline.Stages[0].Steps[0] + // TODO: make this cleaner + result, ok := c.stepLogs.Load(init.ID) + if !ok { + return fmt.Errorf("unable to get init step log from client") + } + l := result.(*library.Log) + // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "stage": s.Name, }) + // update the init log with progress + l.SetData( + append( + l.GetData(), + []byte(fmt.Sprintf(" $ Pulling step images for stage %s...\n", s.Name))..., + ), + ) + // create the steps for the stage for _, step := range s.Steps { + + // TODO: make this not hardcoded + // update the init log with progress + l.SetData( + append( + l.GetData(), + []byte(fmt.Sprintf(" $ docker image inspect %s\n", step.Image))..., + ), + ) + logger.Debugf("creating %s step", step.Name) // create the step err := c.CreateStep(ctx, step) if err != nil { return err } + + c.logger.Infof("inspecting %s step", step.Name) + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, step) + if err != nil { + return err + } + + // update the init log with step image info + l.SetData(append(l.GetData(), image...)) } return nil diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 2bf3eec0..a75e557b 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -41,6 +41,18 @@ func TestExecutor_CreateStage_Success(t *testing.T) { }, }, Stages: pipeline.StageSlice{ + &pipeline.Stage{ + Name: "init", + Steps: pipeline.ContainerSlice{ + &pipeline.Container{ + ID: "__0_init_init", + Image: "#init", + Name: "init", + Number: 1, + Pull: true, + }, + }, + }, &pipeline.Stage{ Name: "clone", Steps: pipeline.ContainerSlice{ @@ -49,7 +61,7 @@ func TestExecutor_CreateStage_Success(t *testing.T) { Environment: map[string]string{}, Image: "target/vela-plugins/git:1", Name: "clone", - Number: 1, + Number: 2, Pull: true, }, }, @@ -63,7 +75,7 @@ func TestExecutor_CreateStage_Success(t *testing.T) { Environment: map[string]string{}, Image: "alpine:latest", Name: "exit", - Number: 2, + Number: 3, Pull: true, Ruleset: pipeline.Ruleset{ Continue: true, @@ -81,7 +93,7 @@ func TestExecutor_CreateStage_Success(t *testing.T) { Environment: map[string]string{}, Image: "alpine:latest", Name: "echo", - Number: 1, + Number: 4, Pull: true, Secrets: pipeline.StepSecretSlice{ &pipeline.StepSecret{ @@ -96,7 +108,12 @@ func TestExecutor_CreateStage_Success(t *testing.T) { }) // run test - got := e.CreateStage(context.Background(), e.pipeline.Stages[0]) + err := e.PlanStep(context.Background(), &pipeline.Container{ID: "__0_init_init"}) + if err != nil { + t.Errorf("Unable to plan init step: %v", err) + } + + got := e.CreateStage(context.Background(), e.pipeline.Stages[1]) if got != nil { t.Errorf("CreateStage is %v, want nil", got) diff --git a/executor/linux/step.go b/executor/linux/step.go index fc1c63cc..ddd76614 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -30,13 +30,6 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error "step": ctn.Name, }) - logger.Debug("setting up container") - // setup the runtime container - err := c.Runtime.SetupContainer(ctx, ctn) - if err != nil { - return err - } - // inject default workspace if len(ctn.Directory) == 0 { ctn.Directory = fmt.Sprintf("/home/%s", c.pipeline.ID) @@ -45,10 +38,22 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error ctn.Environment["BUILD_HOST"] = c.Hostname ctn.Environment["VELA_HOST"] = c.Hostname ctn.Environment["VELA_VERSION"] = version.Version.String() - // TODO: This should not be hardcoded + // TODO: remove hardcoded reference ctn.Environment["VELA_RUNTIME"] = "docker" ctn.Environment["VELA_DISTRIBUTION"] = "linux" + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + logger.Debug("setting up container") + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + logger.Debug("injecting secrets") // inject secrets for step err = injectSecrets(ctn, c.Secrets) @@ -137,6 +142,11 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // ExecStep runs a step. func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + b := c.build r := c.repo @@ -234,6 +244,11 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { // DestroyStep cleans up steps after execution. func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "step": ctn.Name, From d4a4b30be9e32d404a1d7bf70c89ec54b91931f7 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 6 Dec 2019 13:45:02 -0600 Subject: [PATCH 048/430] fix(version): uptick version for new release (#38) --- router/middleware/header_test.go | 8 ++++---- version/version.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 8c40dbac..c8aa2cbb 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -263,7 +263,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.1.5" + wantVersion := "0.2.0" // setup context resp := httptest.NewRecorder() @@ -293,7 +293,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.5" + wantVersion := "0.2.0" // setup context resp := httptest.NewRecorder() @@ -323,7 +323,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.1.5" + wantVersion := "0.2.0" // setup context resp := httptest.NewRecorder() @@ -353,7 +353,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.1.5" + wantVersion := "0.2.0" // setup context resp := httptest.NewRecorder() diff --git a/version/version.go b/version/version.go index 3ddb268d..c417f200 100644 --- a/version/version.go +++ b/version/version.go @@ -10,9 +10,9 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor int64 = 1 + VersionMinor int64 = 2 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 5 + VersionPatch int64 // VersionDev indicates drone build number. Releases will be empty string. VersionDev string ) From 587dcf3aa30befd966d3e7f0c1ecdb18960356db Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 6 Dec 2019 14:57:35 -0600 Subject: [PATCH 049/430] chore: update deps for v0.2.0-rc2 (#39) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 0932d151..ad58084b 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.2.0-rc1 - github.com/go-vela/sdk-go v0.2.0-rc1 - github.com/go-vela/types v0.2.0-rc1 + github.com/go-vela/mock v0.2.0-rc2 + github.com/go-vela/sdk-go v0.2.0-rc2 + github.com/go-vela/types v0.2.0-rc2 github.com/gogo/protobuf v1.2.0 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 470117f7..46943ddb 100644 --- a/go.sum +++ b/go.sum @@ -46,12 +46,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.2.0-rc1 h1:OTAyR376Z1YSBEnyEfvwWveOOOjAT+F7Wkw51aDvOoQ= -github.com/go-vela/mock v0.2.0-rc1/go.mod h1:igk2eLxOnsRHfZBnnHrpNrqmnUfRAd7d5Sf+QXLy834= -github.com/go-vela/sdk-go v0.2.0-rc1 h1:a+w/5m8B6HQlxcZYhkdzxg1JlwYEASer5T6KS1Q0VWU= -github.com/go-vela/sdk-go v0.2.0-rc1/go.mod h1:d5/rlzAEATosTJZG1VjyuCcH3XBFjYhrxpQd/c+RRkM= -github.com/go-vela/types v0.2.0-rc1 h1:UqDrFi/mBAEPy27TK2eyIzd2VQkn+JXkS8FKWr6lsnc= -github.com/go-vela/types v0.2.0-rc1/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.2.0-rc2 h1:/BJhYQlY8Y6HgCLS/mkA/atjR1AUOY5rAKPlB0oKoGo= +github.com/go-vela/mock v0.2.0-rc2/go.mod h1:J1nvvtmowjetnAoo+dJ8LvC2iwIBF+E3oko1KC5Fbvo= +github.com/go-vela/sdk-go v0.2.0-rc2 h1:Zc4G/y0RHf3m7bK2CXZRkX3qEZV55LWfzOakdxvXy1E= +github.com/go-vela/sdk-go v0.2.0-rc2/go.mod h1:ow3YFlsNj/I4kHlNE75tGDHBDh8k/qmameS5ADtLLpU= +github.com/go-vela/types v0.2.0-rc2 h1:oAMCz9iRFXAOtHNALed2zpTRzU5+N8bl+YhEJIedPzo= +github.com/go-vela/types v0.2.0-rc2/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= From c959fc15908e24868d96dfa032c011c9532c65af Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 12 Dec 2019 09:27:03 -0600 Subject: [PATCH 050/430] feat(api): Add executor endpoints (#40) * feat(api): Add executor endpoints * fix(deps): clean go mod * fix(messaging): update comments and error messages --- api/build.go | 15 +++- api/executor.go | 82 ++++++++++++++++++- api/pipeline.go | 30 +++++++ api/repo.go | 30 +++++++ cmd/server/operate.go | 32 ++++---- cmd/server/server.go | 3 +- executor/context.go | 6 +- executor/executor.go | 15 ++++ executor/linux/build.go | 6 ++ executor/linux/linux.go | 36 +++++++++ executor/linux/linux_test.go | 69 ++++++++++++++++ go.mod | 2 +- go.sum | 2 + router/build.go | 16 ++-- router/executor.go | 19 +++-- router/middleware/executor.go | 19 +++++ router/middleware/executor/context.go | 39 +++++++++ router/middleware/executor/context_test.go | 88 +++++++++++++++++++++ router/middleware/executor/executor.go | 54 +++++++++++++ router/middleware/executor/executor_test.go | 88 +++++++++++++++++++++ router/pipeline.go | 23 ++++++ router/repo.go | 23 ++++++ 22 files changed, 657 insertions(+), 40 deletions(-) create mode 100644 api/pipeline.go create mode 100644 api/repo.go create mode 100644 router/middleware/executor.go create mode 100644 router/middleware/executor/context.go create mode 100644 router/middleware/executor/context_test.go create mode 100644 router/middleware/executor/executor.go create mode 100644 router/middleware/executor/executor_test.go create mode 100644 router/pipeline.go create mode 100644 router/repo.go diff --git a/api/build.go b/api/build.go index c1e72f19..3da6df96 100644 --- a/api/build.go +++ b/api/build.go @@ -5,15 +5,28 @@ package api import ( + "fmt" "net/http" + "github.com/go-vela/types" + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/router/middleware/executor" ) // GetBuild represents the API handler to capture the // build currently running on an executor. func GetBuild(c *gin.Context) { - c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") + e := executor.Retrieve(c) + + build, err := e.GetBuild() + if err != nil { + msg := fmt.Errorf("unable to read build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + c.JSON(http.StatusOK, build) } // KillBuild represents the API handler to kill a diff --git a/api/executor.go b/api/executor.go index fa313239..68203bf7 100644 --- a/api/executor.go +++ b/api/executor.go @@ -5,19 +5,97 @@ package api import ( + "fmt" "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" + "github.com/go-vela/worker/executor" + exec "github.com/go-vela/worker/router/middleware/executor" ) // GetExecutor represents the API handler to capture the // executor currently running on a worker. func GetExecutor(c *gin.Context) { - c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") + e := exec.Retrieve(c) + executor := &library.Executor{} + var err error + + // TODO: Add this information from the context or helpers on executor + // tmp.SetHost(executor.GetHost()) + executor.SetRuntime("docker") + executor.SetDistribution("linux") + + // get build on executor + executor.Build, err = e.GetBuild() + if err != nil { + msg := fmt.Errorf("unable to retrieve build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + // get pipeline on executor + executor.Pipeline, err = e.GetPipeline() + if err != nil { + msg := fmt.Errorf("unable to retrieve pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + // get repo on executor + executor.Repo, err = e.GetRepo() + if err != nil { + msg := fmt.Errorf("unable to retrieve repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + c.JSON(http.StatusOK, executor) } // GetExecutors represents the API handler to capture the // executors currently running on a worker. func GetExecutors(c *gin.Context) { - c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") + e := executor.FromContext(c) + executors := []*library.Executor{} + var err error + + for _, executor := range e { + // create a temporary executor to append results to response + tmp := &library.Executor{} + + // TODO: Add this information from the context or helpers on executor + // tmp.SetHost(executor.GetHost()) + tmp.SetRuntime("docker") + tmp.SetDistribution("linux") + + // get build on executor + tmp.Build, err = executor.GetBuild() + if err != nil { + msg := fmt.Errorf("unable to retrieve build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + // get pipeline on executor + tmp.Pipeline, err = executor.GetPipeline() + if err != nil { + msg := fmt.Errorf("unable to retrieve pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + // get repo on executor + tmp.Repo, err = executor.GetRepo() + if err != nil { + msg := fmt.Errorf("unable to retrieve repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + executors = append(executors, tmp) + } + + c.JSON(http.StatusOK, executors) } diff --git a/api/pipeline.go b/api/pipeline.go new file mode 100644 index 00000000..357d8a51 --- /dev/null +++ b/api/pipeline.go @@ -0,0 +1,30 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "fmt" + "net/http" + + "github.com/go-vela/types" + + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/router/middleware/executor" +) + +// GetPipeline represents the API handler to capture the +// pipeline currently running on an executor. +func GetPipeline(c *gin.Context) { + e := executor.Retrieve(c) + + pipeline, err := e.GetPipeline() + if err != nil { + msg := fmt.Errorf("unable to read pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + c.JSON(http.StatusOK, pipeline) +} diff --git a/api/repo.go b/api/repo.go new file mode 100644 index 00000000..83977d93 --- /dev/null +++ b/api/repo.go @@ -0,0 +1,30 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "fmt" + "net/http" + + "github.com/go-vela/types" + + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/router/middleware/executor" +) + +// GetRepo represents the API handler to capture the +// repo currently running on an executor. +func GetRepo(c *gin.Context) { + e := executor.Retrieve(c) + + repo, err := e.GetRepo() + if err != nil { + msg := fmt.Errorf("unable to read repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + c.JSON(http.StatusOK, repo) +} diff --git a/cmd/server/operate.go b/cmd/server/operate.go index 23e54fd1..db95f0fa 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -16,15 +16,15 @@ import ( "golang.org/x/sync/errgroup" ) -func operate(queue queue.Service, executors map[int]executor.Engine, timeout time.Duration) (err error) { +func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err error) { threads := new(errgroup.Group) - for id, e := range executors { + for id, executor := range e { logrus.Infof("Thread ID %d listening to queue...", id) threads.Go(func() error { for { // pop an item from the queue - item, err := queue.Pop() + item, err := q.Pop() if err != nil { return err } @@ -36,25 +36,27 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim }) // add build metadata to the executor - e.WithBuild(item.Build) - e.WithPipeline(item.Pipeline) - e.WithRepo(item.Repo) - e.WithUser(item.User) + executor.WithBuild(item.Build) + executor.WithPipeline(item.Pipeline) + executor.WithRepo(item.Repo) + executor.WithUser(item.User) // check if the repository has a custom timeout if item.Repo.GetTimeout() > 0 { // update timeout variable to repository custom timeout - timeout = time.Duration(item.Repo.GetTimeout()) * time.Minute + t = time.Duration(item.Repo.GetTimeout()) * time.Minute } - // create a copy of the background context with a timeout + ctx := context.Background() + + // add to the background context with a timeout // built in for ensuring a build doesn't run forever - ctx, cancel := context.WithTimeout(context.Background(), timeout) - defer cancel() + ctx, timeout := context.WithTimeout(ctx, t) + defer timeout() logger.Info("pulling secrets") // pull secrets for the build on the executor - err = e.PullSecret(ctx) + err = executor.PullSecret(ctx) if err != nil { logger.Errorf("unable to pull secrets: %v", err) return err @@ -62,7 +64,7 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim // create the build on the executor logger.Info("creating build") - err = e.CreateBuild(ctx) + err = executor.CreateBuild(ctx) if err != nil { logger.Errorf("unable to create build: %v", err) return err @@ -70,7 +72,7 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim // execute the build on the executor logger.Info("executing build") - err = e.ExecBuild(ctx) + err = executor.ExecBuild(ctx) if err != nil { logger.Errorf("unable to execute build: %v", err) return err @@ -78,7 +80,7 @@ func operate(queue queue.Service, executors map[int]executor.Engine, timeout tim // destroy the build on the executor logger.Info("destroying build") - err = e.DestroyBuild(ctx) + err = executor.DestroyBuild(ctx) if err != nil { logger.Errorf("unable to destroy build: %v", err) return err diff --git a/cmd/server/server.go b/cmd/server/server.go index 1df5cf09..aaecd9b0 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -76,13 +76,12 @@ func server(c *cli.Context) error { if err != nil { return err } - executors[i] = executor } router := router.Load( middleware.RequestVersion, - // TODO: middleware.Executor(executors), + middleware.Executor(executors), middleware.Secret(c.String("vela-secret")), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) diff --git a/executor/context.go b/executor/context.go index 81bd23cb..47952533 100644 --- a/executor/context.go +++ b/executor/context.go @@ -19,7 +19,7 @@ type Setter interface { // FromContext returns the executor Engine // associated with this context. -func FromContext(c context.Context) Engine { +func FromContext(c context.Context) map[int]Engine { // get executor value from context v := c.Value(key) if v == nil { @@ -27,7 +27,7 @@ func FromContext(c context.Context) Engine { } // cast executor value to expected Engine type - e, ok := v.(Engine) + e, ok := v.(map[int]Engine) if !ok { return nil } @@ -37,6 +37,6 @@ func FromContext(c context.Context) Engine { // ToContext adds the executor Engine to this // context if it supports the Setter interface. -func ToContext(c Setter, e Engine) { +func ToContext(c Setter, e map[int]Engine) { c.Set(key, e) } diff --git a/executor/executor.go b/executor/executor.go index e42390e1..addc61f9 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -15,6 +15,21 @@ import ( // with the different supported operating systems. type Engine interface { + // API interface functions + + // GetBuild defines a function for the API + // that gets the current build in execution. + GetBuild() (*library.Build, error) + // GetRepo defines a function for the API + // that gets the current repo in execution. + GetRepo() (*library.Repo, error) + // GetPipeline defines a function for the API + // that gets the current pipeline in execution. + GetPipeline() (*pipeline.Build, error) + // KillBuild defines a function for the API + // that kills the current build in execution. + KillBuild() (*library.Build, error) + // Secrets Engine interface functions // PullSecret defines a function that pulls diff --git a/executor/linux/build.go b/executor/linux/build.go index 445ac448..e3564737 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -517,3 +517,9 @@ func (c *client) DestroyBuild(ctx context.Context) error { return err } + +// KillBuild kills the current build in execution. +// TODO: implement function with sending sigcalls to Docker +func (c *client) KillBuild() (*library.Build, error) { + return nil, nil +} diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 075c9244..7237dcbe 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -107,3 +107,39 @@ func (c *client) WithUser(u *library.User) executor.Engine { return c } + +// GetBuild gets the current build in execution. +func (c *client) GetBuild() (*library.Build, error) { + b := c.build + + // check if the build resource is available + if b == nil { + return nil, fmt.Errorf("build resource not found") + } + + return b, nil +} + +// GetPipeline gets the current pipeline in execution. +func (c *client) GetPipeline() (*pipeline.Build, error) { + p := c.pipeline + + // check if the pipeline resource is available + if p == nil { + return nil, fmt.Errorf("pipeline resource not found") + } + + return p, nil +} + +// GetRepo gets the current repo in execution. +func (c *client) GetRepo() (*library.Repo, error) { + r := c.repo + + // check if the repo resource is available + if r == nil { + return nil, fmt.Errorf("repo resource not found") + } + + return r, nil +} diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 4ba442d4..5b9379d6 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -101,3 +101,72 @@ func TestLinux_WithUser(t *testing.T) { t.Errorf("WithBuild is %v, want %v", got, want) } } + +func TestLinux_GetBuild(t *testing.T) { + // setup types + vela, _ := vela.NewClient("http://localhost:8080", nil) + r, _ := docker.NewMock() + + id := int64(1) + b := &library.Build{ID: &id} + want := b + + executor, _ := New(vela, r) + executor.WithBuild(b) + + // run test + got, err := executor.GetBuild() + if err != nil { + t.Errorf("Unable to get build from compiler: %v", err) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("GetBuild is %v, want %v", got, want) + } +} + +func TestLinux_GetPipeline(t *testing.T) { + // setup types + vela, _ := vela.NewClient("http://localhost:8080", nil) + r, _ := docker.NewMock() + + id := "1" + p := &pipeline.Build{ID: id} + want := p + + executor, _ := New(vela, r) + executor.WithPipeline(p) + + // run test + got, err := executor.GetPipeline() + if err != nil { + t.Errorf("Unable to get pipeline from compiler: %v", err) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("GetPipeline is %v, want %v", got, want) + } +} + +func TestLinux_GetRepo(t *testing.T) { + // setup types + vela, _ := vela.NewClient("http://localhost:8080", nil) + r, _ := docker.NewMock() + + id := int64(1) + repo := &library.Repo{ID: &id} + want := repo + + executor, _ := New(vela, r) + executor.WithRepo(repo) + + // run test + got, err := executor.GetRepo() + if err != nil { + t.Errorf("Unable to get repo from compiler: %v", err) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("GetPipeline is %v, want %v", got, want) + } +} diff --git a/go.mod b/go.mod index ad58084b..21d5e38c 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.2.0-rc2 github.com/go-vela/sdk-go v0.2.0-rc2 - github.com/go-vela/types v0.2.0-rc2 + github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 github.com/gogo/protobuf v1.2.0 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 46943ddb..cc049a4d 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ github.com/go-vela/sdk-go v0.2.0-rc2 h1:Zc4G/y0RHf3m7bK2CXZRkX3qEZV55LWfzOakdxvX github.com/go-vela/sdk-go v0.2.0-rc2/go.mod h1:ow3YFlsNj/I4kHlNE75tGDHBDh8k/qmameS5ADtLLpU= github.com/go-vela/types v0.2.0-rc2 h1:oAMCz9iRFXAOtHNALed2zpTRzU5+N8bl+YhEJIedPzo= github.com/go-vela/types v0.2.0-rc2/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 h1:5rma5aIapqg9hVN+ZUwjK1+OuigozsX1uL6zUnZgL+8= +github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= diff --git a/router/build.go b/router/build.go index 1c5fa65c..253448dc 100644 --- a/router/build.go +++ b/router/build.go @@ -12,20 +12,14 @@ import ( // buildHandlers is a function that extends the provided base router group // with the API handlers for build functionality. // -// GET /api/v1/executors/:executor/builds/:build -// PATCH /api/v1/executors/:executor/builds/:build/kill +// GET /api/v1/executors/:executor/build +// DELETE /api/v1/executors/:executor/build/kill func buildHandlers(base *gin.RouterGroup) { // builds endpoints - builds := base.Group("/builds") + build := base.Group("/build") { - - // build endpoints - build := builds.Group("/:build") - { - build.GET("", api.GetBuild) - build.PATCH("/kill", api.KillBuild) - } // end of build endpoints - + build.GET("", api.GetBuild) + build.DELETE("/kill", api.KillBuild) } // end of builds endpoints } diff --git a/router/executor.go b/router/executor.go index 07c2e335..166c5611 100644 --- a/router/executor.go +++ b/router/executor.go @@ -7,15 +7,18 @@ package router import ( "github.com/gin-gonic/gin" "github.com/go-vela/worker/api" + "github.com/go-vela/worker/router/middleware/executor" ) // executorHandlers is a function that extends the provided base router group // with the API handlers for build functionality. // -// GET /api/v1/executors -// GET /api/v1/executors/:executor -// GET /api/v1/executors/:executor/builds/:build -// PATCH /api/v1/executors/:executor/builds/:build/kill +// GET /api/v1/executors +// GET /api/v1/executors/:executor +// GET /api/v1/executors/:executor/build +// DELETE /api/v1/executors/:executor/build/kill +// GET /api/v1/executors/:executor/pipeline +// GET /api/v1/executors/:executor/repo func executorHandlers(base *gin.RouterGroup) { // executors endpoints @@ -25,13 +28,19 @@ func executorHandlers(base *gin.RouterGroup) { executors.GET("", api.GetExecutors) // exector endpoints - executor := executors.Group("/:executor") + executor := executors.Group("/:executor", executor.Establish()) { executor.GET("", api.GetExecutor) // build endpoints buildHandlers(executor) + // pipeline endpoints + pipelineHandlers(executor) + + // build endpoints + repoHandlers(executor) + } // end of executor endpoints } // end of executors endpoints diff --git a/router/middleware/executor.go b/router/middleware/executor.go new file mode 100644 index 00000000..8d5c6e68 --- /dev/null +++ b/router/middleware/executor.go @@ -0,0 +1,19 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/executor" +) + +// Executor is a middleware function that initializes the executor and +// attaches to the context of every http.Request. +func Executor(e map[int]executor.Engine) gin.HandlerFunc { + return func(c *gin.Context) { + executor.ToContext(c, e) + c.Next() + } +} diff --git a/router/middleware/executor/context.go b/router/middleware/executor/context.go new file mode 100644 index 00000000..3fc62ec5 --- /dev/null +++ b/router/middleware/executor/context.go @@ -0,0 +1,39 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "context" + + "github.com/go-vela/worker/executor" +) + +const key = "executor" + +// Setter defines a context that enables setting values. +type Setter interface { + Set(string, interface{}) +} + +// FromContext returns the Executor associated with this context. +func FromContext(c context.Context) executor.Engine { + value := c.Value(key) + if value == nil { + return nil + } + + r, ok := value.(executor.Engine) + if !ok { + return nil + } + + return r +} + +// ToContext adds the Executor to this context if it supports +// the Setter interface. +func ToContext(c Setter, e executor.Engine) { + c.Set(key, e) +} diff --git a/router/middleware/executor/context_test.go b/router/middleware/executor/context_test.go new file mode 100644 index 00000000..8f566a17 --- /dev/null +++ b/router/middleware/executor/context_test.go @@ -0,0 +1,88 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this executorsitory. + +package executor + +import ( + "testing" + + "github.com/go-vela/worker/executor/linux" + + "github.com/gin-gonic/gin" +) + +func TestRepo_FromContext(t *testing.T) { + // setup types + want, _ := linux.New(nil, nil) + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, want) + + // run test + got := FromContext(context) + + if got != want { + t.Errorf("FromContext is %v, want %v", got, want) + } +} + +func TestRepo_FromContext_Bad(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, nil) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestRepo_FromContext_WrongType(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + context.Set(key, 1) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestRepo_FromContext_Empty(t *testing.T) { + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + + // run test + got := FromContext(context) + + if got != nil { + t.Errorf("FromContext is %v, want nil", got) + } +} + +func TestRepo_ToContext(t *testing.T) { + // setup types + want, _ := linux.New(nil, nil) + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + ToContext(context, want) + + // run test + got := context.Value(key) + + if got != want { + t.Errorf("ToContext is %v, want %v", got, want) + } +} diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go new file mode 100644 index 00000000..5ad1feb8 --- /dev/null +++ b/router/middleware/executor/executor.go @@ -0,0 +1,54 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "strconv" + + "github.com/go-vela/types" + exec "github.com/go-vela/worker/executor" + + "fmt" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" +) + +// Retrieve gets the repo in the given context +func Retrieve(c *gin.Context) exec.Engine { + return FromContext(c) +} + +// Establish sets the executor in the given context +func Establish() gin.HandlerFunc { + return func(c *gin.Context) { + param := c.Param("executor") + if len(param) == 0 { + msg := "No executor parameter provided" + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + return + } + + number, err := strconv.Atoi(param) + if err != nil { + msg := fmt.Sprintf("invalid executor parameter provided: %s", param) + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + return + } + + executors := exec.FromContext(c) + logrus.Debugf("Reading executor %s", param) + e, ok := executors[number] + if !ok { + msg := fmt.Sprintf("unable to get executor %s", param) + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + ToContext(c, e) + c.Next() + } +} diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go new file mode 100644 index 00000000..4ef890df --- /dev/null +++ b/router/middleware/executor/executor_test.go @@ -0,0 +1,88 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/executor/linux" +) + +func TestExecutor_Retrieve(t *testing.T) { + // setup types + want, _ := linux.New(nil, nil) + + // setup context + gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) + ToContext(context, want) + + // run test + got := Retrieve(context) + + if got != want { + t.Errorf("Retrieve is %v, want %v", got, want) + } +} + +func TestExecutor_Establish(t *testing.T) { + // setup types + want := make(map[int]executor.Engine) + want[0], _ = linux.New(nil, nil) + got := want[0] + + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) + + // setup mock server + engine.Use(func(c *gin.Context) { executor.ToContext(c, want) }) + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + got = Retrieve(c) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want[0]) { + t.Errorf("Establish is %v, want %v", got, want) + } +} + +func TestExecutor_Establish_NoExecutor(t *testing.T) { + // setup context + resp := httptest.NewRecorder() + gin.SetMode(gin.TestMode) + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) + + // setup mock server + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusInternalServerError { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) + } +} diff --git a/router/pipeline.go b/router/pipeline.go new file mode 100644 index 00000000..a2438e0f --- /dev/null +++ b/router/pipeline.go @@ -0,0 +1,23 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this pipelinesitory. + +package router + +import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" +) + +// pipelineHandlers is a function that extends the provided base router group +// with the API handlers for pipeline functionality. +// +// GET /api/v1/executors/:executor/pipeline +func pipelineHandlers(base *gin.RouterGroup) { + + // pipelines endpoints + pipeline := base.Group("/pipeline") + { + pipeline.GET("", api.GetPipeline) + } // end of pipelines endpoints +} diff --git a/router/repo.go b/router/repo.go new file mode 100644 index 00000000..31760d42 --- /dev/null +++ b/router/repo.go @@ -0,0 +1,23 @@ +// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" +) + +// repoHandlers is a function that extends the provided base router group +// with the API handlers for repo functionality. +// +// GET /api/v1/executors/:executor/repo +func repoHandlers(base *gin.RouterGroup) { + + // repos endpoints + repo := base.Group("/repo") + { + repo.GET("", api.GetRepo) + } // end of repos endpoints +} From 9f623bf2fd125483f3b8aeeb466266eaa300c5c7 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 13 Dec 2019 11:36:41 -0600 Subject: [PATCH 051/430] Implement kill build endpoint (#41) * feat(kill): implemenet kill endpoint * fix(defer): move the defer statement above create --- api/build.go | 18 +++++++++++++++++- cmd/server/operate.go | 37 +++++++++++++++++++++++++++++-------- executor/linux/build.go | 19 +++++++++++++++++-- 3 files changed, 63 insertions(+), 11 deletions(-) diff --git a/api/build.go b/api/build.go index 3da6df96..937171ac 100644 --- a/api/build.go +++ b/api/build.go @@ -35,5 +35,21 @@ func GetBuild(c *gin.Context) { // This function performs a hard cancellation of a build on worker. // Any build running during this time will immediately be stopped. func KillBuild(c *gin.Context) { - c.JSON(http.StatusNotImplemented, "This endpoint is not yet implemented") + e := executor.Retrieve(c) + + repo, err := e.GetRepo() + if err != nil { + msg := fmt.Errorf("unable to repo build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + build, err := e.KillBuild() + if err != nil { + msg := fmt.Errorf("unable to kill build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return + } + + c.JSON(http.StatusOK, fmt.Sprintf("killing build %s/%d", repo.GetFullName(), build.GetNumber())) } diff --git a/cmd/server/operate.go b/cmd/server/operate.go index db95f0fa..f1955041 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -6,6 +6,9 @@ package main import ( "context" + "os" + "os/signal" + "syscall" "time" "github.com/go-vela/worker/executor" @@ -54,6 +57,23 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e ctx, timeout := context.WithTimeout(ctx, t) defer timeout() + // add signals to the parent context so + // users can cancel builds + sigchan := make(chan os.Signal, 1) + ctx, sig := context.WithCancel(ctx) + signal.Notify(sigchan, syscall.SIGTERM) + defer func() { + signal.Stop(sigchan) + sig() + }() + go func() { + select { + case <-sigchan: + sig() + case <-ctx.Done(): + } + }() + logger.Info("pulling secrets") // pull secrets for the build on the executor err = executor.PullSecret(ctx) @@ -62,6 +82,15 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e return err } + defer func() { + // destroying the build on the executor + logger.Info("destroying build") + err = executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + }() + // create the build on the executor logger.Info("creating build") err = executor.CreateBuild(ctx) @@ -78,14 +107,6 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e return err } - // destroy the build on the executor - logger.Info("destroying build") - err = executor.DestroyBuild(ctx) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - return err - } - logger.Info("completed build") } }) diff --git a/executor/linux/build.go b/executor/linux/build.go index e3564737..618823d2 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "strings" + "syscall" "time" "golang.org/x/sync/errgroup" @@ -519,7 +520,21 @@ func (c *client) DestroyBuild(ctx context.Context) error { } // KillBuild kills the current build in execution. -// TODO: implement function with sending sigcalls to Docker func (c *client) KillBuild() (*library.Build, error) { - return nil, nil + b := c.build + + // check if the build resource is available + if b == nil { + return nil, fmt.Errorf("build resource not found") + } + + // set the build status to killed + b.SetStatus(constants.StatusKilled) + + err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM) + if err != nil { + return nil, fmt.Errorf("unable to kill PID: %w", err) + } + + return b, nil } From 3799f311fbae105f8be488367dc5c2c7a29cfd91 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 13 Dec 2019 13:38:05 -0600 Subject: [PATCH 052/430] feat: add changelog for releases (#42) --- .chglog/CHANGELOG.tpl.md | 30 +++++++++++++++++ .chglog/config.yml | 28 ++++++++++++++++ .github/workflows/build.yml | 10 ++++-- .github/workflows/prerelease.yml | 37 +++++++++++++++++++++ .github/workflows/publish.yml | 17 +++++++--- .github/workflows/release.yml | 57 ++++++++++++++++++++++---------- .github/workflows/test.yml | 6 +++- .github/workflows/validate.yml | 7 ++-- 8 files changed, 164 insertions(+), 28 deletions(-) create mode 100755 .chglog/CHANGELOG.tpl.md create mode 100755 .chglog/config.yml create mode 100644 .github/workflows/prerelease.yml diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100755 index 00000000..60a67d5b --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,30 @@ +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) + +{{ range .CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts + +{{ range .RevertCommits -}} +* {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 00000000..febd8d72 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,28 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/go-vela/worker +options: + commits: + # filters: + # Type: + # - feat + # - fix + # - perf + # - refactor + commit_groups: + # title_maps: + # feat: Features + # fix: Bug Fixes + # perf: Performance Improvements + # refactor: Code Refactoring + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + notes: + keywords: + - BREAKING CHANGE \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73252204..e262df0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,17 +1,21 @@ -name: Build Action +# name of the action +name: build + +# trigger on pull_request or push events on: pull_request: push: +# pipeline to execute jobs: build: runs-on: ubuntu-latest container: image: golang:latest steps: - - name: clone uses: actions/checkout@v1 - name: build - run: make build + run: | + make build diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..f3505087 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,37 @@ +# name of the action +name: prerelease + +# trigger on push events with `v*` in tag +on: + push: + tags: + - 'v*' + +# pipeline to execute +jobs: + prerelease: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + + - name: build + env: + GOOS: linux + CGO_ENABLED: '0' + run: | + go build -a \ + -ldflags '-s -w -extldflags "-static"' \ + -o release/vela-worker \ + github.com/go-vela/worker/cmd/server + + - name: publish + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela-worker + cache: true + tag_names: true + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 09508aee..2cc68b6d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,23 +1,30 @@ -name: Publish Action +# name of the action +name: publish + +# trigger on push events with branch master on: push: branches: [ master ] +# pipeline to execute jobs: publish: runs-on: ubuntu-latest container: image: golang:latest steps: - - name: clone - uses: actions/checkout@master + uses: actions/checkout@v1 - name: build env: GOOS: linux - CGO_ENABLED: '0' - run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server + CGO_ENABLED: '1' + run: | + go build -a \ + -ldflags '-s -w -extldflags "-static"' \ + -o release/vela-worker \ + github.com/go-vela/worker/cmd/server - name: publish uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3514b0c..b4bc1e61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,30 +1,53 @@ -name: Release Action +# name of the action +name: release + +# trigger on push events with `v*` in tag +# ignore push events with `v*-rc*` in tag on: push: tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + - 'v*' + - '!v*-rc*' +# pipeline to execute jobs: release: runs-on: ubuntu-latest container: image: golang:latest steps: - - name: clone - uses: actions/checkout@master + uses: actions/checkout@v1 - - name: build - env: - GOOS: linux - CGO_ENABLED: '0' - run: go build -a -ldflags '-s -w -extldflags "-static"' -o release/vela-worker github.com/go-vela/worker/cmd/server + - name: tags + run: | + git fetch --tags + + - name: version + id: version + run: | + echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - - name: publish - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: target/vela-worker - cache: true - tag_names: true - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + - name: install + run: | + go get github.com/git-chglog/git-chglog/cmd/git-chglog + go get github.com/itchio/gothub + + - name: changelog + run: | + # https://github.com/git-chglog/git-chglog#git-chglog + $(go env GOPATH)/bin/git-chglog \ + -o $GITHUB_WORKSPACE/CHANGELOG.md \ + ${{ steps.version.outputs.VERSION }} + + - name: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # https://github.com/itchio/gothub#gothub + $(go env GOPATH)/bin/gothub edit \ + --user go-vela \ + --repo worker \ + --tag ${{ steps.version.outputs.VERSION }} \ + --name ${{ steps.version.outputs.VERSION }} \ + --description "$(cat $GITHUB_WORKSPACE/CHANGELOG.md)" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55275e02..f36cffb5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,12 @@ -name: Test Action +# name of the action +name: test + +# trigger on pull_request or push events on: pull_request: push: +# pipeline to execute jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f3a2c663..867909fc 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,15 +1,18 @@ -name: Validate Action +# name of the action +name: validate + +# trigger on pull_request or push events on: pull_request: push: +# pipeline to execute jobs: validate: runs-on: ubuntu-latest container: image: golang:latest steps: - - name: clone uses: actions/checkout@v1 From d8f3c76447d4727701eddc926c564397201bdac7 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 13 Dec 2019 13:49:13 -0600 Subject: [PATCH 053/430] chore: update all go mod dependencies (#43) --- go.mod | 28 +++++++++++++------ go.sum | 86 ++++++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 88 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 21d5e38c..edd48496 100644 --- a/go.mod +++ b/go.mod @@ -5,37 +5,47 @@ go 1.13 require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Microsoft/go-winio v0.4.14 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/drone/envsubst v1.0.2 - github.com/gin-gonic/gin v1.4.0 + github.com/gin-gonic/gin v1.5.0 + github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.2.0-rc2 github.com/go-vela/sdk-go v0.2.0-rc2 github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 - github.com/gogo/protobuf v1.2.0 // indirect + github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect + github.com/json-iterator/go v1.1.8 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.11 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/onsi/ginkgo v1.10.3 // indirect github.com/onsi/gomega v1.7.1 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/prometheus/client_golang v1.2.1 + github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect + github.com/prometheus/procfs v0.0.8 // indirect github.com/sirupsen/logrus v1.4.2 - github.com/urfave/cli v1.22.1 - golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect + github.com/urfave/cli v1.22.2 + golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e - golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db // indirect + golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect - google.golang.org/grpc v1.24.0 // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f // indirect + google.golang.org/grpc v1.25.1 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/go-playground/validator.v9 v9.30.2 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 - gopkg.in/yaml.v2 v2.2.5 // indirect + gopkg.in/yaml.v2 v2.2.7 // indirect gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index cc049a4d..f4942e19 100644 --- a/go.sum +++ b/go.sum @@ -13,13 +13,18 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 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/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 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= @@ -33,16 +38,30 @@ github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= +github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= +github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= +github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -56,8 +75,8 @@ github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 h1:5rma5aIapqg github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -79,19 +98,32 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8= +github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -125,6 +157,8 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee h1:iBZPTYkGLvdu6+A5TsMUJQkQX9Ad4aCEnSQtdxPuTCQ= +github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= @@ -132,6 +166,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= 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/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -145,10 +181,16 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -164,13 +206,12 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -182,15 +223,20 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -199,22 +245,28 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= +google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= +gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8CTwkU4pnOs= +gopkg.in/go-playground/validator.v9 v9.30.2/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= @@ -223,8 +275,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From c324da23bed01c4365a04124de7d9ed0f63ba7b1 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 17 Dec 2019 13:26:55 -0600 Subject: [PATCH 054/430] chore: update go-vela dependencies (#44) --- go.mod | 11 +++-------- go.sum | 29 +++++++++-------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index edd48496..6f638eff 100644 --- a/go.mod +++ b/go.mod @@ -14,18 +14,15 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 - github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.2.0-rc2 - github.com/go-vela/sdk-go v0.2.0-rc2 - github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 + github.com/go-vela/mock v0.2.0-rc3 + github.com/go-vela/sdk-go v0.2.0-rc3 + github.com/go-vela/types v0.2.0-rc3 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect - github.com/json-iterator/go v1.1.8 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect - github.com/leodido/go-urn v1.2.0 // indirect github.com/mattn/go-isatty v0.0.11 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/onsi/ginkgo v1.10.3 // indirect @@ -44,8 +41,6 @@ require ( google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f // indirect google.golang.org/grpc v1.25.1 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/go-playground/validator.v9 v9.30.2 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 - gopkg.in/yaml.v2 v2.2.7 // indirect gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index f4942e19..7e6e54e3 100644 --- a/go.sum +++ b/go.sum @@ -42,12 +42,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -65,14 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.2.0-rc2 h1:/BJhYQlY8Y6HgCLS/mkA/atjR1AUOY5rAKPlB0oKoGo= -github.com/go-vela/mock v0.2.0-rc2/go.mod h1:J1nvvtmowjetnAoo+dJ8LvC2iwIBF+E3oko1KC5Fbvo= -github.com/go-vela/sdk-go v0.2.0-rc2 h1:Zc4G/y0RHf3m7bK2CXZRkX3qEZV55LWfzOakdxvXy1E= -github.com/go-vela/sdk-go v0.2.0-rc2/go.mod h1:ow3YFlsNj/I4kHlNE75tGDHBDh8k/qmameS5ADtLLpU= -github.com/go-vela/types v0.2.0-rc2 h1:oAMCz9iRFXAOtHNALed2zpTRzU5+N8bl+YhEJIedPzo= -github.com/go-vela/types v0.2.0-rc2/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= -github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7 h1:5rma5aIapqg9hVN+ZUwjK1+OuigozsX1uL6zUnZgL+8= -github.com/go-vela/types v0.2.0-rc2.0.20191211184240-0b756602e9d7/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.2.0-rc3 h1:wp0QUTqa5Oca2jGeHLjzqXhy+YLK53aDNQPYBdPV0hM= +github.com/go-vela/mock v0.2.0-rc3/go.mod h1:iYywX/5idxRZO5z1hLkIv5QWdIU9SqyQoGxsJHup2Wo= +github.com/go-vela/sdk-go v0.2.0-rc3 h1:oqI8tjTh63Znp86TwSS35t4nFRO/hhYHLvH6sBx++oU= +github.com/go-vela/sdk-go v0.2.0-rc3/go.mod h1:32L27+fmV/AzlRzaB11pfsEje8Xfo/74OWZXFZfsTF4= +github.com/go-vela/types v0.2.0-rc3 h1:8huOI7wk35874T1HdwfbK2+AiIhagC3b4WWU6hdrmtE= +github.com/go-vela/types v0.2.0-rc3/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= @@ -119,9 +113,8 @@ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -183,8 +176,6 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= @@ -203,7 +194,6 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= @@ -220,13 +210,14 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -261,8 +252,6 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8CTwkU4pnOs= From 8173a8bc015c57a898dd990789a820ade676e412 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 18 Dec 2019 14:03:37 -0600 Subject: [PATCH 055/430] ci: switch from coveralls to codecov (#45) --- .github/README.md | 2 +- .github/workflows/test.yml | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/README.md b/.github/README.md index f2d0917d..b165654f 100644 --- a/.github/README.md +++ b/.github/README.md @@ -2,7 +2,7 @@ [![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) -[![Coverage Status](https://coveralls.io/repos/github/go-vela/worker/badge.svg?branch=master)](https://coveralls.io/github/go-vela/worker?branch=master) +[![codecov](https://codecov.io/gh/go-vela/worker/branch/master/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) > Vela is in active development and is a pre-release product. Please use at your own risk in production. > diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f36cffb5..7d70a7e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,9 +24,8 @@ jobs: run: | go test -covermode=atomic -coverprofile=coverage.out ./... - - name: coveralls - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # https://github.com/mattn/goveralls#goveralls - $(go env GOPATH)/bin/goveralls -service=github -coverprofile=coverage.out + - name: coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.out From 1c50b32742d4ca8d14bb2e6ae018538301b40d52 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 18 Dec 2019 15:37:45 -0600 Subject: [PATCH 056/430] ci: add explicit configuration for automation (#46) * ci: add default codecov configuration * ci: add golangci configuration --- .golangci.yml | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ codecov.yml | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 .golangci.yml create mode 100644 codecov.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..16011810 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,73 @@ +# This is a manually created golangci.com yaml configuration with +# some defaults explicitly provided. There is a large number of +# linters we've enabled that are usually disabled by default. +# +# https://github.com/golangci/golangci-lint#config-file + +# This section provides the configuration for how golangci +# outputs it results from the linters it executes. +output: + format: colored-line-number + print-issued-lines: true + print-linter-name: true + +# This section provides the configuration for which linters +# golangci will execute. Several of them were disabled by +# default but we've opted to enable them. +linters: + # disable all linters as new linters might be added to golangci + disable-all: true + enable: + # linters enabled by default + - deadcode + - errcheck + - govet + - gosimple # a.k.a. megacheck + - ineffassign + - staticcheck + - structcheck + - typecheck + - unused + - varcheck + + # linters disabled by default + - bodyclose + - gocognit + - goconst + - gocyclo + - goimports + - gosec + - funlen + - maligned + - misspell + - stylecheck + - unparam + - whitespace + - wsl + + # static list of linters we know golangci can run but we've + # chosen to leave disabled for now + # + # disable: + # - depguard + # - dogsled + # - dupl + # - gocritic + # - gochecknoinits + # - gochecknoglobals + # - godox + # - gofmt + # - golint + # - gomnd + # - interfacer + # - lll + # - nakedret + # - scopelint + # - unconvert + +# This section provides the configuration for each linter +# we've instructed golangci to execute. Currently, we've +# left this part empty as we're going to roll with the +# linter specific default settings for now. +# +# linters-settings: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..f23cd41a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,50 @@ +# The is the default codecov.io yaml configuration all projects use +# that do not have their own codecov.yml already in the project. +# +# https://docs.codecov.io/docs/codecov-yaml#section-default-yaml + +# This section provides the generic configuration for codecov. +# +# https://docs.codecov.io/docs/codecovyml-reference#section-codecov +codecov: + + require_ci_to_pass: yes + +# This section provides the configuration for the +# coverage report codecov analyzes for results. +# +# https://docs.codecov.io/docs/codecovyml-reference#section-coverage +coverage: + + precision: 2 + round: down + range: "70...100" + + status: + project: yes + patch: yes + changes: no + +# This section provides the configuration for the +# parsers codecov uses for the coverage report. +# +# https://docs.codecov.io/docs/codecovyml-reference#section-parsers +parsers: + + gcov: + + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +# This section provides the configuration for the +# comments codecov makes to open pull requests. +# +# https://docs.codecov.io/docs/codecovyml-reference#section-comment +comment: + + layout: "reach, diff, flags, files" + behavior: default + require_changes: no From e6c0f469cf454fb7fbd332d1d90dfb253c21850b Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 20 Dec 2019 09:15:15 -0600 Subject: [PATCH 057/430] refactor: fix linter errors (#47) * refactor: fix wsl (whitespace) linter errors * refactor: fix stylecheck linter errors * refactor: fix staticcheck linter errors * refactor: fix govet linter errors --- api/build.go | 6 +++++ api/executor.go | 18 ++++++++++++-- api/pipeline.go | 2 ++ api/repo.go | 2 ++ cmd/server/executor.go | 7 +++--- cmd/server/queue.go | 7 +++--- cmd/server/runtime.go | 4 +-- cmd/server/server.go | 6 ++++- executor/linux/build.go | 14 ++++++++--- executor/linux/build_test.go | 5 +++- executor/linux/linux.go | 4 +-- executor/linux/secret.go | 11 ++++++--- executor/linux/secret_test.go | 3 +-- executor/linux/service.go | 4 ++- executor/linux/service_test.go | 8 +++--- executor/linux/stage.go | 4 ++- executor/linux/stage_test.go | 6 ++--- executor/linux/step.go | 4 +++ executor/linux/step_test.go | 8 +++--- queue/redis/redis.go | 5 ++-- router/build.go | 1 - router/executor.go | 4 --- router/middleware/executor/executor_test.go | 8 +++--- router/middleware/header.go | 3 +++ router/middleware/header_test.go | 27 ++++++++++++++------- router/middleware/logger.go | 1 - router/middleware/logger_test.go | 8 ++++-- router/middleware/payload_test.go | 6 +++-- router/middleware/perm/perm_test.go | 8 ++++-- router/middleware/token/token.go | 2 +- router/middleware/user/user_test.go | 16 ++++++++---- router/pipeline.go | 1 - router/repo.go | 1 - router/router.go | 1 - runtime/docker/container.go | 2 ++ runtime/docker/container_test.go | 12 --------- runtime/docker/docker.go | 2 +- runtime/docker/network_test.go | 4 --- runtime/docker/volume_test.go | 4 --- 39 files changed, 148 insertions(+), 91 deletions(-) diff --git a/api/build.go b/api/build.go index 937171ac..e75759cd 100644 --- a/api/build.go +++ b/api/build.go @@ -22,7 +22,9 @@ func GetBuild(c *gin.Context) { build, err := e.GetBuild() if err != nil { msg := fmt.Errorf("unable to read build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -40,14 +42,18 @@ func KillBuild(c *gin.Context) { repo, err := e.GetRepo() if err != nil { msg := fmt.Errorf("unable to repo build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } build, err := e.KillBuild() if err != nil { msg := fmt.Errorf("unable to kill build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } diff --git a/api/executor.go b/api/executor.go index 68203bf7..a65403d3 100644 --- a/api/executor.go +++ b/api/executor.go @@ -18,9 +18,10 @@ import ( // GetExecutor represents the API handler to capture the // executor currently running on a worker. func GetExecutor(c *gin.Context) { + var err error + e := exec.Retrieve(c) executor := &library.Executor{} - var err error // TODO: Add this information from the context or helpers on executor // tmp.SetHost(executor.GetHost()) @@ -31,7 +32,9 @@ func GetExecutor(c *gin.Context) { executor.Build, err = e.GetBuild() if err != nil { msg := fmt.Errorf("unable to retrieve build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -39,7 +42,9 @@ func GetExecutor(c *gin.Context) { executor.Pipeline, err = e.GetPipeline() if err != nil { msg := fmt.Errorf("unable to retrieve pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -47,7 +52,9 @@ func GetExecutor(c *gin.Context) { executor.Repo, err = e.GetRepo() if err != nil { msg := fmt.Errorf("unable to retrieve repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -57,9 +64,10 @@ func GetExecutor(c *gin.Context) { // GetExecutors represents the API handler to capture the // executors currently running on a worker. func GetExecutors(c *gin.Context) { + var err error + e := executor.FromContext(c) executors := []*library.Executor{} - var err error for _, executor := range e { // create a temporary executor to append results to response @@ -74,7 +82,9 @@ func GetExecutors(c *gin.Context) { tmp.Build, err = executor.GetBuild() if err != nil { msg := fmt.Errorf("unable to retrieve build: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -82,7 +92,9 @@ func GetExecutors(c *gin.Context) { tmp.Pipeline, err = executor.GetPipeline() if err != nil { msg := fmt.Errorf("unable to retrieve pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } @@ -90,7 +102,9 @@ func GetExecutors(c *gin.Context) { tmp.Repo, err = executor.GetRepo() if err != nil { msg := fmt.Errorf("unable to retrieve repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } diff --git a/api/pipeline.go b/api/pipeline.go index 357d8a51..41e57af6 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -22,7 +22,9 @@ func GetPipeline(c *gin.Context) { pipeline, err := e.GetPipeline() if err != nil { msg := fmt.Errorf("unable to read pipeline: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } diff --git a/api/repo.go b/api/repo.go index 83977d93..530934fc 100644 --- a/api/repo.go +++ b/api/repo.go @@ -22,7 +22,9 @@ func GetRepo(c *gin.Context) { repo, err := e.GetRepo() if err != nil { msg := fmt.Errorf("unable to read repo: %w", err).Error() + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } diff --git a/cmd/server/executor.go b/cmd/server/executor.go index e82218d5..8f392c7e 100644 --- a/cmd/server/executor.go +++ b/cmd/server/executor.go @@ -22,6 +22,7 @@ import ( // helper function to setup the queue from the CLI arguments. func setupExecutor(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { logrus.Debug("Creating executor clients from CLI configuration") + switch c.String("executor-driver") { case constants.DriverDarwin: return setupDarwin(c, client, runtime) @@ -30,7 +31,7 @@ func setupExecutor(c *cli.Context, client *vela.Client, runtime runtime.Engine) case constants.DriverWindows: return setupWindows(c, client, runtime) default: - return nil, fmt.Errorf("Unrecognized executor driver: %s", c.String("executor-driver")) + return nil, fmt.Errorf("invalid executor driver: %s", c.String("executor-driver")) } } @@ -38,7 +39,7 @@ func setupExecutor(c *cli.Context, client *vela.Client, runtime runtime.Engine) func setupDarwin(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverDarwin) // return darwin.New(client, runtime) - return nil, fmt.Errorf("Unsupported executor driver: %s", constants.DriverDarwin) + return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverDarwin) } // helper function to setup the Linux executor from the CLI arguments. @@ -51,5 +52,5 @@ func setupLinux(c *cli.Context, client *vela.Client, runtime runtime.Engine) (ex func setupWindows(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverWindows) // return windows.New(client, runtime) - return nil, fmt.Errorf("Unsupported executor driver: %s", constants.DriverWindows) + return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverWindows) } diff --git a/cmd/server/queue.go b/cmd/server/queue.go index aee88b20..f30e9624 100644 --- a/cmd/server/queue.go +++ b/cmd/server/queue.go @@ -19,13 +19,14 @@ import ( // helper function to setup the queue from the CLI arguments. func setupQueue(c *cli.Context) (queue.Service, error) { logrus.Debug("Creating queue client from CLI configuration") + switch c.String("queue-driver") { case constants.DriverKafka: return setupKafka(c) case constants.DriverRedis: return setupRedis(c) default: - return nil, fmt.Errorf("Unrecognized queue driver: %s", c.String("queue-driver")) + return nil, fmt.Errorf("invalid queue driver: %s", c.String("queue-driver")) } } @@ -33,12 +34,11 @@ func setupQueue(c *cli.Context) (queue.Service, error) { func setupKafka(c *cli.Context) (queue.Service, error) { logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverKafka) // return kafka.New(c.String("queue-config"), "vela") - return nil, fmt.Errorf("Unsupported queue driver: %s", constants.DriverKafka) + return nil, fmt.Errorf("unsupported queue driver: %s", constants.DriverKafka) } // helper function to setup the Redis queue from the CLI arguments. func setupRedis(c *cli.Context) (queue.Service, error) { - // setup routes routes := append(c.StringSlice("queue-worker-routes"), constants.DefaultRoute) @@ -48,5 +48,6 @@ func setupRedis(c *cli.Context) (queue.Service, error) { } logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverRedis) + return redis.New(c.String("queue-config"), routes...) } diff --git a/cmd/server/runtime.go b/cmd/server/runtime.go index d3489025..178a8ad4 100644 --- a/cmd/server/runtime.go +++ b/cmd/server/runtime.go @@ -26,7 +26,7 @@ func setupRuntime(c *cli.Context) (runtime.Engine, error) { case constants.DriverKubernetes: return setupKubernetes(c) default: - return nil, fmt.Errorf("Unrecognized runtime driver: %s", c.String("runtime-driver")) + return nil, fmt.Errorf("invalid runtime driver: %s", c.String("runtime-driver")) } } @@ -40,5 +40,5 @@ func setupDocker(c *cli.Context) (runtime.Engine, error) { func setupKubernetes(c *cli.Context) (runtime.Engine, error) { logrus.Tracef("Creating %s runtime client from CLI configuration", constants.DriverKubernetes) // return kubernetes.New() - return nil, fmt.Errorf("Unsupported runtime driver: %s", constants.DriverKubernetes) + return nil, fmt.Errorf("unsupported runtime driver: %s", constants.DriverKubernetes) } diff --git a/cmd/server/server.go b/cmd/server/server.go index aaecd9b0..4e77d4b2 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -5,6 +5,7 @@ package main import ( + "context" "net/http" "time" @@ -71,11 +72,13 @@ func server(c *cli.Context) error { // create the executor clients executors := make(map[int]executor.Engine) + for i := 0; i < c.Int("executor-threads"); i++ { executor, err := setupExecutor(c, vela, runtime) if err != nil { return err } + executors[i] = executor } @@ -112,12 +115,13 @@ func server(c *cli.Context) error { select { case <-tomb.Dying(): logrus.Info("Stopping HTTP server...") - return srv.Shutdown(nil) + return srv.Shutdown(context.Background()) } } }) // Wait for stuff and watch for errors tomb.Wait() + return tomb.Err() } diff --git a/executor/linux/build.go b/executor/linux/build.go index 618823d2..916fb7d7 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -23,6 +23,7 @@ import ( // CreateBuild prepares the build for execution. func (c *client) CreateBuild(ctx context.Context) error { var err error + b := c.build p := c.pipeline r := c.repo @@ -47,7 +48,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // send API call to update the build _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) if err != nil { - c.logger.Errorf("unable to upload errored state: %w", err) + c.logger.Errorf("unable to upload errored state: %v", err) } } }() @@ -111,12 +112,14 @@ func (c *client) CreateBuild(ctx context.Context) error { if !ok { return fmt.Errorf("unable to get %s step from client", init.Name) } + s := result.(*library.Step) result, ok = c.stepLogs.Load(init.ID) if !ok { return fmt.Errorf("unable to get %s step log from client", init.Name) } + l := result.(*library.Log) defer func() { @@ -125,14 +128,14 @@ func (c *client) CreateBuild(ctx context.Context) error { // send API call to update the step s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) if err != nil { - c.logger.Errorf("unable to upload %s state: %w", init.Name, err) + c.logger.Errorf("unable to upload %s state: %v", init.Name, err) } c.logger.Infof("uploading %s step logs", init.Name) // send API call to update the logs for the step l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), init.Number, l) if err != nil { - c.logger.Errorf("unable to upload %s logs: %w", init.Name, err) + c.logger.Errorf("unable to upload %s logs: %v", init.Name, err) } }() @@ -278,6 +281,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // ExecBuild runs a pipeline for a build. func (c *client) ExecBuild(ctx context.Context) error { var err error + b := c.build p := c.pipeline r := c.repo @@ -349,6 +353,7 @@ func (c *client) ExecBuild(ctx context.Context) error { if !ok { return fmt.Errorf("unable to get step from client") } + cStep := result.(*library.Step) // check the step exit code @@ -424,6 +429,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // DestroyBuild cleans up the build after execution. func (c *client) DestroyBuild(ctx context.Context) error { var err error + b := c.build p := c.pipeline r := c.repo @@ -493,9 +499,11 @@ func (c *client) DestroyBuild(ctx context.Context) error { if !ok { return fmt.Errorf("unable to get service from client") } + cService := result.(*library.Service) cService.SetExitCode(s.ExitCode) cService.SetFinished(time.Now().UTC().Unix()) + _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cService) if err != nil { c.logger.Errorf("unable to upload service status: %w", err) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index ae3de8e8..48e184a0 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -21,7 +21,6 @@ import ( ) func TestExecutor_CreateBuild_Success(t *testing.T) { - // setup global vars var ( _build = &library.Build{ @@ -71,6 +70,7 @@ func TestExecutor_CreateBuild_Success(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) vela, _ := vela.NewClient(s.URL, nil) @@ -274,6 +274,7 @@ func TestExecutor_ExecBuild_Success(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) vela, _ := vela.NewClient(s.URL, nil) @@ -479,6 +480,7 @@ func TestExecutor_DestroyBuild_Success(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -625,6 +627,7 @@ func TestExecutor_DestroyBuild_Success(t *testing.T) { e.WithBuild(test.build) e.WithPipeline(test.pipeline) e.WithRepo(test.repo) + svc := new(library.Service) svc.SetNumber(1) e.services.Store(e.pipeline.Services[0].ID, svc) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 7237dcbe..c0f98d2c 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -40,12 +40,12 @@ type client struct { func New(c *vela.Client, r runtime.Engine) (*client, error) { // immediately return if a nil Vela client is provided if c == nil { - return nil, fmt.Errorf("Empty Vela client provided to executor") + return nil, fmt.Errorf("empty Vela client provided to executor") } // immediately return if a nil runtime Engine is provided if r == nil { - return nil, fmt.Errorf("Empty runtime provided to executor") + return nil, fmt.Errorf("empty runtime provided to executor") } // capture the hostname diff --git a/executor/linux/secret.go b/executor/linux/secret.go index dbbfd2a2..3151e858 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -19,6 +19,7 @@ import ( // PullSecret defines a function that pulls the secrets for a given pipeline. func (c *client) PullSecret(ctx context.Context) error { var err error + p := c.pipeline secrets := make(map[string]*library.Secret) @@ -67,6 +68,7 @@ func (c *client) PullSecret(ctx context.Context) error { // overwrite the engine secret map c.Secrets = secrets + return nil } @@ -106,6 +108,7 @@ func (c *client) getOrg(s *pipeline.Secret) (*library.Secret, error) { // overwrite the secret value s.Value = secret.GetValue() + return secret, nil } @@ -151,6 +154,7 @@ func (c *client) getRepo(s *pipeline.Secret) (*library.Secret, error) { // overwrite the secret value s.Value = secret.GetValue() + return secret, nil } @@ -160,8 +164,9 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { c.logger.Tracef("pulling %s %s secret %s", s.Engine, s.Type, s.Name) // variables necessary for secret - org := c.repo.GetOrg() var team string + + org := c.repo.GetOrg() path := s.Key // check if the full path was provided @@ -171,7 +176,7 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { // secret is invalid if len(parts) != 3 { - return nil, fmt.Errorf("Path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) + return nil, fmt.Errorf("path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) } // check if the org provided matches what we expect @@ -196,13 +201,13 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { // overwrite the secret value s.Value = secret.GetValue() + return secret, nil } // helper function to check secret whitelist before setting value // TODO: Evaluate pulling this into a "bool" types function for injecting func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error { - // inject secrets for step for _, secret := range ctn.Secrets { logrus.Tracef("looking up secret %s from pipeline secrets", secret.Source) diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index d42f8b3f..b0eae12b 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -19,12 +19,12 @@ import ( ) func TestExecutor_PullSecret_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) vela, _ := vela.NewClient(s.URL, nil) @@ -100,7 +100,6 @@ func TestExecutor_PullSecret_Success(t *testing.T) { } func TestLinux_Secret_injectSecret(t *testing.T) { - // name and value of secret v := "foo" diff --git a/executor/linux/service.go b/executor/linux/service.go index 8464764d..3ce7ab76 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -19,7 +19,6 @@ import ( // CreateService prepares the service for execution. func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) error { - // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "service": ctn.Name, @@ -38,6 +37,7 @@ func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) err // PlanService defines a function that prepares the service for execution. func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { var err error + b := c.build r := c.repo @@ -59,6 +59,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error if err != nil { return err } + s.SetStatus(constants.StatusSuccess) // add a service to a map @@ -87,6 +88,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error if !ok { return fmt.Errorf("unable to get service log from client") } + l := result.(*library.Log) // update engine logger with extra metadata diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 45e0e7dc..25e3a60c 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -18,12 +18,12 @@ import ( ) func TestExecutor_CreateService_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -52,12 +52,12 @@ func TestExecutor_CreateService_Success(t *testing.T) { } func TestExecutor_PlanService_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -128,12 +128,12 @@ func TestExecutor_PlanService_Success(t *testing.T) { } func TestExecutor_ExecService_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -205,12 +205,12 @@ func TestExecutor_ExecService_Success(t *testing.T) { } func TestExecutor_DestroyService_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 798f9c81..568ca5e0 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -23,6 +23,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { if !ok { return fmt.Errorf("unable to get init step log from client") } + l := result.(*library.Log) // update engine logger with extra metadata @@ -40,7 +41,6 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { // create the steps for the stage for _, step := range s.Steps { - // TODO: make this not hardcoded // update the init log with progress l.SetData( @@ -106,6 +106,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] logger.WithError(err).Errorf("%s stage produced error", needs) return err } + continue } } @@ -134,6 +135,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] if !ok { return fmt.Errorf("unable to get step from client") } + cStep := result.(*library.Step) // check the step exit code diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index a75e557b..329b0ab6 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -18,12 +18,12 @@ import ( ) func TestExecutor_CreateStage_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -121,7 +121,6 @@ func TestExecutor_CreateStage_Success(t *testing.T) { } func TestExecutor_ExecStage_Success(t *testing.T) { - // setup r, _ := docker.NewMock() stageMap := make(map[string]chan error) @@ -131,6 +130,7 @@ func TestExecutor_ExecStage_Success(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -253,12 +253,12 @@ func TestExecutor_ExecStage_Success(t *testing.T) { } func TestExecutor_DestroyStage_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) diff --git a/executor/linux/step.go b/executor/linux/step.go index ddd76614..495d4c37 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -74,6 +74,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error if strings.Contains(env, "\n") { env = fmt.Sprintf("%q", env) } + return env } @@ -97,6 +98,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // PlanStep defines a function that prepares the step for execution. func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { var err error + b := c.build r := c.repo @@ -121,6 +123,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { if err != nil { return err } + s.SetStatus(constants.StatusSuccess) // add a step to a map @@ -154,6 +157,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { if !ok { return fmt.Errorf("unable to get step log from client") } + l := result.(*library.Log) // update engine logger with extra metadata diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index d435b41c..b93182b0 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -21,12 +21,12 @@ import ( ) func TestExecutor_CreateStep_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -91,12 +91,12 @@ func TestExecutor_CreateStep_Success(t *testing.T) { } func TestExecutor_PlanStep_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -203,12 +203,12 @@ func TestExecutor_PlanStep_Success(t *testing.T) { } func TestExecutor_ExecStep_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) @@ -317,12 +317,12 @@ func TestExecutor_ExecStep_Success(t *testing.T) { } func TestExecutor_DestroyStep_Success(t *testing.T) { - // setup r, _ := docker.NewMock() // setup context gin.SetMode(gin.TestMode) + s := httptest.NewServer(server.FakeHandler()) c, _ := vela.NewClient(s.URL, nil) diff --git a/queue/redis/redis.go b/queue/redis/redis.go index 59ddaac8..d54986fe 100644 --- a/queue/redis/redis.go +++ b/queue/redis/redis.go @@ -145,13 +145,14 @@ func pingQueue(client *redis.Client) error { // send ping request to client err := client.Ping().Err() if err != nil { - logrus.Debugf("Error pinging Redis queue. Retrying in %v", (time.Duration(i) * time.Second)) + logrus.Debugf("unable to ping Redis queue. Retrying in %v", (time.Duration(i) * time.Second)) time.Sleep(1 * time.Second) + continue } return nil } - return fmt.Errorf("Error establishing connection to Redis queue") + return fmt.Errorf("unable to establish connection to Redis queue") } diff --git a/router/build.go b/router/build.go index 253448dc..7280a234 100644 --- a/router/build.go +++ b/router/build.go @@ -15,7 +15,6 @@ import ( // GET /api/v1/executors/:executor/build // DELETE /api/v1/executors/:executor/build/kill func buildHandlers(base *gin.RouterGroup) { - // builds endpoints build := base.Group("/build") { diff --git a/router/executor.go b/router/executor.go index 166c5611..0e9aa8ce 100644 --- a/router/executor.go +++ b/router/executor.go @@ -20,11 +20,9 @@ import ( // GET /api/v1/executors/:executor/pipeline // GET /api/v1/executors/:executor/repo func executorHandlers(base *gin.RouterGroup) { - // executors endpoints executors := base.Group("/executors") { - executors.GET("", api.GetExecutors) // exector endpoints @@ -40,8 +38,6 @@ func executorHandlers(base *gin.RouterGroup) { // build endpoints repoHandlers(executor) - } // end of executor endpoints - } // end of executors endpoints } diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 4ef890df..63cc2be8 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -21,6 +21,7 @@ func TestExecutor_Retrieve(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) ToContext(context, want) @@ -39,8 +40,9 @@ func TestExecutor_Establish(t *testing.T) { got := want[0] // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) @@ -67,15 +69,15 @@ func TestExecutor_Establish(t *testing.T) { func TestExecutor_Establish_NoExecutor(t *testing.T) { // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) // setup mock server engine.Use(Establish()) engine.GET("/executors/:executor", func(c *gin.Context) { - c.Status(http.StatusOK) }) diff --git a/router/middleware/header.go b/router/middleware/header.go index ded2a488..ada4da39 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -44,6 +44,7 @@ func Secure(c *gin.Context) { c.Header("X-Frame-Options", "DENY") c.Header("X-Content-Type-Options", "nosniff") c.Header("X-XSS-Protection", "1; mode=block") + if c.Request.TLS != nil { c.Header("Strict-Transport-Security", "max-age=31536000") } @@ -57,6 +58,7 @@ func Secure(c *gin.Context) { // intended for debugging and troubleshooting. func RequestVersion(c *gin.Context) { apiVersion := version.Version + if gin.Mode() == "debug" { c.Request.Header.Set("X-Vela-Version", apiVersion.String()) } else { // in prod we don't want the build number metadata @@ -70,6 +72,7 @@ func RequestVersion(c *gin.Context) { // intended for debugging and troubleshooting. func ResponseVersion(c *gin.Context) { apiVersion := version.Version + if gin.Mode() == "debug" { c.Header("X-Vela-Version", apiVersion.String()) } else { // in prod we don't want the build number metadata diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index c8aa2cbb..dd362945 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -22,8 +22,9 @@ func TestMiddleware_NoCache(t *testing.T) { wantLastModified := time.Now().UTC().Format(http.TimeFormat) // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -66,8 +67,9 @@ func TestMiddleware_Options(t *testing.T) { wantContentType := "application/json" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodOptions, "/health", nil) @@ -113,8 +115,9 @@ func TestMiddleware_Options(t *testing.T) { func TestMiddleware_Options_InvalidMethod(t *testing.T) { // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -166,8 +169,9 @@ func TestMiddleware_Secure(t *testing.T) { wantProtection := "1; mode=block" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -215,8 +219,9 @@ func TestMiddleware_Secure_TLS(t *testing.T) { wantSecurity := "max-age=31536000" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) context.Request.TLS = new(tls.ConnectionState) @@ -266,8 +271,9 @@ func TestMiddleware_RequestVersion(t *testing.T) { wantVersion := "0.2.0" // setup context + gin.SetMode(gin.TestMode) + resp := httptest.NewRecorder() - gin.SetMode(gin.DebugMode) context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -296,8 +302,9 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { wantVersion := "0.2.0" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -326,8 +333,9 @@ func TestMiddleware_ResponseVersion(t *testing.T) { wantVersion := "0.2.0" // setup context + gin.SetMode(gin.TestMode) + resp := httptest.NewRecorder() - gin.SetMode(gin.DebugMode) context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) @@ -356,8 +364,9 @@ func TestMiddleware_ResponseVersion_Prod(t *testing.T) { wantVersion := "0.2.0" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) diff --git a/router/middleware/logger.go b/router/middleware/logger.go index eae2651a..a2c52676 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -60,6 +60,5 @@ func Logger(logger *logrus.Logger, timeFormat string, utc bool) gin.HandlerFunc entry.Info() } } - } } diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 1802de57..7f11b804 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -25,12 +25,14 @@ func TestMiddleware_Logger(t *testing.T) { payload, _ := json.Marshal(`{"foo": "bar"}`) wantLevel := logrus.InfoLevel wantMessage := "" + logger, hook := test.NewNullLogger() defer hook.Reset() // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodPost, "/foobar", bytes.NewBuffer(payload)) @@ -64,12 +66,14 @@ func TestMiddleware_Logger_Error(t *testing.T) { // setup types wantLevel := logrus.ErrorLevel wantMessage := "Error #01: test error\n" + logger, hook := test.NewNullLogger() defer hook.Reset() // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/foobar", nil) diff --git a/router/middleware/payload_test.go b/router/middleware/payload_test.go index 0fdd207b..7423cd4c 100644 --- a/router/middleware/payload_test.go +++ b/router/middleware/payload_test.go @@ -17,13 +17,15 @@ import ( func TestMiddleware_Payload(t *testing.T) { // setup types + var got interface{} + want := `{"foo": "bar"}` jsonBody, _ := json.Marshal(want) - var got interface{} // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodPost, "/health", bytes.NewBuffer(jsonBody)) diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index 3c1b41bd..a24c9ebb 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -29,8 +29,9 @@ func TestPerm_MustServer_success(t *testing.T) { u.SetAdmin(true) // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) @@ -42,6 +43,7 @@ func TestPerm_MustServer_success(t *testing.T) { engine.GET("/server/users", func(c *gin.Context) { c.Status(http.StatusOK) }) + s1 := httptest.NewServer(engine) defer s1.Close() @@ -65,8 +67,9 @@ func TestPerm_MustServer_failure(t *testing.T) { u.SetAdmin(true) // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) @@ -78,6 +81,7 @@ func TestPerm_MustServer_failure(t *testing.T) { engine.GET("/server/users", func(c *gin.Context) { c.Status(http.StatusOK) }) + s1 := httptest.NewServer(engine) defer s1.Close() diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 9bab937b..58902182 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -26,5 +26,5 @@ func Retrieve(r *http.Request) (string, error) { } } - return "", fmt.Errorf("No token provided in Authorization header") + return "", fmt.Errorf("no token provided in Authorization header") } diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index 3d204f3e..1d51ea05 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -23,6 +23,7 @@ func TestUser_Retrieve(t *testing.T) { // setup context gin.SetMode(gin.TestMode) + context, _ := gin.CreateTestContext(nil) ToContext(context, want) @@ -44,8 +45,9 @@ func TestUser_Establish(t *testing.T) { want.SetAdmin(true) // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) @@ -58,6 +60,7 @@ func TestUser_Establish(t *testing.T) { c.Status(http.StatusOK) }) + s1 := httptest.NewServer(engine) defer s1.Close() @@ -75,8 +78,9 @@ func TestUser_Establish(t *testing.T) { func TestUser_Establish_NoToken(t *testing.T) { // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo", nil) @@ -103,8 +107,9 @@ func TestUser_Establish_SecretValid(t *testing.T) { got := new(library.User) // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) @@ -117,6 +122,7 @@ func TestUser_Establish_SecretValid(t *testing.T) { c.Status(http.StatusOK) }) + s := httptest.NewServer(engine) defer s.Close() @@ -133,13 +139,13 @@ func TestUser_Establish_SecretValid(t *testing.T) { } func TestUser_Establish_NoAuthorizeUser(t *testing.T) { - // setup types secret := "superSecret" // setup context - resp := httptest.NewRecorder() gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo?access_token=bar", nil) diff --git a/router/pipeline.go b/router/pipeline.go index a2438e0f..a513f1d3 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -14,7 +14,6 @@ import ( // // GET /api/v1/executors/:executor/pipeline func pipelineHandlers(base *gin.RouterGroup) { - // pipelines endpoints pipeline := base.Group("/pipeline") { diff --git a/router/repo.go b/router/repo.go index 31760d42..cf0e6072 100644 --- a/router/repo.go +++ b/router/repo.go @@ -14,7 +14,6 @@ import ( // // GET /api/v1/executors/:executor/repo func repoHandlers(base *gin.RouterGroup) { - // repos endpoints repo := base.Group("/repo") { diff --git a/router/router.go b/router/router.go index 950e8244..db71a18d 100644 --- a/router/router.go +++ b/router/router.go @@ -38,7 +38,6 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { // executor endpoints executorHandlers(baseAPI) baseAPI.POST("/shutdown", api.Shutdown) - } // end of api return r diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 2673d028..76cc9187 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -132,6 +132,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er if err != nil { return err } + defer reader.Close() // copy output from image pull to standard output @@ -162,6 +163,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er if err != nil { return err } + defer reader.Close() // copy output from image pull to standard output diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index 9a4a8075..b4bd2b0a 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -12,7 +12,6 @@ import ( ) func TestDocker_InspectContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -32,7 +31,6 @@ func TestDocker_InspectContainer_Success(t *testing.T) { } func TestDocker_InspectContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -45,7 +43,6 @@ func TestDocker_InspectContainer_Failure(t *testing.T) { } func TestDocker_RemoveContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -65,7 +62,6 @@ func TestDocker_RemoveContainer_Success(t *testing.T) { } func TestDocker_RemoveContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -78,7 +74,6 @@ func TestDocker_RemoveContainer_Failure(t *testing.T) { } func TestDocker_RunContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -105,7 +100,6 @@ func TestDocker_RunContainer_Success(t *testing.T) { // TODO: rethink how the mock is being done in the // router switch. This current gives false positives func TestDocker_RunContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -121,7 +115,6 @@ func TestDocker_RunContainer_Failure(t *testing.T) { } func TestDocker_SetupContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -138,7 +131,6 @@ func TestDocker_SetupContainer_Success(t *testing.T) { } func TestDocker_SetupContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -151,7 +143,6 @@ func TestDocker_SetupContainer_Failure(t *testing.T) { } func TestDocker_TailContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -173,7 +164,6 @@ func TestDocker_TailContainer_Success(t *testing.T) { // TODO: rethink how the mock is being done in the // router switch. This current gives false positives func TestDocker_TailContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -187,7 +177,6 @@ func TestDocker_TailContainer_Failure(t *testing.T) { } func TestDocker_WaitContainer_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -207,7 +196,6 @@ func TestDocker_WaitContainer_Success(t *testing.T) { } func TestDocker_WaitContainer_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 4ca5db6f..049b675e 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -20,7 +20,7 @@ type client struct { // integrates with a Docker runtime. func New() (*client, error) { // create Docker client from environment - r, err := docker.NewEnvClient() + r, err := docker.NewClientWithOpts(docker.FromEnv) if err != nil { return nil, err } diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 395c429f..4e8b55cc 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -12,7 +12,6 @@ import ( ) func TestDocker_CreateNetwork_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -33,7 +32,6 @@ func TestDocker_CreateNetwork_Success(t *testing.T) { // TODO: rethink how the mock is being done in the // router switch. This current gives false positives func TestDocker_CreateNetwork_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -91,7 +89,6 @@ func TestDocker_InspectNetwork_Failure(t *testing.T) { } func TestDocker_RemoveNetwork_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -110,7 +107,6 @@ func TestDocker_RemoveNetwork_Success(t *testing.T) { } func TestDocker_RemoveNetwork_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index e61ba927..86fb3e2b 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -12,7 +12,6 @@ import ( ) func TestDocker_CreateVolume_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -33,7 +32,6 @@ func TestDocker_CreateVolume_Success(t *testing.T) { // TODO: rethink how the mock is being done in the // router switch. This current gives false positives func TestDocker_CreateVolume_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -91,7 +89,6 @@ func TestDocker_InspectVolume_Failure(t *testing.T) { } func TestDocker_RemoveVolume_Success(t *testing.T) { - // setup Docker c, _ := NewMock() @@ -110,7 +107,6 @@ func TestDocker_RemoveVolume_Success(t *testing.T) { } func TestDocker_RemoveVolume_Failure(t *testing.T) { - // setup Docker c, _ := NewMock() From 2be330ddaf4283c20c897d8de560424a86fabbd6 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 20 Dec 2019 15:08:51 -0600 Subject: [PATCH 058/430] chore: update for v0.2.0 (#48) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6f638eff..c22404f8 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.2.0-rc3 - github.com/go-vela/sdk-go v0.2.0-rc3 - github.com/go-vela/types v0.2.0-rc3 + github.com/go-vela/mock v0.2.0 + github.com/go-vela/sdk-go v0.2.0 + github.com/go-vela/types v0.2.0 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 7e6e54e3..47ca7222 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.2.0-rc3 h1:wp0QUTqa5Oca2jGeHLjzqXhy+YLK53aDNQPYBdPV0hM= -github.com/go-vela/mock v0.2.0-rc3/go.mod h1:iYywX/5idxRZO5z1hLkIv5QWdIU9SqyQoGxsJHup2Wo= -github.com/go-vela/sdk-go v0.2.0-rc3 h1:oqI8tjTh63Znp86TwSS35t4nFRO/hhYHLvH6sBx++oU= -github.com/go-vela/sdk-go v0.2.0-rc3/go.mod h1:32L27+fmV/AzlRzaB11pfsEje8Xfo/74OWZXFZfsTF4= -github.com/go-vela/types v0.2.0-rc3 h1:8huOI7wk35874T1HdwfbK2+AiIhagC3b4WWU6hdrmtE= -github.com/go-vela/types v0.2.0-rc3/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.2.0 h1:LMQPsPGx0ttnfaoAAuooGtWOgCxVUBlWSSl/xdhFbjU= +github.com/go-vela/mock v0.2.0/go.mod h1:Fti8z7+wTfMXkkPFsxjYcE5SzR/NTwdcL7xM5QomQZ4= +github.com/go-vela/sdk-go v0.2.0 h1:00siJNz/IFvq7sCw+2W4CXjVkD/Gz9XS3FXa0dGAxhI= +github.com/go-vela/sdk-go v0.2.0/go.mod h1:K4LCCCPpIm4RlWmyLiNtUCX6G+vjxerv866HD/fIa0Y= +github.com/go-vela/types v0.2.0 h1:VHOlUqCratdthbOpI1l0CLvVEINYqndpqVYVQoPm1Ac= +github.com/go-vela/types v0.2.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= From a5a1e0eef123400bda09cfecdc328e977e5ad303 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 23 Dec 2019 08:57:11 -0600 Subject: [PATCH 059/430] ci(linters): update funlen linter settings (#49) --- .golangci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 16011810..60daee7c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -66,8 +66,8 @@ linters: # - unconvert # This section provides the configuration for each linter -# we've instructed golangci to execute. Currently, we've -# left this part empty as we're going to roll with the -# linter specific default settings for now. -# -# linters-settings: +# we've instructed golangci to execute. +linters-settings: + funlen: + lines: 100 + statements: 60 From 1c585cdad77d9297aa8e0da3797f15eb96ff9171 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 23 Dec 2019 11:21:38 -0600 Subject: [PATCH 060/430] fix(ci): disable CGO for publish action (#50) --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2cc68b6d..7a2e8e78 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: - name: build env: GOOS: linux - CGO_ENABLED: '1' + CGO_ENABLED: '0' run: | go build -a \ -ldflags '-s -w -extldflags "-static"' \ From ae8e6409a2da9b87b2aeb31a5d6f02b27d18c1b8 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 3 Jan 2020 13:45:29 -0600 Subject: [PATCH 061/430] fix: unable to pull shared secrets (#51) * fix: unable to pull shared secrets * fix: swap equalfold to length check * fix: add empty line * fix: use var block --- executor/linux/secret.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 3151e858..706e4f57 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -164,9 +164,11 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { c.logger.Tracef("pulling %s %s secret %s", s.Engine, s.Type, s.Name) // variables necessary for secret - var team string + var ( + team string + org string + ) - org := c.repo.GetOrg() path := s.Key // check if the full path was provided @@ -179,13 +181,13 @@ func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { return nil, fmt.Errorf("path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) } - // check if the org provided matches what we expect - if strings.EqualFold(parts[0], org) { + // check if the org provided is not empty + if len(parts[0]) == 0 { // update the org variable org = parts[0] - // check if the team provided matches what we expect - if strings.EqualFold(parts[1], team) { + // check if the team provided is not empty + if len(parts[1]) == 0 { // update the variables team = parts[1] path = parts[2] From 0d90156eb2b38a9dcbe58b1fb9e26d9c6a62d6ca Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 16 Jan 2020 09:32:45 -0600 Subject: [PATCH 062/430] chore: update copyright for 2020 (#52) * chore: update copyright for 2020 * feat: ignore intellij files and folders --- .github/README.md | 2 +- .gitignore | 12 +++++++++++- Dockerfile | 2 +- Makefile | 2 +- api/build.go | 2 +- api/doc.go | 2 +- api/executor.go | 2 +- api/health.go | 2 +- api/metrics.go | 2 +- api/pipeline.go | 2 +- api/repo.go | 2 +- api/shutdown.go | 2 +- cmd/server/client.go | 2 +- cmd/server/executor.go | 2 +- cmd/server/main.go | 2 +- cmd/server/operate.go | 2 +- cmd/server/queue.go | 2 +- cmd/server/runtime.go | 2 +- cmd/server/server.go | 2 +- cmd/server/validate.go | 2 +- docker-compose.yml | 2 +- executor/context.go | 2 +- executor/doc.go | 2 +- executor/executor.go | 2 +- executor/linux/build.go | 2 +- executor/linux/build_test.go | 2 +- executor/linux/doc.go | 2 +- executor/linux/linux.go | 2 +- executor/linux/linux_test.go | 2 +- executor/linux/secret.go | 2 +- executor/linux/secret_test.go | 2 +- executor/linux/service.go | 2 +- executor/linux/service_test.go | 2 +- executor/linux/stage.go | 2 +- executor/linux/stage_test.go | 2 +- executor/linux/step.go | 2 +- executor/linux/step_test.go | 2 +- queue/context.go | 2 +- queue/doc.go | 2 +- queue/queue.go | 2 +- queue/redis/doc.go | 2 +- queue/redis/pull.go | 2 +- queue/redis/redis.go | 2 +- router/build.go | 2 +- router/doc.go | 2 +- router/executor.go | 2 +- router/middleware/doc.go | 2 +- router/middleware/executor.go | 2 +- router/middleware/executor/context.go | 2 +- router/middleware/executor/context_test.go | 2 +- router/middleware/executor/executor.go | 2 +- router/middleware/executor/executor_test.go | 2 +- router/middleware/header.go | 2 +- router/middleware/header_test.go | 2 +- router/middleware/logger.go | 2 +- router/middleware/logger_test.go | 2 +- router/middleware/payload.go | 2 +- router/middleware/payload_test.go | 2 +- router/middleware/perm/doc.go | 2 +- router/middleware/perm/perm.go | 2 +- router/middleware/perm/perm_test.go | 2 +- router/middleware/secret.go | 2 +- router/middleware/token/doc.go | 2 +- router/middleware/token/token.go | 2 +- router/middleware/token/token_test.go | 2 +- router/middleware/user/context.go | 2 +- router/middleware/user/context_test.go | 2 +- router/middleware/user/doc.go | 2 +- router/middleware/user/user.go | 2 +- router/middleware/user/user_test.go | 2 +- router/pipeline.go | 2 +- router/repo.go | 2 +- router/router.go | 2 +- runtime/context.go | 2 +- runtime/doc.go | 2 +- runtime/docker/container.go | 2 +- runtime/docker/container_test.go | 2 +- runtime/docker/doc.go | 2 +- runtime/docker/docker.go | 2 +- runtime/docker/image.go | 2 +- runtime/docker/image_test.go | 2 +- runtime/docker/network.go | 2 +- runtime/docker/network_test.go | 2 +- runtime/docker/volume.go | 2 +- runtime/docker/volume_test.go | 2 +- runtime/runtime.go | 2 +- version/version.go | 2 +- 87 files changed, 97 insertions(+), 87 deletions(-) diff --git a/.github/README.md b/.github/README.md index b165654f..308bc41b 100644 --- a/.github/README.md +++ b/.github/README.md @@ -33,7 +33,7 @@ Please see our [support](SUPPORT.md) documentation for further instructions. ## Copyright and License ``` -Copyright (c) 2019 Target Brands, Inc. +Copyright (c) 2020 Target Brands, Inc. ``` [![license](https://img.shields.io/crates/l/gl.svg)](LICENSE) diff --git a/.gitignore b/.gitignore index a0697aa3..8bc8c224 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,14 @@ # End of https://www.gitignore.io/api/go -release/* +# Binary release folder +release/ + +# IntelliJ project folder +.idea/ + +# IntelliJ project files +*.iml +*.ipr +*.iws +*.xml diff --git a/Dockerfile b/Dockerfile index ccd6b9cb..75e3ab6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Target Brands, Inc. All rights reserved. +# Copyright (c) 2020 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/Makefile b/Makefile index 615ef596..11e7819a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Target Brands, Inc. All rights reserved. +# Copyright (c) 2020 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/build.go b/api/build.go index e75759cd..aa253ef2 100644 --- a/api/build.go +++ b/api/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/doc.go b/api/doc.go index 85ada95f..48432299 100644 --- a/api/doc.go +++ b/api/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/executor.go b/api/executor.go index a65403d3..03db6c9b 100644 --- a/api/executor.go +++ b/api/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/health.go b/api/health.go index ce71a965..028a1096 100644 --- a/api/health.go +++ b/api/health.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/metrics.go b/api/metrics.go index 41c7d9fa..61d9ffae 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/pipeline.go b/api/pipeline.go index 41e57af6..1b7e0d6f 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/repo.go b/api/repo.go index 530934fc..de9b5c29 100644 --- a/api/repo.go +++ b/api/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/shutdown.go b/api/shutdown.go index f7c109b8..a1a613d6 100644 --- a/api/shutdown.go +++ b/api/shutdown.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/client.go b/cmd/server/client.go index c847b489..5ec6780b 100644 --- a/cmd/server/client.go +++ b/cmd/server/client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/executor.go b/cmd/server/executor.go index 8f392c7e..fac3e077 100644 --- a/cmd/server/executor.go +++ b/cmd/server/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/main.go b/cmd/server/main.go index 5f0cc733..021c28d1 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/operate.go b/cmd/server/operate.go index f1955041..18d5da53 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/queue.go b/cmd/server/queue.go index f30e9624..e73cee2e 100644 --- a/cmd/server/queue.go +++ b/cmd/server/queue.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/runtime.go b/cmd/server/runtime.go index 178a8ad4..8391d885 100644 --- a/cmd/server/runtime.go +++ b/cmd/server/runtime.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/server.go b/cmd/server/server.go index 4e77d4b2..b47c7135 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/server/validate.go b/cmd/server/validate.go index f8ce3fc2..31853529 100644 --- a/cmd/server/validate.go +++ b/cmd/server/validate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/docker-compose.yml b/docker-compose.yml index 21f25743..c88940b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Target Brands, Inc. All rights reserved. +# Copyright (c) 2020 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/context.go b/executor/context.go index 47952533..4d2b7395 100644 --- a/executor/context.go +++ b/executor/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/doc.go b/executor/doc.go index 75ea0e83..d9e46a9a 100644 --- a/executor/doc.go +++ b/executor/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/executor.go b/executor/executor.go index addc61f9..9162fb45 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/build.go b/executor/linux/build.go index 916fb7d7..11c8fc7a 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 48e184a0..6c99d2d3 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/doc.go b/executor/linux/doc.go index 61da9ea3..413879c4 100644 --- a/executor/linux/doc.go +++ b/executor/linux/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/linux.go b/executor/linux/linux.go index c0f98d2c..b5ed2199 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 5b9379d6..443df69b 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 706e4f57..c580e1bd 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index b0eae12b..35fe2417 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/service.go b/executor/linux/service.go index 3ce7ab76..06ba00f9 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 25e3a60c..9f4cb09d 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 568ca5e0..23505694 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 329b0ab6..a3fbdada 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/step.go b/executor/linux/step.go index 495d4c37..df18953f 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index b93182b0..61985140 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/context.go b/queue/context.go index 001a4c77..62175911 100644 --- a/queue/context.go +++ b/queue/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/doc.go b/queue/doc.go index c00a634e..87de9f30 100644 --- a/queue/doc.go +++ b/queue/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/queue.go b/queue/queue.go index 35ebc7e2..5be5baf0 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/redis/doc.go b/queue/redis/doc.go index 617677ce..341b9dcf 100644 --- a/queue/redis/doc.go +++ b/queue/redis/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/redis/pull.go b/queue/redis/pull.go index 21c5709d..1762aebf 100644 --- a/queue/redis/pull.go +++ b/queue/redis/pull.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/queue/redis/redis.go b/queue/redis/redis.go index d54986fe..387c65d5 100644 --- a/queue/redis/redis.go +++ b/queue/redis/redis.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/build.go b/router/build.go index 7280a234..1686006d 100644 --- a/router/build.go +++ b/router/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/doc.go b/router/doc.go index b50c0499..45b5895a 100644 --- a/router/doc.go +++ b/router/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/executor.go b/router/executor.go index 0e9aa8ce..94bbc655 100644 --- a/router/executor.go +++ b/router/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/doc.go b/router/middleware/doc.go index ffa450bc..3f271d2d 100644 --- a/router/middleware/doc.go +++ b/router/middleware/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor.go b/router/middleware/executor.go index 8d5c6e68..78e8b8af 100644 --- a/router/middleware/executor.go +++ b/router/middleware/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/context.go b/router/middleware/executor/context.go index 3fc62ec5..2d801bd8 100644 --- a/router/middleware/executor/context.go +++ b/router/middleware/executor/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/context_test.go b/router/middleware/executor/context_test.go index 8f566a17..b784db52 100644 --- a/router/middleware/executor/context_test.go +++ b/router/middleware/executor/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this executorsitory. diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index 5ad1feb8..92eb9da9 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 63cc2be8..1fdd6c6f 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header.go b/router/middleware/header.go index ada4da39..20dad7d2 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index dd362945..ab83e550 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger.go b/router/middleware/logger.go index a2c52676..e8a38294 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 7f11b804..1a72c3b6 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload.go b/router/middleware/payload.go index 04340b09..2a59b34e 100644 --- a/router/middleware/payload.go +++ b/router/middleware/payload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload_test.go b/router/middleware/payload_test.go index 7423cd4c..b14b37d2 100644 --- a/router/middleware/payload_test.go +++ b/router/middleware/payload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go index 694d86e2..4af9b1c7 100644 --- a/router/middleware/perm/doc.go +++ b/router/middleware/perm/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index 3060fb2f..e5cfe354 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index a24c9ebb..e6eaa319 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/secret.go b/router/middleware/secret.go index 304aaa30..f183e181 100644 --- a/router/middleware/secret.go +++ b/router/middleware/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go index 3c1a6f0e..6c5fce8e 100644 --- a/router/middleware/token/doc.go +++ b/router/middleware/token/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 58902182..e4d2c372 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token_test.go b/router/middleware/token/token_test.go index bdb305b3..6b84d1b7 100644 --- a/router/middleware/token/token_test.go +++ b/router/middleware/token/token_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context.go b/router/middleware/user/context.go index 83261ebf..0863a502 100644 --- a/router/middleware/user/context.go +++ b/router/middleware/user/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go index 5ed27789..478067ad 100644 --- a/router/middleware/user/context_test.go +++ b/router/middleware/user/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go index 8d3ac9e2..148543c0 100644 --- a/router/middleware/user/doc.go +++ b/router/middleware/user/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go index 8a3b9344..096f6fe5 100644 --- a/router/middleware/user/user.go +++ b/router/middleware/user/user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index 1d51ea05..c2617e65 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/pipeline.go b/router/pipeline.go index a513f1d3..2817d0d9 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this pipelinesitory. diff --git a/router/repo.go b/router/repo.go index cf0e6072..1a203b69 100644 --- a/router/repo.go +++ b/router/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/router.go b/router/router.go index db71a18d..1033d3be 100644 --- a/router/router.go +++ b/router/router.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/context.go b/runtime/context.go index d5832ff8..8fdaa85e 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/doc.go b/runtime/doc.go index d7b2b975..a4f2a4cd 100644 --- a/runtime/doc.go +++ b/runtime/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 76cc9187..060f7035 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index b4bd2b0a..46d9ea87 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/doc.go b/runtime/docker/doc.go index ea08a965..5443795e 100644 --- a/runtime/docker/doc.go +++ b/runtime/docker/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 049b675e..3a0b87d4 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 97e56222..8cfd4744 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go index 3973d411..ffc48d28 100644 --- a/runtime/docker/image_test.go +++ b/runtime/docker/image_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 02159011..59de15b6 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 4e8b55cc..5b6d90e6 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index f77e025c..dde74cb1 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 86fb3e2b..e0834d9d 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/runtime.go b/runtime/runtime.go index c89be062..5ffbd4ed 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/version/version.go b/version/version.go index c417f200..ac5fe81f 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Target Brands, Inc. All rights reserved. +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. From 3d587270056947bcdfa24c420cbb0a94d74896cb Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 20 Jan 2020 11:59:41 -0600 Subject: [PATCH 063/430] chore: use full apache license (#53) --- LICENSE | 206 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 196 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index 5af5146f..9242cac4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,15 +1,201 @@ Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (C) 2019 Target Brands, Inc. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + 1. Definitions. - http://www.apache.org/licenses/LICENSE-2.0 + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2020 Target Brands, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 4373d598657693df5c4dd0e18268a9e52cc1073c Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 27 Jan 2020 10:19:32 -0600 Subject: [PATCH 064/430] fix: improper error being sent to user (#54) * fix: improper error being sent to user * fix: improper spelling in log output --- executor/linux/build.go | 108 +++++++++++++++++++--------------------- executor/linux/linux.go | 2 + 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index 11c8fc7a..ae7dbfed 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -22,11 +22,10 @@ import ( // CreateBuild prepares the build for execution. func (c *client) CreateBuild(ctx context.Context) error { - var err error - b := c.build p := c.pipeline r := c.repo + e := c.err // update engine logger with extra metadata c.logger = c.logger.WithFields(logrus.Fields{ @@ -38,18 +37,19 @@ func (c *client) CreateBuild(ctx context.Context) error { // NOTE: When an error occurs during a build that does not have to do // with a pipeline we should set build status to "error" not "failed" // because it is worker related and not build. - if err != nil { - // update the build fields - b.SetFinished(time.Now().UTC().Unix()) + if e != nil { + b.SetError(e.Error()) b.SetStatus(constants.StatusError) - b.SetError(err.Error()) + } - c.logger.Info("uploading errored stated") - // send API call to update the build - _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errored state: %v", err) - } + // update the build fields + b.SetFinished(time.Now().UTC().Unix()) + + c.logger.Info("uploading errorred state") + // send API call to update the build + _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) + if err != nil { + c.logger.Errorf("unable to upload errorred state: %v", err) } }() @@ -63,8 +63,9 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Info("uploading build state") // send API call to update the build - b, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) + b, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) if err != nil { + e = err return fmt.Errorf("unable to upload start state: %w", err) } @@ -77,6 +78,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the step err = c.CreateStep(ctx, init) if err != nil { + e = err return fmt.Errorf("unable to create %s step: %w", init.Name, err) } @@ -84,6 +86,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // plan the step err = c.PlanStep(ctx, init) if err != nil { + e = err return fmt.Errorf("unable to plan %s step: %w", init.Name, err) } } @@ -96,6 +99,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the step err = c.CreateStep(ctx, init) if err != nil { + e = err return fmt.Errorf("unable to create %s step: %w", init.Name, err) } @@ -103,6 +107,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // plan the step err = c.PlanStep(ctx, init) if err != nil { + e = err return fmt.Errorf("unable to plan %s step: %w", init.Name, err) } } @@ -110,6 +115,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // TODO: make this cleaner result, ok := c.steps.Load(init.ID) if !ok { + e = err return fmt.Errorf("unable to get %s step from client", init.Name) } @@ -117,6 +123,7 @@ func (c *client) CreateBuild(ctx context.Context) error { result, ok = c.stepLogs.Load(init.ID) if !ok { + e = err return fmt.Errorf("unable to get %s step log from client", init.Name) } @@ -143,6 +150,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the runtime network for the pipeline err = c.Runtime.CreateNetwork(ctx, p) if err != nil { + e = err return fmt.Errorf("unable to create network: %w", err) } @@ -152,6 +160,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // inspect the runtime network for the pipeline network, err := c.Runtime.InspectNetwork(ctx, p) if err != nil { + e = err return fmt.Errorf("unable to inspect network: %w", err) } @@ -162,6 +171,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the runtime volume for the pipeline err = c.Runtime.CreateVolume(ctx, p) if err != nil { + e = err return fmt.Errorf("unable to create volume: %w", err) } @@ -171,6 +181,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // inspect the runtime volume for the pipeline volume, err := c.Runtime.InspectVolume(ctx, p) if err != nil { + e = err return fmt.Errorf("unable to inspect volume: %w", err) } @@ -199,6 +210,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the service err = c.CreateService(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to create %s service: %w", s.Name, err) } @@ -206,6 +218,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // inspect the service image image, err := c.Runtime.InspectImage(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to inspect %s service: %w", s.Name, err) } @@ -229,6 +242,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the stage err = c.CreateStage(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to create %s stage: %w", s.Name, err) } } @@ -258,6 +272,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // create the step err = c.CreateStep(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to create %s step: %w", s.Name, err) } @@ -265,6 +280,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // inspect the step image image, err := c.Runtime.InspectImage(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to inspect %s step: %w", s.Name, err) } @@ -280,28 +296,28 @@ func (c *client) CreateBuild(ctx context.Context) error { // ExecBuild runs a pipeline for a build. func (c *client) ExecBuild(ctx context.Context) error { - var err error - b := c.build p := c.pipeline r := c.repo + e := c.err defer func() { // NOTE: When an error occurs during a build that does not have to do // with a pipeline we should set build status to "error" not "failed" // because it is worker related and not build. - if err != nil { - // update the build fields - b.SetFinished(time.Now().UTC().Unix()) + if e != nil { + b.SetError(e.Error()) b.SetStatus(constants.StatusError) - b.SetError(err.Error()) + } - c.logger.Info("uploading errored stated") - // send API call to update the build - _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errored state: %w", err) - } + // update the build fields + b.SetFinished(time.Now().UTC().Unix()) + + c.logger.Info("uploading errorred state") + // send API call to update the build + _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) + if err != nil { + c.logger.Errorf("unable to upload errorred state: %v", err) } }() @@ -309,8 +325,9 @@ func (c *client) ExecBuild(ctx context.Context) error { for _, s := range p.Services { c.logger.Infof("planning %s service", s.Name) // plan the service - err = c.PlanService(ctx, s) + err := c.PlanService(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to plan service: %w", err) } @@ -318,6 +335,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // execute the service err = c.ExecService(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to execute service: %w", err) } } @@ -337,8 +355,9 @@ func (c *client) ExecBuild(ctx context.Context) error { c.logger.Infof("planning %s step", s.Name) // plan the step - err = c.PlanStep(ctx, s) + err := c.PlanStep(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to plan step: %w", err) } @@ -346,11 +365,13 @@ func (c *client) ExecBuild(ctx context.Context) error { // execute the step err = c.ExecStep(ctx, s) if err != nil { + e = err return fmt.Errorf("unable to execute step: %w", err) } result, ok := c.steps.Load(s.ID) if !ok { + e = err return fmt.Errorf("unable to get step from client") } @@ -401,6 +422,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // execute the stage err := c.ExecStage(stageCtx, stage, stageMap) if err != nil { + e = err return fmt.Errorf("unable to execute stage: %w", err) } @@ -410,17 +432,10 @@ func (c *client) ExecBuild(ctx context.Context) error { c.logger.Debug("waiting for stages completion") // wait for the stages to complete or return an error - err = stages.Wait() + err := stages.Wait() if err != nil { - return err - } - - b.SetFinished(time.Now().UTC().Unix()) - c.logger.Info("uploading build state") - // send API call to update the build - _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - return fmt.Errorf("unable to upload final state: %v", err) + e = err + return fmt.Errorf("unable to wait for stages: %v", err) } return nil @@ -434,25 +449,6 @@ func (c *client) DestroyBuild(ctx context.Context) error { p := c.pipeline r := c.repo - defer func() { - // NOTE: When an error occurs during a build that does not have to do - // with a pipeline we should set build status to "error" not "failed" - // because it is worker related and not build. - if err != nil { - // update the build fields - b.SetFinished(time.Now().UTC().Unix()) - b.SetStatus(constants.StatusError) - b.SetError(err.Error()) - - c.logger.Info("uploading errored stated") - // send API call to update the build - _, _, err = c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errored state: %w", err) - } - } - }() - // destroy the steps for the pipeline for _, s := range p.Steps { // TODO: remove hardcoded reference diff --git a/executor/linux/linux.go b/executor/linux/linux.go index b5ed2199..dce505a0 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -34,6 +34,7 @@ type client struct { steps sync.Map stepLogs sync.Map user *library.User + err error } // New returns an Executor implementation that integrates with a Linux instance. @@ -65,6 +66,7 @@ func New(c *vela.Client, r runtime.Engine) (*client, error) { serviceLogs: sync.Map{}, steps: sync.Map{}, stepLogs: sync.Map{}, + err: nil, }, nil } From ec9e16028b3bde736353cb51d1a98b73a879d3c6 Mon Sep 17 00:00:00 2001 From: Neal Date: Tue, 28 Jan 2020 10:48:39 -0600 Subject: [PATCH 065/430] refactor: work directory set moved to compiler (#55) --- executor/linux/build.go | 4 ++-- executor/linux/step.go | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index ae7dbfed..e85a52ce 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -45,7 +45,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // update the build fields b.SetFinished(time.Now().UTC().Unix()) - c.logger.Info("uploading errorred state") + c.logger.Info("uploading build state") // send API call to update the build _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) if err != nil { @@ -313,7 +313,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // update the build fields b.SetFinished(time.Now().UTC().Unix()) - c.logger.Info("uploading errorred state") + c.logger.Info("uploading build state") // send API call to update the build _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) if err != nil { diff --git a/executor/linux/step.go b/executor/linux/step.go index df18953f..bf93d92d 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -30,11 +30,6 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error "step": ctn.Name, }) - // inject default workspace - if len(ctn.Directory) == 0 { - ctn.Directory = fmt.Sprintf("/home/%s", c.pipeline.ID) - } - ctn.Environment["BUILD_HOST"] = c.Hostname ctn.Environment["VELA_HOST"] = c.Hostname ctn.Environment["VELA_VERSION"] = version.Version.String() From 0bfb88eaf6f0ce131fe5c93c4ce9842a88bcbcc3 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 5 Feb 2020 08:18:02 -0600 Subject: [PATCH 066/430] chore: update dependencies for v0.3.0-rc1 (#56) * chore: update dependencies for v0.3.0-rc1 * chore: update tests for 0.3.0 --- go.mod | 6 +++--- go.sum | 12 ++++++------ router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index c22404f8..afb40ce6 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.2.0 - github.com/go-vela/sdk-go v0.2.0 - github.com/go-vela/types v0.2.0 + github.com/go-vela/mock v0.3.0-rc1 + github.com/go-vela/sdk-go v0.3.0-rc1 + github.com/go-vela/types v0.3.0-rc1 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 47ca7222..7088e001 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.2.0 h1:LMQPsPGx0ttnfaoAAuooGtWOgCxVUBlWSSl/xdhFbjU= -github.com/go-vela/mock v0.2.0/go.mod h1:Fti8z7+wTfMXkkPFsxjYcE5SzR/NTwdcL7xM5QomQZ4= -github.com/go-vela/sdk-go v0.2.0 h1:00siJNz/IFvq7sCw+2W4CXjVkD/Gz9XS3FXa0dGAxhI= -github.com/go-vela/sdk-go v0.2.0/go.mod h1:K4LCCCPpIm4RlWmyLiNtUCX6G+vjxerv866HD/fIa0Y= -github.com/go-vela/types v0.2.0 h1:VHOlUqCratdthbOpI1l0CLvVEINYqndpqVYVQoPm1Ac= -github.com/go-vela/types v0.2.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.3.0-rc1 h1:BAYJHIRQp7NhoE9tCwbjWjyEaREAOd4X55mwwOFppVs= +github.com/go-vela/mock v0.3.0-rc1/go.mod h1:0l7AAinXhvfNiumsqM01+JByguCRjAjqkg4s9hIcQjk= +github.com/go-vela/sdk-go v0.3.0-rc1 h1:q7temqHqg6jPJeNcy3BeaBz+jyP/XQxjCDDDMfwLlRc= +github.com/go-vela/sdk-go v0.3.0-rc1/go.mod h1:+kcwCE66diYutQeecoS1rpbJH392Xr1ecKr6JA2JwdY= +github.com/go-vela/types v0.3.0-rc1 h1:iw/psQeGTdAaQlJvNsRh8YLrMh26dDC8fegeHSqTHmM= +github.com/go-vela/types v0.3.0-rc1/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index ab83e550..c34f51ab 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -268,7 +268,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.2.0" + wantVersion := "0.3.0" // setup context gin.SetMode(gin.TestMode) @@ -299,7 +299,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.2.0" + wantVersion := "0.3.0" // setup context gin.SetMode(gin.TestMode) @@ -330,7 +330,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.2.0" + wantVersion := "0.3.0" // setup context gin.SetMode(gin.TestMode) @@ -361,7 +361,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.2.0" + wantVersion := "0.3.0" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index ac5fe81f..d3227798 100644 --- a/version/version.go +++ b/version/version.go @@ -10,7 +10,7 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor int64 = 2 + VersionMinor int64 = 3 // VersionPatch is for backwards-compatible bug fixes VersionPatch int64 // VersionDev indicates drone build number. Releases will be empty string. From 0eb9f2478ede4cc9d86d197e3a6256d8ec5ec1e6 Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 13 Feb 2020 10:11:59 -0600 Subject: [PATCH 067/430] chore: update go-vela dependencies (#58) * refactor: work directory set moved to compiler * chore: update go-vela dependencies --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index afb40ce6..a3ee85f3 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.3.0-rc1 - github.com/go-vela/sdk-go v0.3.0-rc1 - github.com/go-vela/types v0.3.0-rc1 + github.com/go-vela/mock v0.3.0-rc2 + github.com/go-vela/sdk-go v0.3.0-rc2 + github.com/go-vela/types v0.3.0-rc2 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 7088e001..611422ca 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.3.0-rc1 h1:BAYJHIRQp7NhoE9tCwbjWjyEaREAOd4X55mwwOFppVs= -github.com/go-vela/mock v0.3.0-rc1/go.mod h1:0l7AAinXhvfNiumsqM01+JByguCRjAjqkg4s9hIcQjk= -github.com/go-vela/sdk-go v0.3.0-rc1 h1:q7temqHqg6jPJeNcy3BeaBz+jyP/XQxjCDDDMfwLlRc= -github.com/go-vela/sdk-go v0.3.0-rc1/go.mod h1:+kcwCE66diYutQeecoS1rpbJH392Xr1ecKr6JA2JwdY= -github.com/go-vela/types v0.3.0-rc1 h1:iw/psQeGTdAaQlJvNsRh8YLrMh26dDC8fegeHSqTHmM= -github.com/go-vela/types v0.3.0-rc1/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.3.0-rc2 h1:90b8MKUJOj2oHGRNOZ53RmCBd15W2hbgiOo/uKdpNUM= +github.com/go-vela/mock v0.3.0-rc2/go.mod h1:x6uxv4fHHjMzDlL/tkjrxPRhX/mPcMhIcWmDc5DrF8I= +github.com/go-vela/sdk-go v0.3.0-rc2 h1:qWvRAWm6lIlKHBEYleT+mGMvuLUCNGEPu0U5UXSdW64= +github.com/go-vela/sdk-go v0.3.0-rc2/go.mod h1:nfqbi55a8h8EvwiHaJVWCwlmZEX1hE/6k25twbzjgus= +github.com/go-vela/types v0.3.0-rc2 h1:FrDTX01K+2M6ertsv9GUAP76YWQANdcrA2N6oBIRX+E= +github.com/go-vela/types v0.3.0-rc2/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= From d61e8548fec809d6fb51bde7eae33e934843b16c Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 17 Feb 2020 09:06:50 -0600 Subject: [PATCH 068/430] fix: properly update success status (#59) * refactor: work directory set moved to compiler * chore: update go-vela dependencies * fix: properly update success status --- executor/linux/build.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index e85a52ce..cfb6eff5 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -42,9 +42,6 @@ func (c *client) CreateBuild(ctx context.Context) error { b.SetStatus(constants.StatusError) } - // update the build fields - b.SetFinished(time.Now().UTC().Unix()) - c.logger.Info("uploading build state") // send API call to update the build _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) @@ -69,6 +66,8 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to upload start state: %w", err) } + c.build = b + // TODO: make this better init := new(pipeline.Container) if len(p.Steps) > 0 { @@ -288,9 +287,6 @@ func (c *client) CreateBuild(ctx context.Context) error { l.SetData(append(l.GetData(), image...)) } - b.SetStatus(constants.StatusSuccess) - c.build = b - return nil } @@ -301,6 +297,9 @@ func (c *client) ExecBuild(ctx context.Context) error { r := c.repo e := c.err + b.SetStatus(constants.StatusSuccess) + c.build = b + defer func() { // NOTE: When an error occurs during a build that does not have to do // with a pipeline we should set build status to "error" not "failed" From e9df5bf5a584c5fe026e0324be86577b8e3336fe Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 17 Feb 2020 11:58:24 -0600 Subject: [PATCH 069/430] fix: move secret pull inside executor (#60) * refactor: work directory set moved to compiler * chore: update go-vela dependencies * fix: properly update success status * fix: move secret pull inside executor --- cmd/server/operate.go | 8 -------- executor/linux/build.go | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmd/server/operate.go b/cmd/server/operate.go index 18d5da53..ddb74897 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -74,14 +74,6 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e } }() - logger.Info("pulling secrets") - // pull secrets for the build on the executor - err = executor.PullSecret(ctx) - if err != nil { - logger.Errorf("unable to pull secrets: %v", err) - return err - } - defer func() { // destroying the build on the executor logger.Info("destroying build") diff --git a/executor/linux/build.go b/executor/linux/build.go index cfb6eff5..2d3ffd9e 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -68,6 +68,15 @@ func (c *client) CreateBuild(ctx context.Context) error { c.build = b + // TODO: Pull this out into a the plan function for steps. + c.logger.Info("pulling secrets") + // pull secrets for the build + err = c.PullSecret(ctx) + if err != nil { + e = err + return fmt.Errorf("unable to pull secrets: %v", err) + } + // TODO: make this better init := new(pipeline.Container) if len(p.Steps) > 0 { From 90a8920eb89e8265f63fdf690ea3b0c993976c53 Mon Sep 17 00:00:00 2001 From: Neal Date: Tue, 18 Feb 2020 11:56:02 -0600 Subject: [PATCH 070/430] chore: updates for v0.3.0-rc3 (#61) * refactor: work directory set moved to compiler * chore: updates for v0.3.0-rc3 --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index a3ee85f3..c9889cd0 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.3.0-rc2 - github.com/go-vela/sdk-go v0.3.0-rc2 - github.com/go-vela/types v0.3.0-rc2 + github.com/go-vela/mock v0.3.0-rc3 + github.com/go-vela/sdk-go v0.3.0-rc3 + github.com/go-vela/types v0.3.0-rc3 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 611422ca..8cf4aca9 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.3.0-rc2 h1:90b8MKUJOj2oHGRNOZ53RmCBd15W2hbgiOo/uKdpNUM= -github.com/go-vela/mock v0.3.0-rc2/go.mod h1:x6uxv4fHHjMzDlL/tkjrxPRhX/mPcMhIcWmDc5DrF8I= -github.com/go-vela/sdk-go v0.3.0-rc2 h1:qWvRAWm6lIlKHBEYleT+mGMvuLUCNGEPu0U5UXSdW64= -github.com/go-vela/sdk-go v0.3.0-rc2/go.mod h1:nfqbi55a8h8EvwiHaJVWCwlmZEX1hE/6k25twbzjgus= -github.com/go-vela/types v0.3.0-rc2 h1:FrDTX01K+2M6ertsv9GUAP76YWQANdcrA2N6oBIRX+E= -github.com/go-vela/types v0.3.0-rc2/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.3.0-rc3 h1:n00oCFiA+B9JmieagnxUerGW8k4vz8xuTl2WPDVNFVg= +github.com/go-vela/mock v0.3.0-rc3/go.mod h1:jAFAvaKP4xLZCjYk2PKQSQC4/YBQ3K6tloOsp7rOCqA= +github.com/go-vela/sdk-go v0.3.0-rc3 h1:Q1cv4pcj3RQR3rhhuqKHBnhypLJ7J+nQ59LCoRZ5zHo= +github.com/go-vela/sdk-go v0.3.0-rc3/go.mod h1:v/VShjEWqcN4EyLXDQHO5rwEXl4htbnZn4mn3nGa4eg= +github.com/go-vela/types v0.3.0-rc3 h1:G7+eKZBjN1cCvAKC2LzoDIDkmooLFfUoQPwt/7fT9AM= +github.com/go-vela/types v0.3.0-rc3/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= From 1651a63a548f28c8a7b7d081190472ea3eea0243 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 21 Feb 2020 10:53:24 -0600 Subject: [PATCH 071/430] update deps for v0.3.0 (#62) * refactor: work directory set moved to compiler * chore: updates for v0.3.0-rc3 * update deps for v0.3.0 --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index c9889cd0..55a3e475 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible - github.com/go-vela/mock v0.3.0-rc3 - github.com/go-vela/sdk-go v0.3.0-rc3 - github.com/go-vela/types v0.3.0-rc3 + github.com/go-vela/mock v0.3.0 + github.com/go-vela/sdk-go v0.3.0 + github.com/go-vela/types v0.3.0 github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.3.1 github.com/gorilla/mux v1.7.3 // indirect diff --git a/go.sum b/go.sum index 8cf4aca9..40094914 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,12 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.3.0-rc3 h1:n00oCFiA+B9JmieagnxUerGW8k4vz8xuTl2WPDVNFVg= -github.com/go-vela/mock v0.3.0-rc3/go.mod h1:jAFAvaKP4xLZCjYk2PKQSQC4/YBQ3K6tloOsp7rOCqA= -github.com/go-vela/sdk-go v0.3.0-rc3 h1:Q1cv4pcj3RQR3rhhuqKHBnhypLJ7J+nQ59LCoRZ5zHo= -github.com/go-vela/sdk-go v0.3.0-rc3/go.mod h1:v/VShjEWqcN4EyLXDQHO5rwEXl4htbnZn4mn3nGa4eg= -github.com/go-vela/types v0.3.0-rc3 h1:G7+eKZBjN1cCvAKC2LzoDIDkmooLFfUoQPwt/7fT9AM= -github.com/go-vela/types v0.3.0-rc3/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= +github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= +github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= +github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= +github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= +github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= From 83d2ebd3cc6263a56de6e59cba77de04538f1c15 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 27 Feb 2020 11:32:29 -0600 Subject: [PATCH 072/430] fix: cleanup of build resources (#64) --- cmd/server/operate.go | 9 ++++++++- executor/linux/build.go | 12 ++++++------ runtime/docker/container.go | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/cmd/server/operate.go b/cmd/server/operate.go index ddb74897..4f9c6898 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -75,7 +75,7 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e }() defer func() { - // destroying the build on the executor + // destroy the build on the executor logger.Info("destroying build") err = executor.DestroyBuild(context.Background()) if err != nil { @@ -99,6 +99,13 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e return err } + // destroy the build on the executor + logger.Info("destroying build") + err = executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + logger.Info("completed build") } }) diff --git a/executor/linux/build.go b/executor/linux/build.go index 2d3ffd9e..3bc0b7df 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -468,7 +468,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the step err = c.DestroyStep(ctx, s) if err != nil { - c.logger.Errorf("unable to destroy step: %w", err) + c.logger.Errorf("unable to destroy step: %v", err) } } @@ -483,7 +483,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the stage err = c.DestroyStage(ctx, s) if err != nil { - c.logger.Errorf("unable to destroy stage: %w", err) + c.logger.Errorf("unable to destroy stage: %v", err) } } @@ -493,7 +493,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { // destroy the service err = c.DestroyService(ctx, s) if err != nil { - c.logger.Errorf("unable to destroy service: %w", err) + c.logger.Errorf("unable to destroy service: %v", err) } c.logger.Infof("uploading %s service state", s.Name) @@ -510,7 +510,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cService) if err != nil { - c.logger.Errorf("unable to upload service status: %w", err) + c.logger.Errorf("unable to upload service status: %v", err) } } @@ -518,14 +518,14 @@ func (c *client) DestroyBuild(ctx context.Context) error { // remove the runtime volume for the pipeline err = c.Runtime.RemoveVolume(ctx, p) if err != nil { - c.logger.Errorf("unable to remove volume: %w", err) + c.logger.Errorf("unable to remove volume: %v", err) } c.logger.Info("deleting network") // remove the runtime network for the pipeline err = c.Runtime.RemoveNetwork(ctx, p) if err != nil { - c.logger.Errorf("unable to remove network: %w", err) + c.logger.Errorf("unable to remove network: %v", err) } return err diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 060f7035..705e27a1 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -236,7 +236,7 @@ func ctnConfig(ctn *pipeline.Container) *container.Config { // parse image from container image, err := parseImage(ctn.Image) if err != nil { - logrus.Errorf("unable to parse image: %w", err) + logrus.Errorf("unable to parse image: %v", err) } // create container config object From 6e2548693e8b462e6106253db6ced2cf58154f81 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 11 Mar 2020 14:17:53 -0500 Subject: [PATCH 073/430] feat: use new runtime pkg (#65) * feat: use new runtime pkg * build: use trace level logging in compose * fix: typo in spacing for license * docs: move license badge to top of readme * fix: imports to new runtime pkg * refactor: fix linter errors --- .github/README.md | 3 +- LICENSE | 2 +- cmd/server/executor.go | 24 +- cmd/server/main.go | 24 +- cmd/server/runtime.go | 44 ---- cmd/server/server.go | 12 +- cmd/server/validate.go | 17 -- docker-compose.yml | 4 +- executor/linux/build_test.go | 3 +- executor/linux/linux.go | 5 +- executor/linux/linux_test.go | 4 +- executor/linux/secret_test.go | 7 +- executor/linux/service_test.go | 6 +- executor/linux/stage_test.go | 6 +- executor/linux/step_test.go | 3 +- go.mod | 24 +- go.sum | 139 ++++++++++ runtime/context.go | 42 --- runtime/doc.go | 12 - runtime/docker/container.go | 295 ---------------------- runtime/docker/container_test.go | 208 --------------- runtime/docker/doc.go | 11 - runtime/docker/docker.go | 60 ----- runtime/docker/image.go | 47 ---- runtime/docker/image_test.go | 75 ------ runtime/docker/network.go | 77 ------ runtime/docker/network_test.go | 119 --------- runtime/docker/testdata/mock/container.go | 165 ------------ runtime/docker/testdata/mock/docker.go | 113 --------- runtime/docker/testdata/mock/images.go | 135 ---------- runtime/docker/testdata/mock/network.go | 106 -------- runtime/docker/testdata/mock/volume.go | 90 ------- runtime/docker/volume.go | 58 ----- runtime/docker/volume_test.go | 119 --------- runtime/runtime.go | 68 ----- 35 files changed, 213 insertions(+), 1914 deletions(-) delete mode 100644 cmd/server/runtime.go delete mode 100644 runtime/context.go delete mode 100644 runtime/doc.go delete mode 100644 runtime/docker/container.go delete mode 100644 runtime/docker/container_test.go delete mode 100644 runtime/docker/doc.go delete mode 100644 runtime/docker/docker.go delete mode 100644 runtime/docker/image.go delete mode 100644 runtime/docker/image_test.go delete mode 100644 runtime/docker/network.go delete mode 100644 runtime/docker/network_test.go delete mode 100644 runtime/docker/testdata/mock/container.go delete mode 100644 runtime/docker/testdata/mock/docker.go delete mode 100644 runtime/docker/testdata/mock/images.go delete mode 100644 runtime/docker/testdata/mock/network.go delete mode 100644 runtime/docker/testdata/mock/volume.go delete mode 100644 runtime/docker/volume.go delete mode 100644 runtime/docker/volume_test.go delete mode 100644 runtime/runtime.go diff --git a/.github/README.md b/.github/README.md index 308bc41b..c079e0bb 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,5 +1,6 @@ # worker +[![license](https://img.shields.io/crates/l/gl.svg)](LICENSE) [![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) [![codecov](https://codecov.io/gh/go-vela/worker/branch/master/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) @@ -36,4 +37,4 @@ Please see our [support](SUPPORT.md) documentation for further instructions. Copyright (c) 2020 Target Brands, Inc. ``` -[![license](https://img.shields.io/crates/l/gl.svg)](LICENSE) +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/LICENSE b/LICENSE index 9242cac4..1108a527 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/cmd/server/executor.go b/cmd/server/executor.go index fac3e077..bc3627f6 100644 --- a/cmd/server/executor.go +++ b/cmd/server/executor.go @@ -7,12 +7,14 @@ package main import ( "fmt" + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/executor/linux" - "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" @@ -20,37 +22,37 @@ import ( ) // helper function to setup the queue from the CLI arguments. -func setupExecutor(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { +func setupExecutor(c *cli.Context, client *vela.Client, r runtime.Engine) (executor.Engine, error) { logrus.Debug("Creating executor clients from CLI configuration") switch c.String("executor-driver") { case constants.DriverDarwin: - return setupDarwin(c, client, runtime) + return setupDarwin(client, r) case constants.DriverLinux: - return setupLinux(c, client, runtime) + return setupLinux(client, r) case constants.DriverWindows: - return setupWindows(c, client, runtime) + return setupWindows(client, r) default: return nil, fmt.Errorf("invalid executor driver: %s", c.String("executor-driver")) } } // helper function to setup the Darwin executor from the CLI arguments. -func setupDarwin(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { +func setupDarwin(client *vela.Client, r runtime.Engine) (executor.Engine, error) { logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverDarwin) - // return darwin.New(client, runtime) + // return darwin.New(client, r) return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverDarwin) } // helper function to setup the Linux executor from the CLI arguments. -func setupLinux(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { +func setupLinux(client *vela.Client, r runtime.Engine) (executor.Engine, error) { logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverLinux) - return linux.New(client, runtime) + return linux.New(client, r) } // helper function to setup the Windows executor from the CLI arguments. -func setupWindows(c *cli.Context, client *vela.Client, runtime runtime.Engine) (executor.Engine, error) { +func setupWindows(client *vela.Client, r runtime.Engine) (executor.Engine, error) { logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverWindows) - // return windows.New(client, runtime) + // return windows.New(client, r) return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverWindows) } diff --git a/cmd/server/main.go b/cmd/server/main.go index 021c28d1..f0c664b8 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -10,7 +10,7 @@ import ( "github.com/go-vela/worker/version" - log "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -88,17 +88,29 @@ func main() { }, // Runtime Flags + cli.StringFlag{ EnvVar: "VELA_RUNTIME_DRIVER,RUNTIME_DRIVER", - Name: "runtime-driver", - Usage: "runtime driver", + Name: "runtime.driver", + Usage: "name of runtime driver to use", + }, + cli.StringFlag{ + EnvVar: "VELA_RUNTIME_CONFIG,RUNTIME_CONFIG", + Name: "runtime.config", + Usage: "path to runtime configuration file", + }, + cli.StringFlag{ + EnvVar: "VELA_RUNTIME_NAMESPACE,RUNTIME_NAMESPACE", + Name: "runtime.namespace", + Usage: "name of namespace for runtime configuration (kubernetes runtime only)", }, } // set logrus to log in JSON format - log.SetFormatter(&log.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{}) - if err := app.Run(os.Args); err != nil { - log.Fatal(err) + err := app.Run(os.Args) + if err != nil { + logrus.Fatal(err) } } diff --git a/cmd/server/runtime.go b/cmd/server/runtime.go deleted file mode 100644 index 8391d885..00000000 --- a/cmd/server/runtime.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package main - -import ( - "fmt" - - "github.com/go-vela/types/constants" - - "github.com/go-vela/worker/runtime" - "github.com/go-vela/worker/runtime/docker" - - "github.com/sirupsen/logrus" - "github.com/urfave/cli" -) - -// helper function to setup the runtime from the CLI arguments. -func setupRuntime(c *cli.Context) (runtime.Engine, error) { - logrus.Debug("Creating runtime client from CLI configuration") - - switch c.String("runtime-driver") { - case constants.DriverDocker: - return setupDocker(c) - case constants.DriverKubernetes: - return setupKubernetes(c) - default: - return nil, fmt.Errorf("invalid runtime driver: %s", c.String("runtime-driver")) - } -} - -// helper function to setup the Docker runtime from the CLI arguments. -func setupDocker(c *cli.Context) (runtime.Engine, error) { - logrus.Tracef("Creating %s runtime client from CLI configuration", constants.DriverDocker) - return docker.New() -} - -// helper function to setup the Docker runtime from the CLI arguments. -func setupKubernetes(c *cli.Context) (runtime.Engine, error) { - logrus.Tracef("Creating %s runtime client from CLI configuration", constants.DriverKubernetes) - // return kubernetes.New() - return nil, fmt.Errorf("unsupported runtime driver: %s", constants.DriverKubernetes) -} diff --git a/cmd/server/server.go b/cmd/server/server.go index b47c7135..5f308e2f 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -9,6 +9,8 @@ import ( "net/http" "time" + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/executor" "github.com/go-vela/worker/router" "github.com/go-vela/worker/router/middleware" @@ -58,8 +60,12 @@ func server(c *cli.Context) error { return err } - // create a runtime client - runtime, err := setupRuntime(c) + // create the runtime client + r, err := runtime.New(&runtime.Setup{ + Driver: c.String("runtime.driver"), + Config: c.String("runtime.config"), + Namespace: c.String("runtime.namespace"), + }) if err != nil { return err } @@ -74,7 +80,7 @@ func server(c *cli.Context) error { executors := make(map[int]executor.Engine) for i := 0; i < c.Int("executor-threads"); i++ { - executor, err := setupExecutor(c, vela, runtime) + executor, err := setupExecutor(c, vela, r) if err != nil { return err } diff --git a/cmd/server/validate.go b/cmd/server/validate.go index 31853529..24b813b1 100644 --- a/cmd/server/validate.go +++ b/cmd/server/validate.go @@ -34,12 +34,6 @@ func validate(c *cli.Context) error { return err } - // validate runtime configuration - err = validateRuntime(c) - if err != nil { - return err - } - return nil } @@ -95,14 +89,3 @@ func validateQueue(c *cli.Context) error { return nil } - -// helper function to validate the runtime CLI configuration. -func validateRuntime(c *cli.Context) error { - logrus.Trace("Validating runtime CLI configuration") - - if len(c.String("runtime-driver")) == 0 { - return fmt.Errorf("runtime-driver (VELA_RUNTIME_DRIVER or RUNTIME_DRIVER) flag not specified") - } - - return nil -} diff --git a/docker-compose.yml b/docker-compose.yml index c88940b8..13760606 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: environment: VELA_ADDR: http://vela:8080 VELA_EXECUTOR_THREADS: 1 - VELA_LOG_LEVEL: debug + VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker @@ -37,7 +37,7 @@ services: environment: VELA_ADDR: http://vela:8080 VELA_EXECUTOR_THREADS: 1 - VELA_LOG_LEVEL: debug + VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 VELA_QUEUE_WORKER_ROUTES: small,docker,small:docker diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 6c99d2d3..b2d1c9a7 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -10,7 +10,8 @@ import ( "testing" "github.com/go-vela/mock/server" - "github.com/go-vela/worker/runtime/docker" + + "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/linux.go b/executor/linux/linux.go index dce505a0..0d99b746 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -11,10 +11,13 @@ import ( "github.com/go-vela/worker/executor" + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime" + "github.com/sirupsen/logrus" ) diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 443df69b..7ce0170f 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -8,10 +8,12 @@ import ( "reflect" "testing" + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime/docker" ) func TestLinux_WithBuild(t *testing.T) { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 35fe2417..6ee41e8a 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -10,11 +10,16 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime/docker" + "github.com/google/go-cmp/cmp" ) diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 9f4cb09d..ab27c77e 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -10,11 +10,15 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime/docker" ) func TestExecutor_CreateService_Success(t *testing.T) { diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index a3fbdada..f3fc0f5d 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -10,11 +10,15 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime/docker" ) func TestExecutor_CreateStage_Success(t *testing.T) { diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 61985140..7e9a7240 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -10,7 +10,8 @@ import ( "testing" "github.com/go-vela/mock/server" - "github.com/go-vela/worker/runtime/docker" + + "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/go.mod b/go.mod index 55a3e475..89d2687b 100644 --- a/go.mod +++ b/go.mod @@ -3,44 +3,24 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect - github.com/Microsoft/go-winio v0.4.14 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/docker/distribution v2.7.1+incompatible - github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.4.0 // indirect github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.3.0 + github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f github.com/go-vela/sdk-go v0.3.0 - github.com/go-vela/types v0.3.0 - github.com/gogo/protobuf v1.3.1 // indirect + github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 github.com/google/go-cmp v0.3.1 - github.com/gorilla/mux v1.7.3 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/kr/pretty v0.1.0 // indirect github.com/mattn/go-isatty v0.0.11 // indirect - github.com/morikuni/aec v1.0.0 // indirect github.com/onsi/ginkgo v1.10.3 // indirect github.com/onsi/gomega v1.7.1 // indirect - github.com/opencontainers/go-digest v1.0.0-rc1 // indirect - github.com/opencontainers/image-spec v1.0.1 // indirect github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect github.com/prometheus/procfs v0.0.8 // indirect github.com/sirupsen/logrus v1.4.2 github.com/urfave/cli v1.22.2 - golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e - golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 // indirect - golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f // indirect - google.golang.org/grpc v1.25.1 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 - gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index 40094914..1063238b 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,26 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -25,9 +42,11 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSY github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 h1:w3NnFcKR5241cfmQU5ZZAsf0xcpId6mWOupTvJlUX2U= @@ -36,12 +55,18 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= @@ -50,6 +75,11 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -61,39 +91,72 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-vela/compiler v0.3.1-0.20200302143952-6a5a26ba1fbc/go.mod h1:rO03l8MoeyQkhd450SnphZquB7l7Qs+cT/3BIVq8MfE= github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= +github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f h1:YjvfuA6UXz4Yqiy0QtRgCq0Wepznk4YsC52niCsWzeQ= +github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f/go.mod h1:J2xYqm8CgZpqQUojPWuLnYgJWS6hknr5rgZst9qKP84= github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 h1:5+2BLMClLg+o6mky5G0xRTfw/15zOyyZhJKWp726vu4= +github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/uuid v1.1.1/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +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= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= +github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -113,33 +176,46 @@ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -169,8 +245,13 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +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/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -182,37 +263,59 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -220,22 +323,34 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -246,6 +361,7 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= @@ -256,6 +372,8 @@ gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvR gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8CTwkU4pnOs= gopkg.in/go-playground/validator.v9 v9.30.2/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= @@ -266,7 +384,28 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.17.3 h1:XAm3PZp3wnEdzekNkcmj/9Y1zdmQYJ1I4GKSBBZ8aG0= +k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= +k8s.io/apimachinery v0.17.3 h1:f+uZV6rm4/tHE7xXgLyToprg6xWairaClGVkm2t8omg= +k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= +k8s.io/client-go v0.17.3 h1:deUna1Ksx05XeESH6XGCyONNFfiQmDdqeqUvicvP6nU= +k8s.io/client-go v0.17.3/go.mod h1:cLXlTMtWHkuK4tD360KpWz2gG2KtdWEr/OT02i3emRQ= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= +k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/runtime/context.go b/runtime/context.go deleted file mode 100644 index 8fdaa85e..00000000 --- a/runtime/context.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package runtime - -import ( - "context" -) - -// key defines the key type for storing -// the runtime Engine in the context. -const key = "runtime" - -// Setter defines a context that enables setting values. -type Setter interface { - Set(string, interface{}) -} - -// FromContext returns the runtime Engine -// associated with this context. -func FromContext(c context.Context) Engine { - // get runtime value from context - v := c.Value(key) - if v == nil { - return nil - } - - // cast runtime value to expected Engine type - r, ok := v.(Engine) - if !ok { - return nil - } - - return r -} - -// ToContext adds the runtime Engine to this -// context if it supports the Setter interface. -func ToContext(c Setter, r Engine) { - c.Set(key, r) -} diff --git a/runtime/doc.go b/runtime/doc.go deleted file mode 100644 index a4f2a4cd..00000000 --- a/runtime/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package runtime provides the ability for Vela to -// integrate with different supported Runtime -// environments. -// -// Usage: -// -// import "github.com/go-vela/worker/runtime" -package runtime diff --git a/runtime/docker/container.go b/runtime/docker/container.go deleted file mode 100644 index 705e27a1..00000000 --- a/runtime/docker/container.go +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - "fmt" - "io" - "os" - - "github.com/go-vela/types/pipeline" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" - docker "github.com/docker/docker/client" - "github.com/docker/docker/pkg/stdcopy" - - "github.com/sirupsen/logrus" -) - -// InspectContainer inspects the pipeline container. -func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("Inspecting container for step %s", ctn.ID) - - // send API call to inspect the container - container, err := c.Runtime.ContainerInspect(ctx, ctn.ID) - if err != nil { - return err - } - - // set the exit code - ctn.ExitCode = container.State.ExitCode - - return nil -} - -// RemoveContainer deletes (kill, remove) the pipeline container. -func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("Removing container for step %s", ctn.ID) - - // send API call to inspect the container - container, err := c.Runtime.ContainerInspect(ctx, ctn.ID) - if err != nil { - return err - } - - // if the container is paused, restarting or running - if container.State.Paused || - container.State.Restarting || - container.State.Running { - // send API call to kill the container - err := c.Runtime.ContainerKill(ctx, ctn.ID, "SIGKILL") - if err != nil { - return err - } - } - - // create options for removing container - opts := types.ContainerRemoveOptions{ - Force: true, - RemoveLinks: false, - RemoveVolumes: true, - } - - // send API call to remove the container - err = c.Runtime.ContainerRemove(ctx, ctn.ID, opts) - if err != nil { - return err - } - - return nil -} - -// RunContainer creates and start the pipeline container. -func (c *client) RunContainer(ctx context.Context, b *pipeline.Build, ctn *pipeline.Container) error { - // create container configuration - ctnConf := ctnConfig(ctn) - // create host configuration - hostConf := hostConfig(b.ID) - // create network configuration - netConf := netConfig(b.ID, ctn.Name) - - logrus.Tracef("Creating container for step %s", b.ID) - - // send API call to create the container - container, err := c.Runtime.ContainerCreate( - ctx, - ctnConf, - hostConf, - netConf, - ctn.ID, - ) - if err != nil { - return err - } - - logrus.Tracef("Starting container for step %s", b.ID) - - // create options for starting container - opts := types.ContainerStartOptions{} - - // send API call to start the container - err = c.Runtime.ContainerStart(ctx, container.ID, opts) - if err != nil { - return err - } - - return nil -} - -// SetupContainer pulls the image for the pipeline container. -func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("Parsing image %s", ctn.Image) - - // parse image from container - image, err := parseImage(ctn.Image) - if err != nil { - return err - } - - // check if the container should be updated - if ctn.Pull { - logrus.Tracef("Pulling configured image %s", image) - // create options for pulling image - opts := types.ImagePullOptions{} - - // send API call to pull the image for the container - reader, err := c.Runtime.ImagePull(ctx, image, opts) - if err != nil { - return err - } - - defer reader.Close() - - // copy output from image pull to standard output - _, err = io.Copy(os.Stdout, reader) - if err != nil { - return err - } - - return nil - } - - // check if the container image exists on the host - _, _, err = c.Runtime.ImageInspectWithRaw(ctx, image) - if err == nil { - return nil - } - - // if the container image does not exist on the host - // we attempt to capture it for executing the pipeline - if docker.IsErrNotFound(err) { - logrus.Tracef("Pulling unfound image %s", image) - - // create options for pulling image - opts := types.ImagePullOptions{} - - // send API call to pull the image for the container - reader, err := c.Runtime.ImagePull(ctx, image, opts) - if err != nil { - return err - } - - defer reader.Close() - - // copy output from image pull to standard output - _, err = io.Copy(os.Stdout, reader) - if err != nil { - return err - } - - return nil - } - - return err -} - -// TailContainer captures the logs for the pipeline container. -func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { - logrus.Tracef("Capturing container logs for step %s", ctn.ID) - - // create options for capturing container logs - opts := types.ContainerLogsOptions{ - Follow: true, - ShowStdout: true, - ShowStderr: true, - Details: false, - Timestamps: false, - } - - // send API call to capture the container logs - logs, err := c.Runtime.ContainerLogs(ctx, ctn.ID, opts) - if err != nil { - return nil, err - } - - // create in-memory pipe for capturing logs - rc, wc := io.Pipe() - - logrus.Tracef("Copying container logs for step %s", ctn.ID) - - // capture all stdout and stderr logs - go func() { - stdcopy.StdCopy(wc, wc, logs) - logs.Close() - wc.Close() - rc.Close() - }() - - return rc, nil -} - -// WaitContainer blocks until the pipeline container completes. -func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("Waiting for container for step %s", ctn.ID) - - // send API call to wait for the container completion - wait, errC := c.Runtime.ContainerWait(ctx, ctn.ID, container.WaitConditionNotRunning) - select { - case <-wait: - case err := <-errC: - return err - } - - return nil -} - -// ctnConfig is a helper function to -// generate the container config. -func ctnConfig(ctn *pipeline.Container) *container.Config { - logrus.Tracef("Creating container configuration for step %s", ctn.ID) - - // parse image from container - image, err := parseImage(ctn.Image) - if err != nil { - logrus.Errorf("unable to parse image: %v", err) - } - - // create container config object - config := &container.Config{ - Image: image, - WorkingDir: ctn.Directory, - AttachStdin: false, - AttachStdout: true, - AttachStderr: true, - Tty: false, - OpenStdin: false, - StdinOnce: false, - ArgsEscaped: false, - } - - // check if the environment is provided - if len(ctn.Environment) > 0 { - // iterate through each element in the container environment - for k, v := range ctn.Environment { - // add key/value environment to container config - config.Env = append(config.Env, fmt.Sprintf("%s=%s", k, v)) - } - } - - // check if the entrypoint is provided - if len(ctn.Entrypoint) > 0 { - // add entrypoint to container config - config.Entrypoint = ctn.Entrypoint - } - - // check if the commands are provided - if len(ctn.Commands) > 0 { - // add commands to container config - config.Cmd = ctn.Commands - } - - return config -} - -// hostConfig is a helper function to generate -// the host config for a container. -func hostConfig(id string) *container.HostConfig { - return &container.HostConfig{ - LogConfig: container.LogConfig{ - Type: "json-file", - }, - Privileged: false, - Mounts: []mount.Mount{ - { - Type: mount.TypeVolume, - Source: id, - Target: "/home", - }, - }, - } -} diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go deleted file mode 100644 index 46d9ea87..00000000 --- a/runtime/docker/container_test.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - "testing" - - "github.com/go-vela/types/pipeline" -) - -func TestDocker_InspectContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.InspectContainer(context.Background(), &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - }) - - if got != nil { - t.Error("InspectContainer should not have returned err: ", got) - } - - if got != nil { - t.Errorf("InspectContainer is %v, want nil", got) - } -} - -func TestDocker_InspectContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.InspectContainer(context.Background(), &pipeline.Container{}) - - if got == nil { - t.Errorf("InspectContainer should have returned err: %+v", got) - } -} - -func TestDocker_RemoveContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveContainer(context.Background(), &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - }) - - if got != nil { - t.Error("RemoveContainer should not have returned err: ", got) - } - - if got != nil { - t.Errorf("RemoveContainer is %v, want nil", got) - } -} - -func TestDocker_RemoveContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveContainer(context.Background(), &pipeline.Container{}) - - if got == nil { - t.Errorf("RemoveContainer should have returned err: %+v", got) - } -} - -func TestDocker_RunContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RunContainer(context.Background(), - &pipeline.Build{ - Version: "1", - ID: "__0", - }, - &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - }) - - if got != nil { - t.Error("RunContainer should not have returned err: ", got) - } - - if got != nil { - t.Errorf("RunContainer is %v, want nil", got) - } -} - -// TODO: rethink how the mock is being done in the -// router switch. This current gives false positives -func TestDocker_RunContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RunContainer(context.Background(), - &pipeline.Build{}, - &pipeline.Container{}) - - // this should be "==" - if got != nil { - t.Errorf("RunContainer should have returned err: %+v", got) - } -} - -func TestDocker_SetupContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.SetupContainer(context.Background(), &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - Pull: true, - }) - - if got != nil { - t.Errorf("SetupContainer is %v, want nil", got) - } -} - -func TestDocker_SetupContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.SetupContainer(context.Background(), &pipeline.Container{}) - - if got == nil { - t.Errorf("SetupContainer should have returned err: %+v", got) - } -} - -func TestDocker_TailContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - _, got := c.TailContainer(context.Background(), &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - }) - - if got != nil { - t.Error("TailContainer should not have returned err: ", got) - } - - if got != nil { - t.Errorf("TailContainer is %v, want nil", got) - } -} - -// TODO: rethink how the mock is being done in the -// router switch. This current gives false positives -func TestDocker_TailContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - _, got := c.TailContainer(context.Background(), &pipeline.Container{}) - - // this should be "==" - if got != nil { - t.Errorf("TailContainer should have returned err: %+v", got) - } -} - -func TestDocker_WaitContainer_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.WaitContainer(context.Background(), &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - }) - - if got != nil { - t.Error("WaitContainer should not have returned err: ", got) - } - - if got != nil { - t.Errorf("WaitContainer is %v, want nil", got) - } -} - -func TestDocker_WaitContainer_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.WaitContainer(context.Background(), &pipeline.Container{}) - - if got == nil { - t.Errorf("WaitContainer should have returned err: %+v", got) - } -} diff --git a/runtime/docker/doc.go b/runtime/docker/doc.go deleted file mode 100644 index 5443795e..00000000 --- a/runtime/docker/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package docker provides the ability for Vela to -// integrate with Docker as a runtime environment. -// -// Usage: -// -// import "github.com/go-vela/worker/runtime/docker" -package docker diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go deleted file mode 100644 index 3a0b87d4..00000000 --- a/runtime/docker/docker.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - docker "github.com/docker/docker/client" - "github.com/go-vela/worker/runtime/docker/testdata/mock" - "github.com/sirupsen/logrus" -) - -const dockerVersion = "1.38" - -type client struct { - Runtime *docker.Client -} - -// New returns an Engine implementation that -// integrates with a Docker runtime. -func New() (*client, error) { - // create Docker client from environment - r, err := docker.NewClientWithOpts(docker.FromEnv) - if err != nil { - return nil, err - } - // pin version to prevent "client version is too new." errors - // typically this would be inherited from the host env but this will ensure - // we know what version of the Docker API we're using - docker.WithVersion(dockerVersion)(r) - - // create the client object - c := &client{ - Runtime: r, - } - - return c, nil -} - -// NewMock returns an Engine implementation that -// integrates with a mock Docker runtime. -// -// This function is intended for running tests only. -func NewMock() (*client, error) { - // create mock client - mock := mock.Client(mock.Router) - - // create Docker client from the mock client - r, err := docker.NewClient("tcp://127.0.0.1:2333", dockerVersion, mock, nil) - if err != nil { - logrus.Fatal(err) - } - - // create the client object - c := &client{ - Runtime: r, - } - - return c, nil -} diff --git a/runtime/docker/image.go b/runtime/docker/image.go deleted file mode 100644 index 8cfd4744..00000000 --- a/runtime/docker/image.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - - "github.com/go-vela/types/pipeline" - - "github.com/docker/distribution/reference" - - "github.com/sirupsen/logrus" -) - -// InspectImage inspects the pipeline container image. -func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { - logrus.Tracef("Parsing image %s", ctn.Image) - - // parse image from container - image, err := parseImage(ctn.Image) - if err != nil { - return nil, err - } - - // send API call to inspect the image - i, _, err := c.Runtime.ImageInspectWithRaw(ctx, image) - if err != nil { - return nil, err - } - - return []byte(i.ID + "\n"), nil -} - -// parseImage is a helper function to parse -// the image for the provided container. -func parseImage(s string) (string, error) { - // create fully qualified reference - image, err := reference.ParseNormalizedNamed(s) - if err != nil { - return "", err - } - - // add latest tag to image if no tag was provided - return reference.TagNameOnly(image).String(), nil -} diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go deleted file mode 100644 index ffc48d28..00000000 --- a/runtime/docker/image_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - "testing" - - "github.com/go-vela/types/pipeline" -) - -func TestDocker_InspectImage(t *testing.T) { - // setup types - p := &pipeline.Container{ - ID: "container_id", - Image: "alpine:latest", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectImage(context.Background(), p) - - if err != nil { - t.Errorf("InspectImage returned err: %v", err) - } - - if got == nil { - t.Errorf("InspectImage is nil, want %v", got) - } -} - -func TestDocker_InspectImage_BadImage(t *testing.T) { - // setup types - p := &pipeline.Container{ - ID: "container_id", - Image: "alpine:notfound", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectImage(context.Background(), p) - - if err == nil { - t.Errorf("InspectImage should have returned err") - } - - if got != nil { - t.Errorf("InspectImage is %v, want nil", got) - } -} - -func TestDocker_InspectImage_NoImage(t *testing.T) { - // setup types - p := new(pipeline.Container) - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectImage(context.Background(), p) - - if err == nil { - t.Errorf("InspectImage should have returned err") - } - - if got != nil { - t.Errorf("InspectImage is %v, want nil", got) - } -} diff --git a/runtime/docker/network.go b/runtime/docker/network.go deleted file mode 100644 index 59de15b6..00000000 --- a/runtime/docker/network.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/network" - "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" -) - -// CreateNetwork creates the pipeline network. -func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("Creating network for pipeline %s", b.ID) - - // create options for creating network - opts := types.NetworkCreate{ - Driver: "bridge", - } - - // send API call to create the network - _, err := c.Runtime.NetworkCreate(ctx, b.ID, opts) - if err != nil { - return err - } - - return nil -} - -// InspectNetwork inspects the pipeline network. -func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("Inspecting network for pipeline %s", b.ID) - - // create options for inspecting network - opts := types.NetworkInspectOptions{} - - // send API call to inspect the network - n, err := c.Runtime.NetworkInspect(ctx, b.ID, opts) - if err != nil { - return nil, err - } - - return []byte(n.ID + "\n"), nil -} - -// RemoveNetwork deletes the pipeline network. -func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("Removing volume for pipeline %s", b.ID) - - // send API call to remove the network - err := c.Runtime.NetworkRemove(ctx, b.ID) - if err != nil { - return err - } - - return nil -} - -// netConfig is a helper function to generate -// the network config for a container. -func netConfig(id, alias string) *network.NetworkingConfig { - endpoints := make(map[string]*network.EndpointSettings) - - // set pipeline id for endpoint with alias - endpoints[id] = &network.EndpointSettings{ - NetworkID: id, - Aliases: []string{alias}, - } - - return &network.NetworkingConfig{ - EndpointsConfig: endpoints, - } -} diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go deleted file mode 100644 index 5b6d90e6..00000000 --- a/runtime/docker/network_test.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - "testing" - - "github.com/go-vela/types/pipeline" -) - -func TestDocker_CreateNetwork_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.CreateNetwork(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - if got != nil { - t.Error("CreateNetwork should not have returned err: ", got) - } - - if got != nil { - t.Errorf("CreateNetwork is %v, want nil", got) - } -} - -// TODO: rethink how the mock is being done in the -// router switch. This current gives false positives -func TestDocker_CreateNetwork_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.CreateNetwork(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - // this should be "==" - if got != nil { - t.Errorf("CreateNetwork should have returned err: %+v", got) - } -} - -func TestDocker_InspectNetwork_Success(t *testing.T) { - // setup types - p := &pipeline.Build{ - Version: "1", - ID: "__0", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectNetwork(context.Background(), p) - if err != nil { - t.Errorf("InspectNetwork returned err: %v", err) - } - - if got == nil { - t.Errorf("InspectNetwork is nil, want %v", got) - } -} - -func TestDocker_InspectNetwork_Failure(t *testing.T) { - // setup types - p := &pipeline.Build{ - Version: "1", - ID: "notfound", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectNetwork(context.Background(), p) - if err == nil { - t.Errorf("InspectNetwork should have returned err") - } - - if got != nil { - t.Errorf("InspectNetwork is %v, want nil", got) - } -} - -func TestDocker_RemoveNetwork_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveNetwork(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - if got != nil { - t.Error("RemoveNetwork should not have returned err: ", got) - } - - if got != nil { - t.Errorf("RemoveNetwork is %v, want nil", got) - } -} - -func TestDocker_RemoveNetwork_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveNetwork(context.Background(), &pipeline.Build{}) - - if got == nil { - t.Errorf("RemoveNetwork should have returned err: %+v", got) - } -} diff --git a/runtime/docker/testdata/mock/container.go b/runtime/docker/testdata/mock/container.go deleted file mode 100644 index c6fd72d8..00000000 --- a/runtime/docker/testdata/mock/container.go +++ /dev/null @@ -1,165 +0,0 @@ -package mock - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/pkg/stringid" - "github.com/sirupsen/logrus" -) - -// helper function to return the mock results from an container creates -func createContainer(r *http.Request) (*http.Response, error) { - - logrus.Infof("Creating a new container: %s", r.URL.Query().Get("name")) - b, _ := json.Marshal(container.ContainerCreateCreatedBody{ - ID: stringid.GenerateRandomID(), - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an listing containers -func listContainers(r *http.Request) (*http.Response, error) { - - logrus.Info("Listing all containers") - b, _ := json.Marshal([]types.Container{ - { - ID: stringid.GenerateRandomID(), - Names: []string{"hello docker"}, - Image: "test:image", - ImageID: stringid.GenerateRandomID(), - Command: "top", - }, - { - ID: stringid.GenerateRandomID(), - Names: []string{"hello docker 2"}, - Image: "test:image", - ImageID: stringid.GenerateRandomID(), - Command: "top", - }, - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an inspecting running containers -func getContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Getting container with ID: %s", id) - b, _ := json.Marshal(types.ContainerJSON{ - ContainerJSONBase: &types.ContainerJSONBase{ - ID: id, - Image: "test:image", - Name: "name", - State: &types.ContainerState{ - Running: true, - }, - HostConfig: &container.HostConfig{ - Resources: container.Resources{ - CPUQuota: 9999, - CPUPeriod: 9999, - CPUShares: 999, - Memory: 99999, - }, - }, - }, - Config: &container.Config{ - Labels: map[string]string{ - "ERU": "1", - }, - Image: "test:image", - }, - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an removing a running containers -func removeContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Removing container with ID: %s", id) - var b []byte - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} - -// helper function to return the mock results from starting a running containers -func startContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Starting container with ID: %s", id) - var b []byte - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} - -// helper function to return the mock results from stopping a running containers -func stopContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Stopping container with ID: %s", id) - var b []byte - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} - -// helper function to return the mock results from stopping a running containers -func waitContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Waiting container with ID: %s", id) - b, _ := json.Marshal(container.ContainerWaitOKBody{ - StatusCode: 15, - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} - -// helper function to return the mock results from stopping a running containers -func killContainer(r *http.Request, id string) (*http.Response, error) { - - logrus.Infof("Killing container with ID: %s", id) - b, _ := json.Marshal(container.ContainerWaitOKBody{ - StatusCode: 15, - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} - -// helper function to return the mock results from logs on a running containers -func logsContainer(r *http.Request, id string) (*http.Response, error) { - - b := []byte("Hello, Docker") - - logrus.Infof("Getting logs from container with ID: %s", id) - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} diff --git a/runtime/docker/testdata/mock/docker.go b/runtime/docker/testdata/mock/docker.go deleted file mode 100644 index f147f5b1..00000000 --- a/runtime/docker/testdata/mock/docker.go +++ /dev/null @@ -1,113 +0,0 @@ -// Package mock is a collection of functions from moby/moby -// to mock hitting the Docker API -// https://github.com/moby/moby/tree/master/client -package mock - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - - "github.com/docker/docker/api/types" -) - -const mockAPIVersion = "v1.38" - -var ( - mockContextWithTimeout bool - err error - ctx = context.Background() -) - -// Client to create the mock client used for http requests. -// This function exists in moby/moby: https://github.com/moby/moby/blob/master/client/client_mock_test.go#L20 -func Client(doer func(*http.Request) (*http.Response, error)) *http.Client { - - return &http.Client{ - Transport: transportFunc(doer), - } -} - -// Router to emulate the Docker router to return mock results -// for Docker API requests -func Router(r *http.Request) (*http.Response, error) { - prefix := fmt.Sprintf("/%s", mockAPIVersion) - path := strings.TrimPrefix(r.URL.Path, prefix) - - // get container id - containerID := "" - if strings.HasPrefix(path, "/containers/") { - cid := strings.TrimPrefix(path, "/containers/") - containerID = strings.Split(cid, "/")[0] - if containerID == "" { - containerID = "_" - } - } - - switch { - - // Image endpoints - case strings.HasPrefix(path, "/images/"): - return imageRoutes(r, path) - - // Container endpoints - case path == "/containers/create": - return createContainer(r) - case path == "/containers/json": - return listContainers(r) - case path == fmt.Sprintf("/containers/%s/json", containerID): - return getContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s", containerID): - return removeContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s/start", containerID): - return startContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s/stop", containerID): - return stopContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s/wait", containerID): - return waitContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s/kill", containerID): - return killContainer(r, containerID) - case path == fmt.Sprintf("/containers/%s/logs", containerID): - return logsContainer(r, containerID) - - // Network endpoints - case strings.HasPrefix(path, "/networks/"): - return networkRoutes(r, path) - - // Volume endpoints - case strings.HasPrefix(path, "/volumes/"): - return volumeRoutes(r, path) - } - - return errorMock(500, fmt.Sprintf("Server Error, unknown path: %s", path)) -} - -type transportFunc func(*http.Request) (*http.Response, error) - -func (tf transportFunc) RoundTrip(req *http.Request) (*http.Response, error) { - return tf(req) -} - -// helper function to return the error mocks in Docker. This function exists in moby/moby -// https://github.com/moby/moby/blob/master/client/client_mock_test.go#L26 -func errorMock(statusCode int, message string) (*http.Response, error) { - header := http.Header{} - header.Set("Content-Type", "application/json") - - body, err := json.Marshal(&types.ErrorResponse{ - Message: message, - }) - if err != nil { - return nil, err - } - - return &http.Response{ - StatusCode: statusCode, - Body: ioutil.NopCloser(bytes.NewReader(body)), - Header: header, - }, fmt.Errorf(message) -} diff --git a/runtime/docker/testdata/mock/images.go b/runtime/docker/testdata/mock/images.go deleted file mode 100644 index 18c7f397..00000000 --- a/runtime/docker/testdata/mock/images.go +++ /dev/null @@ -1,135 +0,0 @@ -package mock - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - "time" - - "github.com/docker/docker/api/types" - "github.com/sirupsen/logrus" -) - -// helper function to specify the routes for the Docker Image APIs -func imageRoutes(r *http.Request, path string) (*http.Response, error) { - - // get image id - image := "" - if strings.HasPrefix(path, "/images/") { - image = strings.TrimPrefix(path, "/images/") - } - - switch { - case path == "/images/create": - return createImage(r) - case path == "/images/json": - return listImages(r) - case path == fmt.Sprintf("/images/%s", image): - if r.Method == http.MethodDelete { - return deleteImage(r, image) - } - return inspectImage(r, image) - } - - return nil, nil -} - -// helper function to return the mock results from an image create -func createImage(r *http.Request) (*http.Response, error) { - - name := r.URL.Query().Get("name") - image := r.URL.Query().Get("fromImage") - tag := r.URL.Query().Get("tag") - - b := []byte("test:latest") - - logrus.Infof("Creating a new image %s: %s:%s", name, image, tag) - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an image inspect -func inspectImage(r *http.Request, image string) (*http.Response, error) { - logrus.Infof("Docker mock inspecting image %s", image) - - if strings.Contains(image, "notfound") { - return &http.Response{ - StatusCode: http.StatusNotFound, - Body: ioutil.NopCloser(bytes.NewReader([]byte("image not found"))), - }, nil - } - - // $ docker pull alpine:latest - // - // $ docker image inspect alpine:latest - resp := types.ImageInspect{ - ID: "sha256:965ea09ff2ebd2b9eeec88cd822ce156f6674c7e99be082c7efac3c62f3ff652", - RepoTags: []string{"alpine:latest"}, - RepoDigests: []string{"alpine@sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a"}, - Parent: "", - Comment: "", - Created: "2019-10-21T17:21:42.387111039Z", - Container: "baae288169b1ae2f6bd82e7b605d8eb35a79e846385800e305eccc55b9bd5986", - ContainerConfig: nil, - DockerVersion: "18.06.1-ce", - Author: "", - Config: nil, - Architecture: "amd64", - Os: "linux", - Size: 5552690, - VirtualSize: 5552690, - GraphDriver: types.GraphDriverData{ - Data: map[string]string{ - "MergedDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/merged", - "UpperDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/diff", - "WorkDir": "/var/lib/docker/overlay2/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/work", - }, - Name: "overlay2", - }, - RootFS: types.RootFS{ - Type: "layers", - Layers: []string{"sha256:77cae8ab23bf486355d1b3191259705374f4a11d483b24964d2f729dd8c076a0"}, - }, - Metadata: types.ImageMetadata{LastTagTime: time.Now()}, - } - - b, _ := json.Marshal(resp) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an image list -func listImages(r *http.Request) (*http.Response, error) { - - logrus.Info("Listing all images") - b, _ := json.Marshal([]types.ImageSummary{ - {ID: "image_id_1"}, - {ID: "image_id_2"}, - }) - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an image delete -func deleteImage(r *http.Request, image string) (*http.Response, error) { - - logrus.Infof("Deleting image %s", image) - b, _ := json.Marshal([]types.ImageDeleteResponseItem{ - {Untagged: image}, - {Deleted: image}, - }) - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} diff --git a/runtime/docker/testdata/mock/network.go b/runtime/docker/testdata/mock/network.go deleted file mode 100644 index b9752b7b..00000000 --- a/runtime/docker/testdata/mock/network.go +++ /dev/null @@ -1,106 +0,0 @@ -package mock - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - "strings" - "time" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/network" - "github.com/sirupsen/logrus" -) - -// helper function to specify the routes for the Docker Network APIs -func networkRoutes(r *http.Request, path string) (*http.Response, error) { - - // get network id - net := "" - if strings.HasPrefix(path, "/networks/") { - net = strings.TrimPrefix(path, "/networks/") - } - - switch { - case strings.EqualFold(r.Method, http.MethodPost): // Path: /networks/create - return createNetwork(r) - case strings.EqualFold(r.Method, http.MethodGet): // Path: /networks/:network_id - return inspectNetwork(r, net) - case strings.EqualFold(r.Method, http.MethodDelete): // Path: /networks/:network_id - // id := strings.Split(p, "/")[1] - return removeNetwork(r, net) - } - - return nil, nil -} - -// helper function to return the mock results from a network creates -func createNetwork(r *http.Request) (*http.Response, error) { - - logrus.Infof("Creating a new network") - b, _ := json.Marshal(types.NetworkCreateResponse{ - ID: "network_id", - Warning: "warning", - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from a network inspect -func inspectNetwork(r *http.Request, net string) (*http.Response, error) { - logrus.Infof("Inspecting network %s", net) - - if strings.Contains(net, "notfound") { - return &http.Response{ - StatusCode: http.StatusNotFound, - Body: ioutil.NopCloser(bytes.NewReader([]byte("network not found"))), - }, nil - } - - resp := types.NetworkResource{ - Name: "host", - ID: "d0097728e3575854f5d7e5704304aa0c3afefcdfbf0f037d19d48afa2f1cabeb", - Created: time.Now(), - Scope: "local", - Driver: "host", - EnableIPv6: false, - IPAM: network.IPAM{ - Driver: "default", - Options: map[string]string{}, - Config: []network.IPAMConfig{}, - }, - Internal: false, - Attachable: false, - Ingress: false, - ConfigFrom: network.ConfigReference{ - Network: "", - }, - ConfigOnly: false, - Containers: map[string]types.EndpointResource{}, - Options: map[string]string{}, - Labels: map[string]string{}, - } - - b, _ := json.Marshal(resp) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from a network remove -func removeNetwork(r *http.Request, net string) (*http.Response, error) { - - logrus.Infof("Deleting network %s", net) - var b []byte - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} diff --git a/runtime/docker/testdata/mock/volume.go b/runtime/docker/testdata/mock/volume.go deleted file mode 100644 index 307c4453..00000000 --- a/runtime/docker/testdata/mock/volume.go +++ /dev/null @@ -1,90 +0,0 @@ -package mock - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - "strings" - - "github.com/docker/docker/api/types" - "github.com/sirupsen/logrus" -) - -// helper function to specify the routes for the Docker Volume APIs -func volumeRoutes(r *http.Request, path string) (*http.Response, error) { - - // get volume id - vol := "" - if strings.HasPrefix(path, "/volumes/") { - vol = strings.TrimPrefix(path, "/volumes/") - } - - switch { - case strings.EqualFold(r.Method, http.MethodPost): // Path: /volumes/create - return createVolume(r) - case strings.EqualFold(r.Method, http.MethodGet): // Path: /volumes/:volume_id - return inspectVolume(r, vol) - case strings.EqualFold(r.Method, http.MethodDelete): // Path: /volumes/:volume_id - return removeVolume(r, vol) - } - - return nil, nil -} - -// helper function to return the mock results from an volume creates -func createVolume(r *http.Request) (*http.Response, error) { - - logrus.Infof("Creating a new volume") - b, _ := json.Marshal(types.Volume{ - Name: "volume", - Driver: "local", - Mountpoint: "mountpoint", - }) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from a network inspect -func inspectVolume(r *http.Request, vol string) (*http.Response, error) { - logrus.Infof("Inspecting volume %s", vol) - - if strings.Contains(vol, "notfound") { - return &http.Response{ - StatusCode: http.StatusNotFound, - Body: ioutil.NopCloser(bytes.NewReader([]byte("volume not found"))), - }, nil - } - - resp := types.Volume{ - CreatedAt: "2019-12-05T12:00:00Z", - Driver: "local", - Labels: map[string]string{}, - Mountpoint: "/var/lib/docker/volumes/9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2/_data", - Name: "9c00b01ddf812433e804c72a139eadc69ae79396207e127737de5c917b9e89b2", - Options: map[string]string{}, - Scope: "local", - } - - b, _ := json.Marshal(resp) - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), - }, nil -} - -// helper function to return the mock results from an volume remove -func removeVolume(r *http.Request, vol string) (*http.Response, error) { - - logrus.Infof("Deleting a volume %s", vol) - var b []byte - - return &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewReader(b)), // empty body - }, nil -} diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go deleted file mode 100644 index dde74cb1..00000000 --- a/runtime/docker/volume.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - - types "github.com/docker/docker/api/types/volume" - "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" -) - -// CreateVolume creates the pipeline volume. -func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("Creating volume for pipeline %s", b.ID) - - // create options for creating volume - opts := types.VolumeCreateBody{ - Name: b.ID, - Driver: "local", - } - - // send API call to create the volume - _, err := c.Runtime.VolumeCreate(ctx, opts) - if err != nil { - return err - } - - return nil -} - -// InspectVolume inspects the pipeline volume. -func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("Inspecting volume for pipeline %s", b.ID) - - // send API call to inspect the volume - v, err := c.Runtime.VolumeInspect(ctx, b.ID) - if err != nil { - return nil, err - } - - return []byte(v.Name + "\n"), nil -} - -// RemoveVolume deletes the pipeline volume. -func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("Removing volume for pipeline %s", b.ID) - - // send API call to remove the volume - err := c.Runtime.VolumeRemove(ctx, b.ID, true) - if err != nil { - return err - } - - return nil -} diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go deleted file mode 100644 index e0834d9d..00000000 --- a/runtime/docker/volume_test.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package docker - -import ( - "context" - "testing" - - "github.com/go-vela/types/pipeline" -) - -func TestDocker_CreateVolume_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.CreateVolume(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - if got != nil { - t.Error("CreateVolume should not have returned err: ", got) - } - - if got != nil { - t.Errorf("CreateVolume is %v, want nil", got) - } -} - -// TODO: rethink how the mock is being done in the -// router switch. This current gives false positives -func TestDocker_CreateVolume_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.CreateVolume(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - // this should be "==" - if got != nil { - t.Errorf("CreateVolume should have returned err: %+v", got) - } -} - -func TestDocker_InspectVolume_Success(t *testing.T) { - // setup types - p := &pipeline.Build{ - Version: "1", - ID: "__0", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectVolume(context.Background(), p) - if err != nil { - t.Errorf("InspectVolume returned err: %v", got) - } - - if got == nil { - t.Errorf("InspectVolume is nil, want %v", got) - } -} - -func TestDocker_InspectVolume_Failure(t *testing.T) { - // setup types - p := &pipeline.Build{ - Version: "1", - ID: "notfound", - } - - // setup Docker - c, _ := NewMock() - - // run test - got, err := c.InspectVolume(context.Background(), p) - if err == nil { - t.Errorf("InspectVolume should have returned err") - } - - if got != nil { - t.Errorf("InspectVolume is %v, want nil", got) - } -} - -func TestDocker_RemoveVolume_Success(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveVolume(context.Background(), &pipeline.Build{ - Version: "1", - ID: "__0"}) - - if got != nil { - t.Error("RemoveVolume should not have returned err: ", got) - } - - if got != nil { - t.Errorf("RemoveVolume is %v, want nil", got) - } -} - -func TestDocker_RemoveVolume_Failure(t *testing.T) { - // setup Docker - c, _ := NewMock() - - // run test - got := c.RemoveVolume(context.Background(), &pipeline.Build{}) - - if got == nil { - t.Errorf("RemoveVolume should have returned err: %+v", got) - } -} diff --git a/runtime/runtime.go b/runtime/runtime.go deleted file mode 100644 index 5ffbd4ed..00000000 --- a/runtime/runtime.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package runtime - -import ( - "context" - "io" - - "github.com/go-vela/types/pipeline" -) - -// Engine represents the interface for Vela integrating -// with the different supported Runtime environments. -type Engine interface { - - // Container Engine Interface Functions - - // InspectContainer defines a function that inspects - // the pipeline container. - InspectContainer(context.Context, *pipeline.Container) error - // RemoveContainer defines a function that deletes - // (kill, remove) the pipeline container. - RemoveContainer(context.Context, *pipeline.Container) error - // RunContainer defines a function that creates - // and start the pipeline container. - RunContainer(context.Context, *pipeline.Build, *pipeline.Container) error - // SetupContainer defines a function that pulls - // the image for the pipeline container. - SetupContainer(context.Context, *pipeline.Container) error - // TailContainer defines a function that captures - // the logs on the pipeline container. - TailContainer(context.Context, *pipeline.Container) (io.ReadCloser, error) - // WaitContainer defines a function that blocks - // until the pipeline container completes. - WaitContainer(context.Context, *pipeline.Container) error - - // Image Engine Interface Functions - - // InspectImage defines a function that - // inspects the pipeline container image. - InspectImage(context.Context, *pipeline.Container) ([]byte, error) - - // Network Engine Interface Functions - - // CreateNetwork defines a function that - // creates the pipeline network. - CreateNetwork(context.Context, *pipeline.Build) error - // InspectNetwork defines a function that - // inspects the pipeline network. - InspectNetwork(context.Context, *pipeline.Build) ([]byte, error) - // RemoveNetwork defines a function that - // deletes the pipeline network. - RemoveNetwork(context.Context, *pipeline.Build) error - - // Volume Engine Interface Functions - - // CreateVolume defines a function that - // creates the pipeline volume. - CreateVolume(context.Context, *pipeline.Build) error - // InspectVolume defines a function that - // inspects the pipeline volume. - InspectVolume(context.Context, *pipeline.Build) ([]byte, error) - // RemoveVolume defines a function that - // deletes the pipeline volume. - RemoveVolume(context.Context, *pipeline.Build) error -} From 674f37d7d56f50719951ff0b10953e006dc76001 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 12 Mar 2020 09:20:29 -0500 Subject: [PATCH 074/430] feat(executor): add functions to stream logs (#66) * feat(executor): add funcs to stream logs * feat(executor): add func to plan build * refactor: fix linter errors --- cmd/server/operate.go | 8 ++ executor/executor.go | 19 +++- executor/linux/build.go | 65 +++++++++-- executor/linux/build_test.go | 10 +- executor/linux/service.go | 178 +++++++++++++++++------------- executor/linux/stage.go | 27 +++-- executor/linux/stage_test.go | 30 ++++-- executor/linux/step.go | 203 +++++++++++++++++++---------------- 8 files changed, 337 insertions(+), 203 deletions(-) diff --git a/cmd/server/operate.go b/cmd/server/operate.go index 4f9c6898..297e06a0 100644 --- a/cmd/server/operate.go +++ b/cmd/server/operate.go @@ -91,6 +91,14 @@ func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err e return err } + // plan the build on the executor + logger.Info("creating build") + err = executor.PlanBuild(ctx) + if err != nil { + logger.Errorf("unable to plan build: %v", err) + return err + } + // execute the build on the executor logger.Info("executing build") err = executor.ExecBuild(ctx) diff --git a/executor/executor.go b/executor/executor.go index 9162fb45..f9c9fa5a 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -30,13 +30,13 @@ type Engine interface { // that kills the current build in execution. KillBuild() (*library.Build, error) - // Secrets Engine interface functions + // Secrets Engine Interface Functions // PullSecret defines a function that pulls // the secrets for a given pipeline. PullSecret(context.Context) error - // Service Engine interface functions + // Service Engine Interface Functions // CreateService defines a function that // configures the service for execution. @@ -47,11 +47,14 @@ type Engine interface { // ExecService defines a function that // runs a service. ExecService(context.Context, *pipeline.Container) error + // StreamService defines a function that + // tails the output for a service. + StreamService(context.Context, *pipeline.Container) error // DestroyService defines a function that // cleans up the service after execution. DestroyService(context.Context, *pipeline.Container) error - // Step Engine interface functions + // Step Engine Interface Functions // CreateStep defines a function that // configures the step for execution. @@ -62,18 +65,21 @@ type Engine interface { // ExecStep defines a function that // runs a step. ExecStep(context.Context, *pipeline.Container) error + // StreamStep defines a function that + // tails the output for a step. + StreamStep(context.Context, *pipeline.Container) error // DestroyStep defines a function that // cleans up the step after execution. DestroyStep(context.Context, *pipeline.Container) error - // Stage Engine interface functions + // Stage Engine Interface Functions // CreateStage defines a function that // configures the stage for execution. CreateStage(context.Context, *pipeline.Stage) error // PlanStage defines a function that // prepares the stage for execution. - PlanStage(context.Context, *pipeline.Stage) error + PlanStage(context.Context, *pipeline.Stage, map[string]chan error) error // ExecStage defines a function that // runs a stage. ExecStage(context.Context, *pipeline.Stage, map[string]chan error) error @@ -86,6 +92,9 @@ type Engine interface { // CreateBuild defines a function that // configures the build for execution. CreateBuild(context.Context) error + // PlanBuild defines a function that + // prepares the build for execution. + PlanBuild(context.Context) error // ExecBuild defines a function that // runs a pipeline for a build. ExecBuild(context.Context) error diff --git a/executor/linux/build.go b/executor/linux/build.go index 3bc0b7df..b21ec00f 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -20,10 +20,9 @@ import ( "github.com/sirupsen/logrus" ) -// CreateBuild prepares the build for execution. +// CreateBuild configures the build for execution. func (c *client) CreateBuild(ctx context.Context) error { b := c.build - p := c.pipeline r := c.repo e := c.err @@ -77,6 +76,40 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to pull secrets: %v", err) } + return nil +} + +// PlanBuild defines a function that +// prepares the build for execution. +func (c *client) PlanBuild(ctx context.Context) error { + b := c.build + p := c.pipeline + r := c.repo + e := c.err + + // update engine logger with extra metadata + c.logger = c.logger.WithFields(logrus.Fields{ + "build": b.GetNumber(), + "repo": r.GetFullName(), + }) + + defer func() { + // NOTE: When an error occurs during a build that does not have to do + // with a pipeline we should set build status to "error" not "failed" + // because it is worker related and not build. + if e != nil { + b.SetError(e.Error()) + b.SetStatus(constants.StatusError) + } + + c.logger.Info("uploading build state") + // send API call to update the build + _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) + if err != nil { + c.logger.Errorf("unable to upload errorred state: %v", err) + } + }() + // TODO: make this better init := new(pipeline.Container) if len(p.Steps) > 0 { @@ -84,7 +117,7 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Infof("creating %s step", init.Name) // create the step - err = c.CreateStep(ctx, init) + err := c.CreateStep(ctx, init) if err != nil { e = err return fmt.Errorf("unable to create %s step: %w", init.Name, err) @@ -105,7 +138,7 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Infof("creating %s step", init.Name) // create the step - err = c.CreateStep(ctx, init) + err := c.CreateStep(ctx, init) if err != nil { e = err return fmt.Errorf("unable to create %s step: %w", init.Name, err) @@ -123,16 +156,20 @@ func (c *client) CreateBuild(ctx context.Context) error { // TODO: make this cleaner result, ok := c.steps.Load(init.ID) if !ok { + err := fmt.Errorf("unable to get %s step from client", init.Name) e = err - return fmt.Errorf("unable to get %s step from client", init.Name) + + return err } s := result.(*library.Step) result, ok = c.stepLogs.Load(init.ID) if !ok { + err := fmt.Errorf("unable to get %s step from client", init.Name) e = err - return fmt.Errorf("unable to get %s step log from client", init.Name) + + return err } l := result.(*library.Log) @@ -141,7 +178,7 @@ func (c *client) CreateBuild(ctx context.Context) error { s.SetFinished(time.Now().UTC().Unix()) c.logger.Infof("uploading %s step state", init.Name) // send API call to update the step - s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + _, _, err := c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) if err != nil { c.logger.Errorf("unable to upload %s state: %v", init.Name, err) } @@ -156,7 +193,7 @@ func (c *client) CreateBuild(ctx context.Context) error { c.logger.Info("creating network") // create the runtime network for the pipeline - err = c.Runtime.CreateNetwork(ctx, p) + err := c.Runtime.CreateNetwork(ctx, p) if err != nil { e = err return fmt.Errorf("unable to create network: %w", err) @@ -380,7 +417,7 @@ func (c *client) ExecBuild(ctx context.Context) error { result, ok := c.steps.Load(s.ID) if !ok { e = err - return fmt.Errorf("unable to get step from client") + return fmt.Errorf("unable to get step %s from client", s.Name) } cStep := result.(*library.Step) @@ -426,9 +463,17 @@ func (c *client) ExecBuild(ctx context.Context) error { stageMap[stage.Name] = make(chan error) stages.Go(func() error { + c.logger.Infof("planning %s stage", stage.Name) + // plan the stage + err := c.PlanStage(stageCtx, stage, stageMap) + if err != nil { + e = err + return fmt.Errorf("unable to plan stage: %w", err) + } + c.logger.Infof("executing %s stage", stage.Name) // execute the stage - err := c.ExecStage(stageCtx, stage, stageMap) + err = c.ExecStage(stageCtx, stage, stageMap) if err != nil { e = err return fmt.Errorf("unable to execute stage: %w", err) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index b2d1c9a7..7593e3fa 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -423,10 +423,14 @@ func TestExecutor_ExecBuild_Success(t *testing.T) { e.WithPipeline(test.pipeline) e.WithRepo(test.repo) - got := e.ExecBuild(context.Background()) + err := e.PlanBuild(context.Background()) + if err != nil { + t.Errorf("PlanBuild returned err: %v", err) + } - if got != nil { - t.Errorf("ExecBuild is %v, want nil", got) + err = e.ExecBuild(context.Background()) + if err != nil { + t.Errorf("ExecBuild returned err: %v", err) } } } diff --git a/executor/linux/service.go b/executor/linux/service.go index 06ba00f9..ee514ff5 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -11,31 +11,17 @@ import ( "fmt" "time" + "github.com/go-vela/worker/version" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" ) -// CreateService prepares the service for execution. +// CreateService configures the service for execution. func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) error { - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "service": ctn.Name, - }) - - logger.Debug("setting up container") - // setup the runtime container - err := c.Runtime.SetupContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} - -// PlanService defines a function that prepares the service for execution. -func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { var err error b := c.build @@ -79,18 +65,32 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error return nil } -// ExecService runs a service. -func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { - b := c.build - r := c.repo +// PlanService prepares the service for execution. +func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with extra metadata + logger := c.logger.WithFields(logrus.Fields{ + "service": ctn.Name, + }) - result, ok := c.serviceLogs.Load(ctn.ID) - if !ok { - return fmt.Errorf("unable to get service log from client") + ctn.Environment["BUILD_HOST"] = c.Hostname + ctn.Environment["VELA_HOST"] = c.Hostname + ctn.Environment["VELA_VERSION"] = version.Version.String() + // TODO: remove hardcoded reference + ctn.Environment["VELA_RUNTIME"] = "docker" + ctn.Environment["VELA_DISTRIBUTION"] = "linux" + + logger.Debug("setting up container") + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err } - l := result.(*library.Log) + return nil +} +// ExecService runs a service. +func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "service": ctn.Name, @@ -103,55 +103,13 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error return err } - // create new buffer for uploading logs - logs := new(bytes.Buffer) - go func() error { - logger.Debug("tailing container") - // tail the runtime container - rc, err := c.Runtime.TailContainer(ctx, ctn) - if err != nil { - return err - } - defer rc.Close() - - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("appending logs") - l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } - - // flush the buffer of logs - logs.Reset() - } - } - logger.Trace(logs.String()) - - // update the existing log with the last bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("uploading logs") - // send API call to update the logs for the service - l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) + go func() { + logger.Debug("stream logs for container") + // stream logs from container + err := c.StreamService(ctx, ctn) if err != nil { - return err + logrus.Error(err) } - - return nil }() // do not wait for detached containers @@ -176,6 +134,80 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error return nil } +// StreamService tails the output for a service. +func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + b := c.build + r := c.repo + + result, ok := c.stepLogs.Load(ctn.ID) + if !ok { + return fmt.Errorf("unable to get step log from client") + } + + l := result.(*library.Log) + + // update engine logger with extra metadata + logger := c.logger.WithFields(logrus.Fields{ + "step": ctn.Name, + }) + + // create new buffer for uploading logs + logs := new(bytes.Buffer) + + logger.Debug("tailing container") + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + + // if we have at least 1000 bytes in our buffer + if logs.Len() > 1000 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + l.SetData(append(l.GetData(), logs.Bytes()...)) + + logger.Debug("appending logs") + // send API call to append the logs for the service + l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) + if err != nil { + return err + } + + // flush the buffer of logs + logs.Reset() + } + } + logger.Trace(logs.String()) + + // update the existing log with the last bytes + l.SetData(append(l.GetData(), logs.Bytes()...)) + + logger.Debug("uploading logs") + // send API call to update the logs for the service + _, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) + if err != nil { + return err + } + + return nil +} + // DestroyService cleans up services after execution. func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with extra metadata diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 23505694..2c540e4c 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -71,16 +71,8 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { return nil } -// TODO: Make this do stuff -func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage) error { - return fmt.Errorf("this function is currently not supported") -} - -// ExecStage runs a stage. -func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string]chan error) error { - b := c.build - r := c.repo - +// PlanStage prepares the stage for execution. +func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage, m map[string]chan error) error { // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "stage": s.Name, @@ -111,6 +103,19 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] } } + return nil +} + +// ExecStage runs a stage. +func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string]chan error) error { + b := c.build + r := c.repo + + // update engine logger with extra metadata + logger := c.logger.WithFields(logrus.Fields{ + "stage": s.Name, + }) + // close the stage channel at the end defer close(m[s.Name]) @@ -133,7 +138,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string] result, ok := c.steps.Load(step.ID) if !ok { - return fmt.Errorf("unable to get step from client") + return fmt.Errorf("unable to get step %s from client", step.Name) } cStep := result.(*library.Step) diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index f3fc0f5d..86b695a4 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -49,11 +49,12 @@ func TestExecutor_CreateStage_Success(t *testing.T) { Name: "init", Steps: pipeline.ContainerSlice{ &pipeline.Container{ - ID: "__0_init_init", - Image: "#init", - Name: "init", - Number: 1, - Pull: true, + ID: "__0_init_init", + Environment: map[string]string{}, + Image: "#init", + Name: "init", + Number: 1, + Pull: true, }, }, }, @@ -112,9 +113,9 @@ func TestExecutor_CreateStage_Success(t *testing.T) { }) // run test - err := e.PlanStep(context.Background(), &pipeline.Container{ID: "__0_init_init"}) + err := e.CreateStep(context.Background(), e.pipeline.Stages[0].Steps[0]) if err != nil { - t.Errorf("Unable to plan init step: %v", err) + t.Errorf("Unable to create init step: %v", err) } got := e.CreateStage(context.Background(), e.pipeline.Stages[1]) @@ -249,10 +250,19 @@ func TestExecutor_ExecStage_Success(t *testing.T) { }) // run test - got := e.ExecStage(context.Background(), e.pipeline.Stages[0], stageMap) + err := e.CreateStep(context.Background(), e.pipeline.Stages[0].Steps[0]) + if err != nil { + t.Errorf("Unable to create init step: %v", err) + } - if got != nil { - t.Errorf("ExecStage is %v, want nil", got) + err = e.CreateStage(context.Background(), e.pipeline.Stages[0]) + if err != nil { + t.Errorf("CreateStage returned err: %v", err) + } + + err = e.ExecStage(context.Background(), e.pipeline.Stages[0], stageMap) + if err != nil { + t.Errorf("ExecStage returned err: %v", err) } } diff --git a/executor/linux/step.go b/executor/linux/step.go index bf93d92d..e20cac17 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -23,8 +23,13 @@ import ( "github.com/sirupsen/logrus" ) -// CreateStep prepares the step for execution. +// CreateStep configures the step for execution. func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error { + var err error + + b := c.build + r := c.repo + // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "step": ctn.Name, @@ -37,11 +42,54 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error ctn.Environment["VELA_RUNTIME"] = "docker" ctn.Environment["VELA_DISTRIBUTION"] = "linux" + // update the engine step object + s := new(library.Step) + s.SetName(ctn.Name) + s.SetNumber(ctn.Number) + s.SetStatus(constants.StatusRunning) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(ctn.Environment["VELA_HOST"]) + s.SetRuntime(ctn.Environment["VELA_RUNTIME"]) + s.SetDistribution(ctn.Environment["VELA_DISTRIBUTION"]) + + logger.Debug("uploading step state") + // send API call to update the step + s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + return err + } + + s.SetStatus(constants.StatusSuccess) + + // add a step to a map + c.steps.Store(ctn.ID, s) + + // get the step log here + logger.Debug("retrieve step log") + // send API call to capture the step log + l, _, err := c.Vela.Log.GetStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) + if err != nil { + return err + } + + // add a step log to a map + c.stepLogs.Store(ctn.ID, l) + + return nil +} + +// PlanStep prepares the step for execution. +func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // TODO: remove hardcoded reference if ctn.Name == "init" { return nil } + // update engine logger with extra metadata + logger := c.logger.WithFields(logrus.Fields{ + "step": ctn.Name, + }) + logger.Debug("setting up container") // setup the runtime container err := c.Runtime.SetupContainer(ctx, ctn) @@ -90,56 +138,58 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error return nil } -// PlanStep defines a function that prepares the step for execution. -func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { - var err error - - b := c.build - r := c.repo +// ExecStep runs a step. +func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } // update engine logger with extra metadata logger := c.logger.WithFields(logrus.Fields{ "step": ctn.Name, }) - // update the engine step object - s := new(library.Step) - s.SetName(ctn.Name) - s.SetNumber(ctn.Number) - s.SetStatus(constants.StatusRunning) - s.SetStarted(time.Now().UTC().Unix()) - s.SetHost(ctn.Environment["VELA_HOST"]) - s.SetRuntime(ctn.Environment["VELA_RUNTIME"]) - s.SetDistribution(ctn.Environment["VELA_DISTRIBUTION"]) - - logger.Debug("uploading step state") - // send API call to update the step - s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + logger.Debug("running container") + // run the runtime container + err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) if err != nil { return err } - s.SetStatus(constants.StatusSuccess) + go func() { + logger.Debug("stream logs for container") + // stream logs from container + err := c.StreamStep(ctx, ctn) + if err != nil { + logrus.Error(err) + } + }() - // add a step to a map - c.steps.Store(ctn.ID, s) + // do not wait for detached containers + if ctn.Detach { + return nil + } - // get the step log here - logger.Debug("retrieve step log") - // send API call to capture the step log - l, _, err := c.Vela.Log.GetStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) + logger.Debug("waiting for container") + // wait for the runtime container + err = c.Runtime.WaitContainer(ctx, ctn) if err != nil { return err } - // add a step log to a map - c.stepLogs.Store(ctn.ID, l) + logger.Debug("inspecting container") + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } return nil } -// ExecStep runs a step. -func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { +// StreamStep tails the output for a step. +func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { // TODO: remove hardcoded reference if ctn.Name == "init" { return nil @@ -160,80 +210,51 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { "step": ctn.Name, }) - logger.Debug("running container") - // run the runtime container - err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) - if err != nil { - return err - } - // create new buffer for uploading logs logs := new(bytes.Buffer) - go func() error { - logger.Debug("tailing container") - // tail the runtime container - rc, err := c.Runtime.TailContainer(ctx, ctn) - if err != nil { - return err - } - defer rc.Close() - // create new scanner from the container output - scanner := bufio.NewScanner(rc) + logger.Debug("tailing container") + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) + // create new scanner from the container output + scanner := bufio.NewScanner(rc) - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) - // update the existing log with the new bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) + // if we have at least 1000 bytes in our buffer + if logs.Len() > 1000 { + logger.Trace(logs.String()) - logger.Debug("appending logs") - // send API call to update the logs for the step - l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } + // update the existing log with the new bytes + l.SetData(append(l.GetData(), logs.Bytes()...)) - // flush the buffer of logs - logs.Reset() + logger.Debug("appending logs") + // send API call to append the logs for the step + l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) + if err != nil { + return err } - } - logger.Trace(logs.String()) - // update the existing log with the last bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("uploading logs") - // send API call to update the logs for the step - l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err + // flush the buffer of logs + logs.Reset() } - - return nil - }() - - // do not wait for detached containers - if ctn.Detach { - return nil } + logger.Trace(logs.String()) - logger.Debug("waiting for container") - // wait for the runtime container - err = c.Runtime.WaitContainer(ctx, ctn) - if err != nil { - return err - } + // update the existing log with the last bytes + l.SetData(append(l.GetData(), logs.Bytes()...)) - logger.Debug("inspecting container") - // inspect the runtime container - err = c.Runtime.InspectContainer(ctx, ctn) + logger.Debug("uploading logs") + // send API call to update the logs for the step + _, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) if err != nil { return err } From 3e3cf01704724c68c13275d50b6a92e01926a283 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 20 Mar 2020 08:55:39 -0500 Subject: [PATCH 075/430] refactor(cmd): rename to vela-worker (#67) --- .github/README.md | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- Makefile | 2 +- cmd/{server => vela-worker}/client.go | 0 cmd/{server => vela-worker}/executor.go | 0 cmd/{server => vela-worker}/main.go | 0 cmd/{server => vela-worker}/operate.go | 0 cmd/{server => vela-worker}/queue.go | 0 cmd/{server => vela-worker}/server.go | 0 cmd/{server => vela-worker}/validate.go | 0 11 files changed, 4 insertions(+), 4 deletions(-) rename cmd/{server => vela-worker}/client.go (100%) rename cmd/{server => vela-worker}/executor.go (100%) rename cmd/{server => vela-worker}/main.go (100%) rename cmd/{server => vela-worker}/operate.go (100%) rename cmd/{server => vela-worker}/queue.go (100%) rename cmd/{server => vela-worker}/server.go (100%) rename cmd/{server => vela-worker}/validate.go (100%) diff --git a/.github/README.md b/.github/README.md index c079e0bb..a5d5d0c9 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,6 +1,6 @@ # worker -[![license](https://img.shields.io/crates/l/gl.svg)](LICENSE) +[![license](https://img.shields.io/crates/l/gl.svg)](../LICENSE) [![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) [![codecov](https://codecov.io/gh/go-vela/worker/branch/master/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index f3505087..67a39f84 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -25,7 +25,7 @@ jobs: go build -a \ -ldflags '-s -w -extldflags "-static"' \ -o release/vela-worker \ - github.com/go-vela/worker/cmd/server + github.com/go-vela/worker/cmd/vela-worker - name: publish uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7a2e8e78..4e3dc428 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: go build -a \ -ldflags '-s -w -extldflags "-static"' \ -o release/vela-worker \ - github.com/go-vela/worker/cmd/server + github.com/go-vela/worker/cmd/vela-worker - name: publish uses: elgohr/Publish-Docker-Github-Action@master diff --git a/Makefile b/Makefile index 11e7819a..5c07a0c6 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ build: ###### Build Golang Binary ###### ################################# - GOOS=linux CGO_ENABLED=0 go build -o release/vela-worker github.com/go-vela/worker/cmd/server + GOOS=linux CGO_ENABLED=0 go build -o release/vela-worker github.com/go-vela/worker/cmd/vela-worker compose-up: ################################# diff --git a/cmd/server/client.go b/cmd/vela-worker/client.go similarity index 100% rename from cmd/server/client.go rename to cmd/vela-worker/client.go diff --git a/cmd/server/executor.go b/cmd/vela-worker/executor.go similarity index 100% rename from cmd/server/executor.go rename to cmd/vela-worker/executor.go diff --git a/cmd/server/main.go b/cmd/vela-worker/main.go similarity index 100% rename from cmd/server/main.go rename to cmd/vela-worker/main.go diff --git a/cmd/server/operate.go b/cmd/vela-worker/operate.go similarity index 100% rename from cmd/server/operate.go rename to cmd/vela-worker/operate.go diff --git a/cmd/server/queue.go b/cmd/vela-worker/queue.go similarity index 100% rename from cmd/server/queue.go rename to cmd/vela-worker/queue.go diff --git a/cmd/server/server.go b/cmd/vela-worker/server.go similarity index 100% rename from cmd/server/server.go rename to cmd/vela-worker/server.go diff --git a/cmd/server/validate.go b/cmd/vela-worker/validate.go similarity index 100% rename from cmd/server/validate.go rename to cmd/vela-worker/validate.go From 50f03b0523c32302a29414b4efc80f159253c85e Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 23 Mar 2020 15:50:16 -0500 Subject: [PATCH 076/430] refactor: worker startup process (#68) --- cmd/vela-worker/client.go | 11 ++-- cmd/vela-worker/executor.go | 58 ----------------- cmd/vela-worker/flags.go | 97 ++++++++++++++++++++++++++++ cmd/vela-worker/main.go | 105 +++++++------------------------ cmd/vela-worker/operate.go | 122 +----------------------------------- cmd/vela-worker/queue.go | 23 ++++--- cmd/vela-worker/run.go | 92 +++++++++++++++++++++++++++ cmd/vela-worker/server.go | 120 +++-------------------------------- cmd/vela-worker/start.go | 53 ++++++++++++++++ cmd/vela-worker/validate.go | 84 ++++++------------------- cmd/vela-worker/worker.go | 51 +++++++++++++++ executor/linux/service.go | 2 +- executor/linux/step.go | 2 +- go.mod | 14 ++--- go.sum | 16 ++++- 15 files changed, 380 insertions(+), 470 deletions(-) delete mode 100644 cmd/vela-worker/executor.go create mode 100644 cmd/vela-worker/flags.go create mode 100644 cmd/vela-worker/run.go create mode 100644 cmd/vela-worker/start.go create mode 100644 cmd/vela-worker/worker.go diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 5ec6780b..622c4ac5 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -7,20 +7,19 @@ package main import ( "github.com/go-vela/sdk-go/vela" - log "github.com/sirupsen/logrus" - "github.com/urfave/cli" + "github.com/sirupsen/logrus" ) // helper function to setup the queue from the CLI arguments. -func setupClient(c *cli.Context) (*vela.Client, error) { - log.Debug("Creating vela client from CLI configuration") +func setupClient(s *Server) (*vela.Client, error) { + logrus.Debug("creating vela client from worker configuration") - vela, err := vela.NewClient(c.String("server-addr"), nil) + vela, err := vela.NewClient(s.Address, nil) if err != nil { return nil, err } // set token for auth - vela.Authentication.SetTokenAuth(c.String("vela-secret")) + vela.Authentication.SetTokenAuth(s.Secret) return vela, nil } diff --git a/cmd/vela-worker/executor.go b/cmd/vela-worker/executor.go deleted file mode 100644 index bc3627f6..00000000 --- a/cmd/vela-worker/executor.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package main - -import ( - "fmt" - - "github.com/go-vela/pkg-runtime/runtime" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/constants" - - "github.com/go-vela/worker/executor" - "github.com/go-vela/worker/executor/linux" - - "github.com/sirupsen/logrus" - - "github.com/urfave/cli" -) - -// helper function to setup the queue from the CLI arguments. -func setupExecutor(c *cli.Context, client *vela.Client, r runtime.Engine) (executor.Engine, error) { - logrus.Debug("Creating executor clients from CLI configuration") - - switch c.String("executor-driver") { - case constants.DriverDarwin: - return setupDarwin(client, r) - case constants.DriverLinux: - return setupLinux(client, r) - case constants.DriverWindows: - return setupWindows(client, r) - default: - return nil, fmt.Errorf("invalid executor driver: %s", c.String("executor-driver")) - } -} - -// helper function to setup the Darwin executor from the CLI arguments. -func setupDarwin(client *vela.Client, r runtime.Engine) (executor.Engine, error) { - logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverDarwin) - // return darwin.New(client, r) - return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverDarwin) -} - -// helper function to setup the Linux executor from the CLI arguments. -func setupLinux(client *vela.Client, r runtime.Engine) (executor.Engine, error) { - logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverLinux) - return linux.New(client, r) -} - -// helper function to setup the Windows executor from the CLI arguments. -func setupWindows(client *vela.Client, r runtime.Engine) (executor.Engine, error) { - logrus.Tracef("Creating %s executor client from CLI configuration", constants.DriverWindows) - // return windows.New(client, r) - return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverWindows) -} diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go new file mode 100644 index 00000000..bb3bfa0e --- /dev/null +++ b/cmd/vela-worker/flags.go @@ -0,0 +1,97 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "time" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/urfave/cli" +) + +func flags() []cli.Flag { + f := []cli.Flag{ + + cli.StringFlag{ + EnvVar: "WORKER_LOG_LEVEL,VELA_LOG_LEVEL,LOG_LEVEL", + Name: "log.level", + Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", + Value: "info", + }, + + // API Flags + + cli.StringFlag{ + EnvVar: "WORKER_API_PORT,VELA_API_PORT,API_PORT", + Name: "api.port", + Usage: "API port for the worker to listen on", + Value: ":8080", + }, + + // Build Flags + + cli.IntFlag{ + EnvVar: "WORKER_BUILD_LIMIT,VELA_BUILD_LIMIT,BUILD_LIMIT", + Name: "build.limit", + Usage: "maximum amount of builds that can run concurrently", + Value: 1, + }, + cli.DurationFlag{ + EnvVar: "WORKER_BUILD_TIMEOUT,VELA_BUILD_TIMEOUT,BUILD_TIMEOUT", + Name: "build.timeout", + Usage: "maximum amount of time a build can run for", + Value: 30 * time.Minute, + }, + + // Queue Flags + + cli.StringFlag{ + EnvVar: "VELA_QUEUE_DRIVER,QUEUE_DRIVER", + Name: "queue.driver", + Usage: "queue driver", + }, + cli.StringFlag{ + EnvVar: "VELA_QUEUE_CONFIG,QUEUE_CONFIG", + Name: "queue.config", + Usage: "queue driver configuration string", + }, + cli.BoolFlag{ + EnvVar: "VELA_QUEUE_CLUSTER,QUEUE_CLUSTER", + Name: "queue.cluster", + Usage: "queue client is setup for clusters", + }, + // By default all builds are pushed to the "vela" route + cli.StringSliceFlag{ + EnvVar: "VELA_QUEUE_ROUTES,QUEUE_ROUTES", + Name: "queue.routes", + Usage: "queue routes (channels) the worker is listening on for builds", + }, + + // Server Flags + + cli.StringFlag{ + EnvVar: "WORKER_SERVER_ADDR,VELA_SERVER_ADDR,VELA_SERVER,SERVER_ADDR", + Name: "server.addr", + Usage: "Vela server address as a fully qualified url (://)", + }, + cli.StringFlag{ + EnvVar: "WORKER_SERVER_SECRET,VELA_SERVER_SECRET,SERVER_SECRET", + Name: "server.secret", + Usage: "secret used for server <-> worker communication", + }, + } + + // Executor Flags + + f = append(f, executor.Flags...) + + // Runtime Flags + + f = append(f, runtime.Flags...) + + return f +} diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index f0c664b8..fb6fdbf3 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -11,104 +11,43 @@ import ( "github.com/go-vela/worker/version" "github.com/sirupsen/logrus" + "github.com/urfave/cli" + + _ "github.com/joho/godotenv/autoload" ) func main() { app := cli.NewApp() - app.Name = "vela-worker" - app.Action = server - app.Version = version.Version.String() - app.Flags = []cli.Flag{ - cli.StringFlag{ - Name: "server-port", - Usage: "API port to listen on", - EnvVar: "VELA_PORT", - Value: ":8080", - }, - cli.StringFlag{ - EnvVar: "VELA_LOG_LEVEL,LOG_LEVEL", - Name: "log-level", - Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", - Value: "info", - }, - cli.StringFlag{ - EnvVar: "VELA_ADDR,VELA_HOST", - Name: "server-addr", - Usage: "server address as a fully qualified url (://)", - }, - cli.StringFlag{ - EnvVar: "VELA_SECRET", - Name: "vela-secret", - Usage: "secret used for server <-> worker communication", - }, + // Worker Information - // Executor Flags - cli.StringFlag{ - EnvVar: "VELA_EXECUTOR_DRIVER,EXECUTOR_DRIVER", - Name: "executor-driver", - Usage: "executor driver", - Value: "linux", - }, - cli.IntFlag{ - EnvVar: "VELA_EXECUTOR_THREADS,EXECUTOR_THREADS", - Name: "executor-threads", - Usage: "number of executor threads to create", - Value: 1, - }, - cli.DurationFlag{ - EnvVar: "VELA_EXECUTOR_TIMEOUT,EXECUTOR_TIMEOUT", - Name: "executor-timeout", - Usage: "max time an executor will run a build", - Value: 60 * time.Minute, + app.Name = "vela-worker" + app.HelpName = "vela-executor" + app.Usage = "Vela executor package for integrating with different executors" + app.Copyright = "Copyright (c) 2020 Target Brands, Inc. All rights reserved." + app.Authors = []cli.Author{ + { + Name: "Vela Admins", + Email: "vela@target.com", }, + } - // Queue Flags - cli.StringFlag{ - EnvVar: "VELA_QUEUE_DRIVER,QUEUE_DRIVER", - Name: "queue-driver", - Usage: "queue driver", - }, - cli.StringFlag{ - EnvVar: "VELA_QUEUE_CONFIG,QUEUE_CONFIG", - Name: "queue-config", - Usage: "queue driver configuration string", - }, - cli.BoolFlag{ - EnvVar: "VELA_QUEUE_CLUSTER,QUEUE_CLUSTER", - Name: "queue-cluster", - Usage: "queue client is setup for clusters", - }, - // By default all builds are pushed to the "vela" route - cli.StringSliceFlag{ - EnvVar: "VELA_QUEUE_WORKER_ROUTES,QUEUE_WORKER_ROUTES", - Name: "queue-worker-routes", - Usage: "queue worker routes is configuration for routing builds", - }, + // Worker Metadata - // Runtime Flags + app.Compiled = time.Now() + app.Action = run + app.Version = version.Version.String() - cli.StringFlag{ - EnvVar: "VELA_RUNTIME_DRIVER,RUNTIME_DRIVER", - Name: "runtime.driver", - Usage: "name of runtime driver to use", - }, - cli.StringFlag{ - EnvVar: "VELA_RUNTIME_CONFIG,RUNTIME_CONFIG", - Name: "runtime.config", - Usage: "path to runtime configuration file", - }, - cli.StringFlag{ - EnvVar: "VELA_RUNTIME_NAMESPACE,RUNTIME_NAMESPACE", - Name: "runtime.namespace", - Usage: "name of namespace for runtime configuration (kubernetes runtime only)", - }, - } + // Worker Flags + + app.Flags = flags() // set logrus to log in JSON format logrus.SetFormatter(&logrus.JSONFormatter{}) + // Worker Start + err := app.Run(os.Args) if err != nil { logrus.Fatal(err) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 297e06a0..bddb13fc 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -4,125 +4,7 @@ package main -import ( - "context" - "os" - "os/signal" - "syscall" - "time" - - "github.com/go-vela/worker/executor" - - "github.com/go-vela/worker/queue" - - "github.com/sirupsen/logrus" - "golang.org/x/sync/errgroup" -) - -func operate(q queue.Service, e map[int]executor.Engine, t time.Duration) (err error) { - threads := new(errgroup.Group) - - for id, executor := range e { - logrus.Infof("Thread ID %d listening to queue...", id) - threads.Go(func() error { - for { - // pop an item from the queue - item, err := q.Pop() - if err != nil { - return err - } - - // create logger with extra metadata - logger := logrus.WithFields(logrus.Fields{ - "build": item.Build.GetNumber(), - "repo": item.Repo.GetFullName(), - }) - - // add build metadata to the executor - executor.WithBuild(item.Build) - executor.WithPipeline(item.Pipeline) - executor.WithRepo(item.Repo) - executor.WithUser(item.User) - - // check if the repository has a custom timeout - if item.Repo.GetTimeout() > 0 { - // update timeout variable to repository custom timeout - t = time.Duration(item.Repo.GetTimeout()) * time.Minute - } - - ctx := context.Background() - - // add to the background context with a timeout - // built in for ensuring a build doesn't run forever - ctx, timeout := context.WithTimeout(ctx, t) - defer timeout() - - // add signals to the parent context so - // users can cancel builds - sigchan := make(chan os.Signal, 1) - ctx, sig := context.WithCancel(ctx) - signal.Notify(sigchan, syscall.SIGTERM) - defer func() { - signal.Stop(sigchan) - sig() - }() - go func() { - select { - case <-sigchan: - sig() - case <-ctx.Done(): - } - }() - - defer func() { - // destroy the build on the executor - logger.Info("destroying build") - err = executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - }() - - // create the build on the executor - logger.Info("creating build") - err = executor.CreateBuild(ctx) - if err != nil { - logger.Errorf("unable to create build: %v", err) - return err - } - - // plan the build on the executor - logger.Info("creating build") - err = executor.PlanBuild(ctx) - if err != nil { - logger.Errorf("unable to plan build: %v", err) - return err - } - - // execute the build on the executor - logger.Info("executing build") - err = executor.ExecBuild(ctx) - if err != nil { - logger.Errorf("unable to execute build: %v", err) - return err - } - - // destroy the build on the executor - logger.Info("destroying build") - err = executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - - logger.Info("completed build") - } - }) - } - - err = threads.Wait() - if err != nil { - return err - } - +// operate is a helper function to ... +func (w *Worker) operate() error { return nil } diff --git a/cmd/vela-worker/queue.go b/cmd/vela-worker/queue.go index e73cee2e..c71df3d4 100644 --- a/cmd/vela-worker/queue.go +++ b/cmd/vela-worker/queue.go @@ -13,41 +13,40 @@ import ( "github.com/go-vela/worker/queue/redis" "github.com/sirupsen/logrus" - "github.com/urfave/cli" ) // helper function to setup the queue from the CLI arguments. -func setupQueue(c *cli.Context) (queue.Service, error) { +func setupQueue(q *queueSetup) (queue.Service, error) { logrus.Debug("Creating queue client from CLI configuration") - switch c.String("queue-driver") { + switch q.Driver { case constants.DriverKafka: - return setupKafka(c) + return setupKafka(q) case constants.DriverRedis: - return setupRedis(c) + return setupRedis(q) default: - return nil, fmt.Errorf("invalid queue driver: %s", c.String("queue-driver")) + return nil, fmt.Errorf("invalid queue driver: %s", q.Driver) } } // helper function to setup the Kafka queue from the CLI arguments. -func setupKafka(c *cli.Context) (queue.Service, error) { +func setupKafka(q *queueSetup) (queue.Service, error) { logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverKafka) // return kafka.New(c.String("queue-config"), "vela") return nil, fmt.Errorf("unsupported queue driver: %s", constants.DriverKafka) } // helper function to setup the Redis queue from the CLI arguments. -func setupRedis(c *cli.Context) (queue.Service, error) { +func setupRedis(q *queueSetup) (queue.Service, error) { // setup routes - routes := append(c.StringSlice("queue-worker-routes"), constants.DefaultRoute) + routes := append(q.Routes, constants.DefaultRoute) - if c.Bool("queue-cluster") { + if q.Cluster { logrus.Tracef("Creating %s queue cluster client from CLI configuration", constants.DriverRedis) - return redis.NewCluster(c.String("queue-config"), routes...) + return redis.NewCluster(q.Config, routes...) } logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverRedis) - return redis.New(c.String("queue-config"), routes...) + return redis.New(q.Config, routes...) } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go new file mode 100644 index 00000000..565e2383 --- /dev/null +++ b/cmd/vela-worker/run.go @@ -0,0 +1,92 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "github.com/gin-gonic/gin" + + "github.com/go-vela/pkg-executor/executor" + + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/sirupsen/logrus" + + "github.com/urfave/cli" + + _ "github.com/joho/godotenv/autoload" +) + +// run executes the worker based off the configuration provided. +func run(c *cli.Context) error { + // set log level for the worker + switch c.String("log.level") { + case "t", "trace", "Trace", "TRACE": + gin.SetMode(gin.DebugMode) + logrus.SetLevel(logrus.TraceLevel) + case "d", "debug", "Debug", "DEBUG": + gin.SetMode(gin.DebugMode) + logrus.SetLevel(logrus.DebugLevel) + case "i", "info", "Info", "INFO": + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.InfoLevel) + case "w", "warn", "Warn", "WARN": + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.WarnLevel) + case "e", "error", "Error", "ERROR": + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.ErrorLevel) + case "f", "fatal", "Fatal", "FATAL": + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.FatalLevel) + case "p", "panic", "Panic", "PANIC": + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.PanicLevel) + } + + logrus.WithFields(logrus.Fields{ + "code": "https://github.com/go-vela/worker/", + "docs": "https://go-vela.github.io/docs/concepts/infrastructure/worker/", + "registry": "https://hub.docker.com/r/target/vela-worker/", + }).Info("Vela Worker") + + // create the worker + w := &Worker{ + // api configuration + API: &API{ + Port: c.String("api.port"), + }, + // executor configuration + Executor: &executor.Setup{ + Driver: c.String("executor.driver"), + }, + // runtime configuration + Runtime: &runtime.Setup{ + Driver: c.String("runtime.driver"), + Config: c.String("runtime.config"), + Namespace: c.String("runtime.namespace"), + }, + // queue configuration + Queue: &queueSetup{ + Driver: c.String("queue.driver"), + Config: c.String("queue.config"), + Cluster: c.Bool("queue.cluster"), + Routes: c.StringSlice("queue.routes"), + }, + // server configuration + Server: &Server{ + Address: c.String("server.addr"), + Secret: c.String("server.secret"), + }, + } + + // validate the worker + err := w.Validate() + if err != nil { + return err + } + + // start the worker + return w.Start() +} diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 5f308e2f..669347b3 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -5,129 +5,25 @@ package main import ( - "context" - "net/http" "time" - "github.com/go-vela/pkg-runtime/runtime" - - "github.com/go-vela/worker/executor" "github.com/go-vela/worker/router" "github.com/go-vela/worker/router/middleware" - "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" - - "github.com/urfave/cli" - tomb "gopkg.in/tomb.v2" ) -func server(c *cli.Context) error { - // validate all input - err := validate(c) - if err != nil { - return err - } - - // set log level for logrus - switch c.String("log-level") { - case "t", "trace", "Trace", "TRACE": - gin.SetMode(gin.DebugMode) - logrus.SetLevel(logrus.TraceLevel) - case "d", "debug", "Debug", "DEBUG": - gin.SetMode(gin.DebugMode) - logrus.SetLevel(logrus.DebugLevel) - case "i", "info", "Info", "INFO": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.InfoLevel) - case "w", "warn", "Warn", "WARN": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.WarnLevel) - case "e", "error", "Error", "ERROR": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.ErrorLevel) - case "f", "fatal", "Fatal", "FATAL": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.FatalLevel) - case "p", "panic", "Panic", "PANIC": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.PanicLevel) - } - - // create a vela client - vela, err := setupClient(c) - if err != nil { - return err - } - - // create the runtime client - r, err := runtime.New(&runtime.Setup{ - Driver: c.String("runtime.driver"), - Config: c.String("runtime.config"), - Namespace: c.String("runtime.namespace"), - }) - if err != nil { - return err - } - - // create a queue client - queue, err := setupQueue(c) - if err != nil { - return err - } - - // create the executor clients - executors := make(map[int]executor.Engine) - - for i := 0; i < c.Int("executor-threads"); i++ { - executor, err := setupExecutor(c, vela, r) - if err != nil { - return err - } - - executors[i] = executor - } - +// server is a helper function to ... +func (w *Worker) server() error { + // create the worker router to listen and serve traffic router := router.Load( middleware.RequestVersion, - middleware.Executor(executors), - middleware.Secret(c.String("vela-secret")), + // TODO: make this do stuff + // middleware.Executor(w.Executors), + middleware.Secret(w.Server.Secret), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) - tomb := new(tomb.Tomb) - tomb.Go(func() error { - // Start server - srv := &http.Server{Addr: c.String("server-port"), Handler: router} - - go func() { - logrus.Info("Starting HTTP server...") - err := srv.ListenAndServe() - if err != nil { - tomb.Kill(err) - } - }() - - go func() { - logrus.Info("Starting operator...") - // TODO: refactor due to one thread killing entire worker - err := operate(queue, executors, c.Duration("executor-timeout")) - if err != nil { - tomb.Kill(err) - } - }() - - for { - select { - case <-tomb.Dying(): - logrus.Info("Stopping HTTP server...") - return srv.Shutdown(context.Background()) - } - } - }) - - // Wait for stuff and watch for errors - tomb.Wait() - - return tomb.Err() + // start serving traffic on the provided worker port + return router.Run(w.API.Port) } diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go new file mode 100644 index 00000000..34d61f91 --- /dev/null +++ b/cmd/vela-worker/start.go @@ -0,0 +1,53 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "log" + + "github.com/sirupsen/logrus" + + tomb "gopkg.in/tomb.v2" +) + +// Start does stuff... +func (w *Worker) Start() error { + // create the tomb for managing worker processes + tomb := new(tomb.Tomb) + + // spawn a tomb goroutine to manage the worker processes + tomb.Go(func() error { + // spawn goroutine for starting the worker + go func() { + logrus.Info("starting worker server") + // start the server for the worker + err := w.server() + if err != nil { + tomb.Kill(err) + } + }() + + // spawn goroutine for starting the operator + go func() { + logrus.Info("starting worker operator") + // start the operator for the worker + err := w.operate() + if err != nil { + tomb.Kill(err) + } + }() + + for { + select { + case <-tomb.Dying(): + log.Fatal("shutting down worker") + return tomb.Err() + } + } + }) + + // watch for errors from worker processes + return tomb.Wait() +} diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 24b813b1..69484c6c 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -6,85 +6,37 @@ package main import ( "fmt" - "strings" "github.com/sirupsen/logrus" - "github.com/urfave/cli" ) -// helper function to validate all CLI configuration. -func validate(c *cli.Context) error { - logrus.Debug("Validating CLI configuration") +// Validate verifies the Worker is properly configured. +func (w *Worker) Validate() error { + logrus.Info("validating worker configuration") - // validate core configuration - err := validateCore(c) - if err != nil { - return err + // verify a build limit was provided + if w.Build.Limit <= 0 { + return fmt.Errorf("no worker build limit provided") } - // validate executor configuration - err = validateExecutor(c) - if err != nil { - return err + // verify a build timeout was provided + if w.Build.Timeout <= 0 { + return fmt.Errorf("no worker build timeout provided") } - // validate queue configuration - err = validateQueue(c) - if err != nil { - return err + // verify an executor driver was provided + if len(w.Executor.Driver) == 0 { + return fmt.Errorf("no worker executor driver provided") } - return nil -} - -// helper function to validate the core CLI configuration. -func validateCore(c *cli.Context) error { - logrus.Trace("Validating core CLI configuration") - - if len(c.String("server-addr")) == 0 { - return fmt.Errorf("server-addr (VELA_ADDR or VELA_HOST) flag not specified") - } - - if !strings.Contains(c.String("server-addr"), "://") { - return fmt.Errorf("server-addr (VELA_ADDR or VELA_HOST) flag must be :// format") - } - - if strings.HasSuffix(c.String("server-addr"), "/") { - return fmt.Errorf("server-addr (VELA_ADDR or VELA_HOST) flag must not have trailing slash") - } - - if len(c.String("vela-secret")) == 0 { - return fmt.Errorf("vela-secret (VELA_SECRET) flag not specified") - } - - return nil -} - -// helper function to validate the executor CLI configuration. -func validateExecutor(c *cli.Context) error { - logrus.Trace("Validating executor CLI configuration") - - if len(c.String("executor-driver")) == 0 { - return fmt.Errorf("executor-driver (VELA_EXECUTOR_DRIVER or EXECUTOR_DRIVER) flag not specified") - } - - if c.Int("executor-threads") < 1 { - return fmt.Errorf("executor-threads (VELA_EXECUTOR_THREADS or EXECUTOR_THREADS) flag improperly configured") - } - - return nil -} - -// helper function to validate the queue CLI configuration. -func validateQueue(c *cli.Context) error { - logrus.Trace("Validating queue CLI configuration") - - if len(c.String("queue-driver")) == 0 { - return fmt.Errorf("queue-driver (VELA_QUEUE_DRIVER or QUEUE_DRIVER) flag not specified") + // verify a queue driver was provided + if len(w.Queue.Driver) == 0 { + return fmt.Errorf("no worker queue driver provided") } - if len(c.String("queue-config")) == 0 { - return fmt.Errorf("queue-config (VELA_QUEUE_CONFIG or QUEUE_CONFIG) flag not specified") + // verify a runtime driver was provided + if len(w.Runtime.Driver) == 0 { + return fmt.Errorf("no worker runtime driver provided") } return nil diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go new file mode 100644 index 00000000..b09a27d9 --- /dev/null +++ b/cmd/vela-worker/worker.go @@ -0,0 +1,51 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "time" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-runtime/runtime" +) + +type ( + // TODO: implement github.com/go-vela/pkg-queue/queue.Setup + queueSetup struct { + Driver string + Config string + Cluster bool + Routes []string + } + + // API represents the worker configuration for API information. + API struct { + Port string + } + + // Build represents the worker configuration for build information. + Build struct { + Limit int + Timeout time.Duration + } + + // Server represents the worker configuration for server information. + Server struct { + Address string + Secret string + } + + // Worker represents the worker configuration. + Worker struct { + API *API + Build *Build + Executor *executor.Setup + // TODO: implement github.com/go-vela/pkg-queue/queue.Setup + // Queue *queue.Setup + Queue *queueSetup + Runtime *runtime.Setup + Server *Server + } +) diff --git a/executor/linux/service.go b/executor/linux/service.go index ee514ff5..a5c8cef3 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -98,7 +98,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error logger.Debug("running container") // run the runtime container - err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) + err := c.Runtime.RunContainer(ctx, ctn, c.pipeline) if err != nil { return err } diff --git a/executor/linux/step.go b/executor/linux/step.go index e20cac17..56ab5189 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -152,7 +152,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { logger.Debug("running container") // run the runtime container - err := c.Runtime.RunContainer(ctx, c.pipeline, ctn) + err := c.Runtime.RunContainer(ctx, ctn, c.pipeline) if err != nil { return err } diff --git a/go.mod b/go.mod index 89d2687b..031b5cdf 100644 --- a/go.mod +++ b/go.mod @@ -3,24 +3,20 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.3.0 - github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f - github.com/go-vela/sdk-go v0.3.0 + github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce + github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 + github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 github.com/google/go-cmp v0.3.1 - github.com/mattn/go-isatty v0.0.11 // indirect - github.com/onsi/ginkgo v1.10.3 // indirect - github.com/onsi/gomega v1.7.1 // indirect + github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 - github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect - github.com/prometheus/procfs v0.0.8 // indirect github.com/sirupsen/logrus v1.4.2 - github.com/urfave/cli v1.22.2 + github.com/urfave/cli v1.22.3 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index 1063238b..741bac6a 100644 --- a/go.sum +++ b/go.sum @@ -62,6 +62,7 @@ github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkg github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -94,14 +95,21 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-vela/compiler v0.3.1-0.20200302143952-6a5a26ba1fbc/go.mod h1:rO03l8MoeyQkhd450SnphZquB7l7Qs+cT/3BIVq8MfE= github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= -github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f h1:YjvfuA6UXz4Yqiy0QtRgCq0Wepznk4YsC52niCsWzeQ= -github.com/go-vela/pkg-runtime v0.0.0-20200310201623-9a57cb34364f/go.mod h1:J2xYqm8CgZpqQUojPWuLnYgJWS6hknr5rgZst9qKP84= +github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce h1:NOB5XcuWvaXvyQ29PERNwL2G4qFQnEer0fQZqyhuGcU= +github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce/go.mod h1:XoCJlIPkjC0s4/vn/L2Gu05FrfH6ceO+K4oAPPquiKc= +github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40 h1:HVgm8JDG+nziVBa2yA1nXzg3GUVUa8Kvrlg6f9n8yQc= +github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40/go.mod h1:J2xYqm8CgZpqQUojPWuLnYgJWS6hknr5rgZst9qKP84= +github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 h1:itH+bt9u9UjnUignpZjeC4IO2QTyEV+JZpUjvMaseVc= +github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6/go.mod h1:kXPhZCxsVJjDK9enk3x80WHwB9q65l269qivJwQTjG8= github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= +github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 h1:UluZMmYC/AHpmhOqB2n9YPCj2vAYi2aeYNwOdKAA+o4= +github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 h1:5+2BLMClLg+o6mky5G0xRTfw/15zOyyZhJKWp726vu4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/worker v0.3.1/go.mod h1:V6G7l2gehP3zG6SCN+76H+5edoC13YWGU7tDYWpP7B4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -149,6 +157,7 @@ github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -263,6 +272,8 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.3 h1:FpNT6zq26xNpHZy08emi755QwzLPs6Pukqjlc7RfOMU= +github.com/urfave/cli v1.22.3/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -402,6 +413,7 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUc k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= From f598c208d93c23cfb5e73c864e4dd32a7710f398 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 24 Mar 2020 12:15:50 -0500 Subject: [PATCH 077/430] feat: use new queue pkg (#69) * feat: use new queue pkg * chore: tidy go dependencies --- cmd/vela-worker/flags.go | 29 ++----- cmd/vela-worker/queue.go | 52 ------------- cmd/vela-worker/run.go | 4 +- cmd/vela-worker/worker.go | 17 +--- go.mod | 2 +- go.sum | 37 +++++++++ queue/context.go | 42 ---------- queue/doc.go | 11 --- queue/queue.go | 16 ---- queue/redis/doc.go | 11 --- queue/redis/pull.go | 30 -------- queue/redis/redis.go | 158 -------------------------------------- 12 files changed, 49 insertions(+), 360 deletions(-) delete mode 100644 cmd/vela-worker/queue.go delete mode 100644 queue/context.go delete mode 100644 queue/doc.go delete mode 100644 queue/queue.go delete mode 100644 queue/redis/doc.go delete mode 100644 queue/redis/pull.go delete mode 100644 queue/redis/redis.go diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index bb3bfa0e..18ca8a3d 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -8,6 +8,7 @@ import ( "time" "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" "github.com/urfave/cli" @@ -47,30 +48,6 @@ func flags() []cli.Flag { Value: 30 * time.Minute, }, - // Queue Flags - - cli.StringFlag{ - EnvVar: "VELA_QUEUE_DRIVER,QUEUE_DRIVER", - Name: "queue.driver", - Usage: "queue driver", - }, - cli.StringFlag{ - EnvVar: "VELA_QUEUE_CONFIG,QUEUE_CONFIG", - Name: "queue.config", - Usage: "queue driver configuration string", - }, - cli.BoolFlag{ - EnvVar: "VELA_QUEUE_CLUSTER,QUEUE_CLUSTER", - Name: "queue.cluster", - Usage: "queue client is setup for clusters", - }, - // By default all builds are pushed to the "vela" route - cli.StringSliceFlag{ - EnvVar: "VELA_QUEUE_ROUTES,QUEUE_ROUTES", - Name: "queue.routes", - Usage: "queue routes (channels) the worker is listening on for builds", - }, - // Server Flags cli.StringFlag{ @@ -89,6 +66,10 @@ func flags() []cli.Flag { f = append(f, executor.Flags...) + // Queue Flags + + f = append(f, queue.Flags...) + // Runtime Flags f = append(f, runtime.Flags...) diff --git a/cmd/vela-worker/queue.go b/cmd/vela-worker/queue.go deleted file mode 100644 index c71df3d4..00000000 --- a/cmd/vela-worker/queue.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package main - -import ( - "fmt" - - "github.com/go-vela/types/constants" - - "github.com/go-vela/worker/queue" - "github.com/go-vela/worker/queue/redis" - - "github.com/sirupsen/logrus" -) - -// helper function to setup the queue from the CLI arguments. -func setupQueue(q *queueSetup) (queue.Service, error) { - logrus.Debug("Creating queue client from CLI configuration") - - switch q.Driver { - case constants.DriverKafka: - return setupKafka(q) - case constants.DriverRedis: - return setupRedis(q) - default: - return nil, fmt.Errorf("invalid queue driver: %s", q.Driver) - } -} - -// helper function to setup the Kafka queue from the CLI arguments. -func setupKafka(q *queueSetup) (queue.Service, error) { - logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverKafka) - // return kafka.New(c.String("queue-config"), "vela") - return nil, fmt.Errorf("unsupported queue driver: %s", constants.DriverKafka) -} - -// helper function to setup the Redis queue from the CLI arguments. -func setupRedis(q *queueSetup) (queue.Service, error) { - // setup routes - routes := append(q.Routes, constants.DefaultRoute) - - if q.Cluster { - logrus.Tracef("Creating %s queue cluster client from CLI configuration", constants.DriverRedis) - return redis.NewCluster(q.Config, routes...) - } - - logrus.Tracef("Creating %s queue client from CLI configuration", constants.DriverRedis) - - return redis.New(q.Config, routes...) -} diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 565e2383..8a6edf3d 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -8,7 +8,7 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/pkg-executor/executor" - + "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" "github.com/sirupsen/logrus" @@ -68,7 +68,7 @@ func run(c *cli.Context) error { Namespace: c.String("runtime.namespace"), }, // queue configuration - Queue: &queueSetup{ + Queue: &queue.Setup{ Driver: c.String("queue.driver"), Config: c.String("queue.config"), Cluster: c.Bool("queue.cluster"), diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index b09a27d9..9c36a8d5 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -8,18 +8,11 @@ import ( "time" "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" ) type ( - // TODO: implement github.com/go-vela/pkg-queue/queue.Setup - queueSetup struct { - Driver string - Config string - Cluster bool - Routes []string - } - // API represents the worker configuration for API information. API struct { Port string @@ -42,10 +35,8 @@ type ( API *API Build *Build Executor *executor.Setup - // TODO: implement github.com/go-vela/pkg-queue/queue.Setup - // Queue *queue.Setup - Queue *queueSetup - Runtime *runtime.Setup - Server *Server + Queue *queue.Setup + Runtime *runtime.Setup + Server *Server } ) diff --git a/go.mod b/go.mod index 031b5cdf..cce5cc7b 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( github.com/coreos/go-semver v0.3.0 github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 - github.com/go-redis/redis v6.15.6+incompatible github.com/go-vela/mock v0.3.0 github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce + github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 diff --git a/go.sum b/go.sum index 741bac6a..62790100 100644 --- a/go.sum +++ b/go.sum @@ -10,7 +10,11 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= +github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= +github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= @@ -25,6 +29,11 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U= +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= +github.com/alicebob/miniredis/v2 v2.11.4 h1:GsuyeunTx7EllZBU3/6Ji3dhMQZDpC9rLf1luJ+6M5M= +github.com/alicebob/miniredis/v2 v2.11.4/go.mod h1:VL3UDEfAH59bSa7MuHMuFToxkqyHh69s/WUbYlOAuyg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -35,6 +44,9 @@ github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReG github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -91,12 +103,16 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= +github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.3.1-0.20200302143952-6a5a26ba1fbc/go.mod h1:rO03l8MoeyQkhd450SnphZquB7l7Qs+cT/3BIVq8MfE= github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce h1:NOB5XcuWvaXvyQ29PERNwL2G4qFQnEer0fQZqyhuGcU= github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce/go.mod h1:XoCJlIPkjC0s4/vn/L2Gu05FrfH6ceO+K4oAPPquiKc= +github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 h1:k+fWWmmBEqpWqdHoPFprmU6yNN84VipQQP49wORLzus= +github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50/go.mod h1:A6Wk/bIng02YxbEY3N7pUHZcYZyp4LW02dPI76zEPkE= github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40 h1:HVgm8JDG+nziVBa2yA1nXzg3GUVUa8Kvrlg6f9n8yQc= github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40/go.mod h1:J2xYqm8CgZpqQUojPWuLnYgJWS6hknr5rgZst9qKP84= github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 h1:itH+bt9u9UjnUignpZjeC4IO2QTyEV+JZpUjvMaseVc= @@ -125,6 +141,9 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -140,6 +159,7 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= @@ -186,6 +206,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= @@ -212,10 +234,14 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -274,6 +300,10 @@ github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.3 h1:FpNT6zq26xNpHZy08emi755QwzLPs6Pukqjlc7RfOMU= github.com/urfave/cli v1.22.3/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= +github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -320,6 +350,7 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -331,6 +362,7 @@ golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -352,6 +384,9 @@ 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-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -385,6 +420,8 @@ gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8 gopkg.in/go-playground/validator.v9 v9.30.2/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/square/go-jose.v2 v2.4.1 h1:H0TmLt7/KmzlrDOpa1F+zr0Tk90PbJYBfsVUmRLrf9Y= +gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= diff --git a/queue/context.go b/queue/context.go deleted file mode 100644 index 62175911..00000000 --- a/queue/context.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package queue - -import ( - "context" -) - -// key defines the key type for storing -// the queue Service in the context. -const key = "queue" - -// Setter defines a context that enables setting values. -type Setter interface { - Set(string, interface{}) -} - -// FromContext returns the queue Service -// associated with this context. -func FromContext(c context.Context) Service { - // get queue value from context - v := c.Value(key) - if v == nil { - return nil - } - - // cast queue value to expected Service type - q, ok := v.(Service) - if !ok { - return nil - } - - return q -} - -// ToContext adds the queue Service to this -// context if it supports the Setter interface. -func ToContext(c Setter, q Service) { - c.Set(key, q) -} diff --git a/queue/doc.go b/queue/doc.go deleted file mode 100644 index 87de9f30..00000000 --- a/queue/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package queue provides the ability for Vela to integrate -// with different supported Queue backends. -// -// Usage: -// -// import "github.com/go-vela/worker/queue" -package queue diff --git a/queue/queue.go b/queue/queue.go deleted file mode 100644 index 5be5baf0..00000000 --- a/queue/queue.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package queue - -import ( - "github.com/go-vela/types" -) - -// Service represents the interface for Vela integrating -// with the different supported Queue backends. -type Service interface { - // Pop defines a function that grabs an item off the queue. - Pop() (*types.Item, error) -} diff --git a/queue/redis/doc.go b/queue/redis/doc.go deleted file mode 100644 index 341b9dcf..00000000 --- a/queue/redis/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package redis provides the ability for Vela to -// integrate with a Redis server as a queue backend. -// -// Usage: -// -// import "github.com/go-vela/worker/queue/redis" -package redis diff --git a/queue/redis/pull.go b/queue/redis/pull.go deleted file mode 100644 index 1762aebf..00000000 --- a/queue/redis/pull.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package redis - -import ( - "encoding/json" - "fmt" - - "github.com/go-vela/types" -) - -// Pop grabs an item from the specified channel off the queue. -func (c *client) Pop() (*types.Item, error) { - // blocking list pop item from queue - result, err := c.Queue.BLPop(0, c.Channels...).Result() - if err != nil { - return nil, fmt.Errorf("unable to pop item from queue: %w", err) - } - - item := new(types.Item) - // unmarshal result into queue item - err = json.Unmarshal([]byte(result[1]), item) - if err != nil { - return nil, fmt.Errorf("unable to unmarshal item from queue: %w", err) - } - - return item, nil -} diff --git a/queue/redis/redis.go b/queue/redis/redis.go deleted file mode 100644 index 387c65d5..00000000 --- a/queue/redis/redis.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package redis - -import ( - "fmt" - "strings" - "time" - - "github.com/go-redis/redis" - "github.com/sirupsen/logrus" -) - -type client struct { - Queue *redis.Client - Options *redis.Options - Channels []string -} - -// New returns a Queue implementation that -// integrates with a Redis queue instance. -func New(url string, channels ...string) (*client, error) { - // parse the url provided - options, err := redis.ParseURL(url) - if err != nil { - return nil, err - } - - // create the Redis client from the parsed url - queue := redis.NewClient(options) - - // setup queue with proper configuration - err = setupQueue(queue) - if err != nil { - return nil, err - } - - // create the client object - client := &client{ - Queue: queue, - Options: options, - Channels: channels, - } - - return client, nil -} - -// NewCluster returns a Queue implementation that -// integrates with a Redis queue cluster. -func NewCluster(config string, channels ...string) (*client, error) { - // parse the url provided - options, err := redis.ParseURL(config) - if err != nil { - return nil, err - } - - // create the Redis client from failover options - queue := redis.NewFailoverClient(failoverFromOptions(options)) - - // setup queue with proper configuration - err = setupQueue(queue) - if err != nil { - return nil, err - } - - // create the client object - client := &client{ - Queue: queue, - Options: options, - Channels: channels, - } - - return client, nil -} - -// failoverFromOptions is a helper function to create -// the failover options from the parse options. -func failoverFromOptions(source *redis.Options) *redis.FailoverOptions { - target := &redis.FailoverOptions{ - OnConnect: source.OnConnect, - Password: source.Password, - DB: source.DB, - MaxRetries: source.MaxRetries, - MinRetryBackoff: source.MinRetryBackoff, - MaxRetryBackoff: source.MaxRetryBackoff, - DialTimeout: source.DialTimeout, - ReadTimeout: source.ReadTimeout, - WriteTimeout: source.WriteTimeout, - PoolSize: source.PoolSize, - MinIdleConns: source.MinIdleConns, - MaxConnAge: source.MaxConnAge, - PoolTimeout: source.PoolTimeout, - IdleTimeout: source.IdleTimeout, - IdleCheckFrequency: source.IdleCheckFrequency, - TLSConfig: source.TLSConfig, - } - - // trim auto appended :6379 from address - arrHosts := strings.TrimSuffix(source.Addr, ":6379") - - // remove array brackets from string - // creating a comma separated list - hosts := strings.TrimRight( - strings.TrimLeft(arrHosts, "["), "]", - ) - - // the first host from the csv list is set as - // the master node all subsequent hosts get - // added as sentinel nodes - for _, host := range strings.Split(hosts, ",") { - if len(target.MasterName) == 0 { - target.MasterName = host - continue - } - - target.SentinelAddrs = append(target.SentinelAddrs, host) - } - - return target -} - -// setupQueue is a helper function to setup the -// queue with the proper configuration. -func setupQueue(client *redis.Client) error { - // ping the queue - err := pingQueue(client) - if err != nil { - return err - } - - return nil -} - -// pingQueue is a helper function to send a "ping" -// request with backoff to the database. -// -// This will ensure we have properly established a -// connection to the Redis queue instance before -// we try to set it up. -func pingQueue(client *redis.Client) error { - // attempt 10 times - for i := 0; i < 10; i++ { - // send ping request to client - err := client.Ping().Err() - if err != nil { - logrus.Debugf("unable to ping Redis queue. Retrying in %v", (time.Duration(i) * time.Second)) - time.Sleep(1 * time.Second) - - continue - } - - return nil - } - - return fmt.Errorf("unable to establish connection to Redis queue") -} From ffb4844bf06512a5cf16e66493ca2e80e557182b Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 24 Mar 2020 13:57:46 -0500 Subject: [PATCH 078/430] feat(worker): add operate method (#70) * build: update compose for refactor * feat(worker): add operate method --- cmd/vela-worker/operate.go | 132 +++++++++++++++++++++++++++++++++++- cmd/vela-worker/run.go | 5 ++ cmd/vela-worker/start.go | 4 +- cmd/vela-worker/validate.go | 24 +++++-- docker-compose.yml | 20 +++--- 5 files changed, 164 insertions(+), 21 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index bddb13fc..ea38c92a 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -4,7 +4,137 @@ package main +import ( + "context" + "os" + "os/signal" + "syscall" + "time" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-queue/queue" + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/sirupsen/logrus" + + "golang.org/x/sync/errgroup" +) + // operate is a helper function to ... func (w *Worker) operate() error { - return nil + // setup the client + _client, err := setupClient(w.Server) + if err != nil { + logrus.Fatal(err) + } + + // setup the queue + _queue, err := queue.New(w.Queue) + if err != nil { + logrus.Fatal(err) + } + + executors := new(errgroup.Group) + + for i := 0; i < w.Build.Limit; i++ { + logrus.Infof("Thread ID %d listening to queue...", i) + executors.Go(func() error { + for { + // setup the runtime + _runtime, err := runtime.New(w.Runtime) + if err != nil { + logrus.Fatal(err) + } + + // capture an item from the queue + item, err := _queue.Pop() + if err != nil { + return err + } + + _executor, err := executor.New(&executor.Setup{ + Driver: w.Executor.Driver, + Client: _client, + Runtime: _runtime, + Build: item.Build, + Pipeline: item.Pipeline, + Repo: item.Repo, + User: item.User, + }) + + // create logger with extra metadata + logger := logrus.WithFields(logrus.Fields{ + "build": item.Build.GetNumber(), + "repo": item.Repo.GetFullName(), + }) + + t := w.Build.Timeout + // check if the repository has a custom timeout + if item.Repo.GetTimeout() > 0 { + // update timeout variable to repository custom timeout + t = time.Duration(item.Repo.GetTimeout()) * time.Minute + } + + ctx := context.Background() + + // add to the background context with a timeout + // built in for ensuring a build doesn't run forever + ctx, timeout := context.WithTimeout(ctx, t) + defer timeout() + + // add signals to the parent context so + // users can cancel builds + sigchan := make(chan os.Signal, 1) + ctx, sig := context.WithCancel(ctx) + signal.Notify(sigchan, syscall.SIGTERM) + defer func() { + signal.Stop(sigchan) + sig() + }() + go func() { + select { + case <-sigchan: + sig() + case <-ctx.Done(): + } + }() + + defer func() { + // destroy the build on the executor + logger.Info("destroying build") + err = _executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + }() + + // create the build on the executor + logger.Info("creating build") + err = _executor.CreateBuild(ctx) + if err != nil { + logger.Errorf("unable to create build: %v", err) + return err + } + + // execute the build on the executor + logger.Info("executing build") + err = _executor.ExecBuild(ctx) + if err != nil { + logger.Errorf("unable to execute build: %v", err) + return err + } + + // destroy the build on the executor + logger.Info("destroying build") + err = _executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + + logger.Info("completed build") + } + }) + } + + return executors.Wait() } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 8a6edf3d..80d632a9 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -57,6 +57,11 @@ func run(c *cli.Context) error { API: &API{ Port: c.String("api.port"), }, + // build configuration + Build: &Build{ + Limit: c.Int("build.limit"), + Timeout: c.Duration("build.timeout"), + }, // executor configuration Executor: &executor.Setup{ Driver: c.String("executor.driver"), diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 34d61f91..4dde23f4 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -5,8 +5,6 @@ package main import ( - "log" - "github.com/sirupsen/logrus" tomb "gopkg.in/tomb.v2" @@ -42,7 +40,7 @@ func (w *Worker) Start() error { for { select { case <-tomb.Dying(): - log.Fatal("shutting down worker") + logrus.Fatal("shutting down worker") return tomb.Err() } } diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 69484c6c..dce72056 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -24,19 +24,31 @@ func (w *Worker) Validate() error { return fmt.Errorf("no worker build timeout provided") } + // verify a server address was provided + if len(w.Server.Address) == 0 { + return fmt.Errorf("no worker server address provided") + } + + // verify a server secret was provided + if len(w.Server.Secret) == 0 { + return fmt.Errorf("no worker server secret provided") + } + // verify an executor driver was provided if len(w.Executor.Driver) == 0 { return fmt.Errorf("no worker executor driver provided") } - // verify a queue driver was provided - if len(w.Queue.Driver) == 0 { - return fmt.Errorf("no worker queue driver provided") + // verify the queue configuration + err := w.Queue.Validate() + if err != nil { + return err } - // verify a runtime driver was provided - if len(w.Runtime.Driver) == 0 { - return fmt.Errorf("no worker runtime driver provided") + // verify the runtime configuration + err = w.Runtime.Validate() + if err != nil { + return err } return nil diff --git a/docker-compose.yml b/docker-compose.yml index 13760606..4bb57815 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,16 +13,15 @@ services: networks: - vela environment: - VELA_ADDR: http://vela:8080 - VELA_EXECUTOR_THREADS: 1 + VELA_BUILD_LIMIT: 1 + VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker VELA_RUNTIME_DRIVER: docker - VELA_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh - VELA_VAULT_ADDR: http://vault:8200 - VELA_VAULT_TOKEN: vela + VELA_SERVER_ADDR: http://vela:8080 + VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh restart: always ports: - "8081:8080" @@ -35,16 +34,15 @@ services: networks: - vela environment: - VELA_ADDR: http://vela:8080 - VELA_EXECUTOR_THREADS: 1 + VELA_BUILD_LIMIT: 1 + VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 - VELA_QUEUE_WORKER_ROUTES: small,docker,small:docker + VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker VELA_RUNTIME_DRIVER: docker - VELA_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh - VELA_VAULT_ADDR: http://vault:8200 - VELA_VAULT_TOKEN: vela + VELA_SERVER_ADDR: http://vela:8080 + VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh restart: always ports: - "8082:8080" From 93d7f87be0db9628c207073295e3c26f801f57ae Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 25 Mar 2020 09:24:25 -0500 Subject: [PATCH 079/430] fix: plan build before running it (#71) --- cmd/vela-worker/operate.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index ea38c92a..f18feb76 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -57,7 +57,7 @@ func (w *Worker) operate() error { Client: _client, Runtime: _runtime, Build: item.Build, - Pipeline: item.Pipeline, + Pipeline: item.Pipeline.Sanitize(w.Runtime.Driver), Repo: item.Repo, User: item.User, }) @@ -100,32 +100,40 @@ func (w *Worker) operate() error { }() defer func() { - // destroy the build on the executor logger.Info("destroying build") + // destroy the build with the executor err = _executor.DestroyBuild(context.Background()) if err != nil { logger.Errorf("unable to destroy build: %v", err) } }() - // create the build on the executor logger.Info("creating build") + // create the build with the executor err = _executor.CreateBuild(ctx) if err != nil { logger.Errorf("unable to create build: %v", err) return err } - // execute the build on the executor + logger.Info("planning build") + // plan the build with the executor + err = _executor.PlanBuild(ctx) + if err != nil { + logger.Errorf("unable to plan build: %v", err) + return err + } + logger.Info("executing build") + // execute the build with the executor err = _executor.ExecBuild(ctx) if err != nil { logger.Errorf("unable to execute build: %v", err) return err } - // destroy the build on the executor logger.Info("destroying build") + // destroy the build with the executor err = _executor.DestroyBuild(context.Background()) if err != nil { logger.Errorf("unable to destroy build: %v", err) From d107946adc25ae5759880f04ec39575b4f43ecac Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 26 Mar 2020 14:52:09 -0500 Subject: [PATCH 080/430] refactor(router): add comments and links (#72) --- router/build.go | 24 +++++++++++++++------ router/executor.go | 49 ++++++++++++++++++++++++++++++++---------- router/pipeline.go | 18 ++++++++++------ router/repo.go | 18 ++++++++++------ router/router.go | 53 ++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 126 insertions(+), 36 deletions(-) diff --git a/router/build.go b/router/build.go index 1686006d..e5a9a1ec 100644 --- a/router/build.go +++ b/router/build.go @@ -9,16 +9,26 @@ import ( "github.com/go-vela/worker/api" ) -// buildHandlers is a function that extends the provided base router group -// with the API handlers for build functionality. +// BuildHandlers extends the provided base router group +// by adding a collection of endpoints for handling +// build related requests. // -// GET /api/v1/executors/:executor/build -// DELETE /api/v1/executors/:executor/build/kill -func buildHandlers(base *gin.RouterGroup) { - // builds endpoints +// GET /api/v1/executors/:executor/build +// DELETE /api/v1/executors/:executor/build/kill +func BuildHandlers(base *gin.RouterGroup) { + // add a collection of endpoints for handling build related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group build := base.Group("/build") { + // add an endpoint for capturing the build + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET build.GET("", api.GetBuild) + + // add an endpoint for killing the build + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.DELETE build.DELETE("/kill", api.KillBuild) - } // end of builds endpoints + } } diff --git a/router/executor.go b/router/executor.go index 94bbc655..42664188 100644 --- a/router/executor.go +++ b/router/executor.go @@ -19,25 +19,52 @@ import ( // DELETE /api/v1/executors/:executor/build/kill // GET /api/v1/executors/:executor/pipeline // GET /api/v1/executors/:executor/repo -func executorHandlers(base *gin.RouterGroup) { - // executors endpoints + +// ExecutorHandlers extends the provided base router group +// by adding a collection of endpoints for handling +// executor related requests. +// +// GET /api/v1/executors +// GET /api/v1/executors/:executor +// GET /api/v1/executors/:executor/build +// DELETE /api/v1/executors/:executor/build/kill +// GET /api/v1/executors/:executor/pipeline +// GET /api/v1/executors/:executor/repo +func ExecutorHandlers(base *gin.RouterGroup) { + // add a collection of endpoints for handling executors related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group executors := base.Group("/executors") { + // add an endpoint for capturing the executors + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET executors.GET("", api.GetExecutors) - // exector endpoints + // add a collection of endpoints for handling executor related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group executor := executors.Group("/:executor", executor.Establish()) { + // add an endpoint for capturing a executor + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET executor.GET("", api.GetExecutor) - // build endpoints - buildHandlers(executor) + // add a collection of endpoints for handling build related requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#BuildHandlers + BuildHandlers(executor) - // pipeline endpoints - pipelineHandlers(executor) + // add a collection of endpoints for handling pipeline related requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#PipelineHandlers + PipelineHandlers(executor) - // build endpoints - repoHandlers(executor) - } // end of executor endpoints - } // end of executors endpoints + // add a collection of endpoints for handling repo related requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#RepoHandlers + RepoHandlers(executor) + } + } } diff --git a/router/pipeline.go b/router/pipeline.go index 2817d0d9..6f333334 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -9,14 +9,20 @@ import ( "github.com/go-vela/worker/api" ) -// pipelineHandlers is a function that extends the provided base router group -// with the API handlers for pipeline functionality. +// PipelineHandlers extends the provided base router group +// by adding a collection of endpoints for handling +// pipeline related requests. // -// GET /api/v1/executors/:executor/pipeline -func pipelineHandlers(base *gin.RouterGroup) { - // pipelines endpoints +// GET /api/v1/executors/:executor/pipeline +func PipelineHandlers(base *gin.RouterGroup) { + // add a collection of endpoints for handling pipeline related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group pipeline := base.Group("/pipeline") { + // add an endpoint for capturing the pipeline + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET pipeline.GET("", api.GetPipeline) - } // end of pipelines endpoints + } } diff --git a/router/repo.go b/router/repo.go index 1a203b69..629632ba 100644 --- a/router/repo.go +++ b/router/repo.go @@ -9,14 +9,20 @@ import ( "github.com/go-vela/worker/api" ) -// repoHandlers is a function that extends the provided base router group -// with the API handlers for repo functionality. +// RepoHandlers extends the provided base router group +// by adding a collection of endpoints for handling +// repo related requests. // -// GET /api/v1/executors/:executor/repo -func repoHandlers(base *gin.RouterGroup) { - // repos endpoints +// GET /api/v1/executors/:executor/repo +func RepoHandlers(base *gin.RouterGroup) { + // add a collection of endpoints for handling repo related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group repo := base.Group("/repo") { + // add an endpoint for capturing the repo + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET repo.GET("", api.GetRepo) - } // end of repos endpoints + } } diff --git a/router/router.go b/router/router.go index 1033d3be..2ade6005 100644 --- a/router/router.go +++ b/router/router.go @@ -16,29 +16,70 @@ const ( base = "/api/v1" ) -// Load is a server function that returns the engine for processing web requests -// on the host it's running on +// Load creates the gin.Engine with the provided +// options (middleware functions) for processing +// web and API requests for the worker. func Load(options ...gin.HandlerFunc) *gin.Engine { + // create an empty gin engine with no middleware + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#New r := gin.New() + + // attach a middleware that recovers from any panics + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Recovery r.Use(gin.Recovery()) + // attach a middleware that injects the Vela version into the request + // + // https://pkg.go.dev/github.com/go-vela/worker/router/middleware?tab=doc#RequestVersion r.Use(middleware.RequestVersion) + + // attach a middleware that prevents the client from caching + // + // https://pkg.go.dev/github.com/go-vela/worker/router/middleware?tab=doc#NoCache r.Use(middleware.NoCache) + + // attach a middleware capable of handling options requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router/middleware?tab=doc#Options r.Use(middleware.Options) + + // attach a middleware for adding extra security measures + // + // https://pkg.go.dev/github.com/go-vela/worker/router/middleware?tab=doc#Secure r.Use(middleware.Secure) + // attach all other provided middleware + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Use r.Use(options...) + // add an endpoint for reporting the health of the worker + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET r.GET("/health", api.Health) + + // add an endpoint for reporting metrics for the worker + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET r.GET("/metrics", gin.WrapH(api.Metrics())) - // api endpoints + // add a collection of endpoints for handling API related requests + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group baseAPI := r.Group(base, user.Establish(), perm.MustServer()) { - // executor endpoints - executorHandlers(baseAPI) + // add a collection of endpoints for handling executor related requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#ExecutorHandlers + ExecutorHandlers(baseAPI) + + // add an endpoint for shutting down the worker + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.POST baseAPI.POST("/shutdown", api.Shutdown) - } // end of api + } return r } From a95812abf3edb2c803cc757c7f3adb43425f5415 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 27 Mar 2020 11:47:24 -0500 Subject: [PATCH 081/430] chore: remove old executor pkg (#73) * chore: remove old executor pkg * chore: tidy go dependencies * refactor: fix linter errors --- api/executor.go | 24 +- cmd/vela-worker/operate.go | 20 +- cmd/vela-worker/run.go | 63 +- cmd/vela-worker/server.go | 7 +- cmd/vela-worker/validate.go | 14 +- cmd/vela-worker/worker.go | 13 +- executor/context.go | 42 -- executor/doc.go | 12 - executor/executor.go | 119 ---- executor/linux/build.go | 597 ------------------ executor/linux/build_test.go | 646 -------------------- executor/linux/doc.go | 11 - executor/linux/linux.go | 150 ----- executor/linux/linux_test.go | 174 ------ executor/linux/secret.go | 230 ------- executor/linux/secret_test.go | 316 ---------- executor/linux/service.go | 233 ------- executor/linux/service_test.go | 243 -------- executor/linux/stage.go | 189 ------ executor/linux/stage_test.go | 353 ----------- executor/linux/step.go | 285 --------- executor/linux/step_test.go | 388 ------------ go.mod | 3 - router/middleware/executor.go | 11 +- router/middleware/executor/context.go | 39 -- router/middleware/executor/context_test.go | 88 --- router/middleware/executor/executor.go | 45 +- router/middleware/executor/executor_test.go | 71 ++- 28 files changed, 184 insertions(+), 4202 deletions(-) delete mode 100644 executor/context.go delete mode 100644 executor/doc.go delete mode 100644 executor/executor.go delete mode 100644 executor/linux/build.go delete mode 100644 executor/linux/build_test.go delete mode 100644 executor/linux/doc.go delete mode 100644 executor/linux/linux.go delete mode 100644 executor/linux/linux_test.go delete mode 100644 executor/linux/secret.go delete mode 100644 executor/linux/secret_test.go delete mode 100644 executor/linux/service.go delete mode 100644 executor/linux/service_test.go delete mode 100644 executor/linux/stage.go delete mode 100644 executor/linux/stage_test.go delete mode 100644 executor/linux/step.go delete mode 100644 executor/linux/step_test.go delete mode 100644 router/middleware/executor/context.go delete mode 100644 router/middleware/executor/context_test.go diff --git a/api/executor.go b/api/executor.go index 03db6c9b..cde7ba39 100644 --- a/api/executor.go +++ b/api/executor.go @@ -9,9 +9,10 @@ import ( "net/http" "github.com/gin-gonic/gin" + + "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/types" "github.com/go-vela/types/library" - "github.com/go-vela/worker/executor" exec "github.com/go-vela/worker/router/middleware/executor" ) @@ -66,7 +67,26 @@ func GetExecutor(c *gin.Context) { func GetExecutors(c *gin.Context) { var err error - e := executor.FromContext(c) + // capture executors value from context + value := c.Value("executors") + if value == nil { + msg := fmt.Sprintf("no running executors found") + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + return + } + + // cast executors value to expected type + e, ok := value.(map[int]executor.Engine) + if !ok { + msg := fmt.Sprintf("unable to get executors") + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + return + } + executors := []*library.Executor{} for _, executor := range e { diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index f18feb76..e5977338 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -23,52 +23,54 @@ import ( // operate is a helper function to ... func (w *Worker) operate() error { // setup the client - _client, err := setupClient(w.Server) + _client, err := setupClient(w.Config.Server) if err != nil { logrus.Fatal(err) } // setup the queue - _queue, err := queue.New(w.Queue) + w.Queue, err = queue.New(w.Config.Queue) if err != nil { logrus.Fatal(err) } executors := new(errgroup.Group) - for i := 0; i < w.Build.Limit; i++ { + for i := 0; i < w.Config.Build.Limit; i++ { logrus.Infof("Thread ID %d listening to queue...", i) executors.Go(func() error { for { // setup the runtime - _runtime, err := runtime.New(w.Runtime) + w.Runtime, err = runtime.New(w.Config.Runtime) if err != nil { logrus.Fatal(err) } // capture an item from the queue - item, err := _queue.Pop() + item, err := w.Queue.Pop() if err != nil { return err } _executor, err := executor.New(&executor.Setup{ - Driver: w.Executor.Driver, + Driver: w.Config.Executor.Driver, Client: _client, - Runtime: _runtime, + Runtime: w.Runtime, Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Runtime.Driver), + Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), Repo: item.Repo, User: item.User, }) + w.Executors[i] = _executor + // create logger with extra metadata logger := logrus.WithFields(logrus.Fields{ "build": item.Build.GetNumber(), "repo": item.Repo.GetFullName(), }) - t := w.Build.Timeout + t := w.Config.Build.Timeout // check if the repository has a custom timeout if item.Repo.GetTimeout() > 0 { // update timeout variable to repository custom timeout diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 80d632a9..debc2551 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -53,36 +53,39 @@ func run(c *cli.Context) error { // create the worker w := &Worker{ - // api configuration - API: &API{ - Port: c.String("api.port"), - }, - // build configuration - Build: &Build{ - Limit: c.Int("build.limit"), - Timeout: c.Duration("build.timeout"), - }, - // executor configuration - Executor: &executor.Setup{ - Driver: c.String("executor.driver"), - }, - // runtime configuration - Runtime: &runtime.Setup{ - Driver: c.String("runtime.driver"), - Config: c.String("runtime.config"), - Namespace: c.String("runtime.namespace"), - }, - // queue configuration - Queue: &queue.Setup{ - Driver: c.String("queue.driver"), - Config: c.String("queue.config"), - Cluster: c.Bool("queue.cluster"), - Routes: c.StringSlice("queue.routes"), - }, - // server configuration - Server: &Server{ - Address: c.String("server.addr"), - Secret: c.String("server.secret"), + // worker configuration + Config: &Config{ + // api configuration + API: &API{ + Port: c.String("api.port"), + }, + // build configuration + Build: &Build{ + Limit: c.Int("build.limit"), + Timeout: c.Duration("build.timeout"), + }, + // executor configuration + Executor: &executor.Setup{ + Driver: c.String("executor.driver"), + }, + // runtime configuration + Runtime: &runtime.Setup{ + Driver: c.String("runtime.driver"), + Config: c.String("runtime.config"), + Namespace: c.String("runtime.namespace"), + }, + // queue configuration + Queue: &queue.Setup{ + Driver: c.String("queue.driver"), + Config: c.String("queue.config"), + Cluster: c.Bool("queue.cluster"), + Routes: c.StringSlice("queue.routes"), + }, + // server configuration + Server: &Server{ + Address: c.String("server.addr"), + Secret: c.String("server.secret"), + }, }, } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 669347b3..f23c96fa 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -18,12 +18,11 @@ func (w *Worker) server() error { // create the worker router to listen and serve traffic router := router.Load( middleware.RequestVersion, - // TODO: make this do stuff - // middleware.Executor(w.Executors), - middleware.Secret(w.Server.Secret), + middleware.Executors(w.Executors), + middleware.Secret(w.Config.Server.Secret), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) // start serving traffic on the provided worker port - return router.Run(w.API.Port) + return router.Run(w.Config.API.Port) } diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index dce72056..5594d921 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -15,38 +15,38 @@ func (w *Worker) Validate() error { logrus.Info("validating worker configuration") // verify a build limit was provided - if w.Build.Limit <= 0 { + if w.Config.Build.Limit <= 0 { return fmt.Errorf("no worker build limit provided") } // verify a build timeout was provided - if w.Build.Timeout <= 0 { + if w.Config.Build.Timeout <= 0 { return fmt.Errorf("no worker build timeout provided") } // verify a server address was provided - if len(w.Server.Address) == 0 { + if len(w.Config.Server.Address) == 0 { return fmt.Errorf("no worker server address provided") } // verify a server secret was provided - if len(w.Server.Secret) == 0 { + if len(w.Config.Server.Secret) == 0 { return fmt.Errorf("no worker server secret provided") } // verify an executor driver was provided - if len(w.Executor.Driver) == 0 { + if len(w.Config.Executor.Driver) == 0 { return fmt.Errorf("no worker executor driver provided") } // verify the queue configuration - err := w.Queue.Validate() + err := w.Config.Queue.Validate() if err != nil { return err } // verify the runtime configuration - err = w.Runtime.Validate() + err = w.Config.Runtime.Validate() if err != nil { return err } diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 9c36a8d5..e76be1b9 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -30,8 +30,8 @@ type ( Secret string } - // Worker represents the worker configuration. - Worker struct { + // Config represents the worker configuration. + Config struct { API *API Build *Build Executor *executor.Setup @@ -39,4 +39,13 @@ type ( Runtime *runtime.Setup Server *Server } + + // Worker represents all configuration and + // system processes for the worker. + Worker struct { + Config *Config + Executors map[int]executor.Engine + Queue queue.Service + Runtime runtime.Engine + } ) diff --git a/executor/context.go b/executor/context.go deleted file mode 100644 index 4d2b7395..00000000 --- a/executor/context.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package executor - -import ( - "context" -) - -// key defines the key type for storing -// the executor Engine in the context. -const key = "executor" - -// Setter defines a context that enables setting values. -type Setter interface { - Set(string, interface{}) -} - -// FromContext returns the executor Engine -// associated with this context. -func FromContext(c context.Context) map[int]Engine { - // get executor value from context - v := c.Value(key) - if v == nil { - return nil - } - - // cast executor value to expected Engine type - e, ok := v.(map[int]Engine) - if !ok { - return nil - } - - return e -} - -// ToContext adds the executor Engine to this -// context if it supports the Setter interface. -func ToContext(c Setter, e map[int]Engine) { - c.Set(key, e) -} diff --git a/executor/doc.go b/executor/doc.go deleted file mode 100644 index d9e46a9a..00000000 --- a/executor/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package executor provides the ability for Vela to -// integrate with different supported operating -// systems. -// -// Usage: -// -// import "github.com/go-vela/worker/executor" -package executor diff --git a/executor/executor.go b/executor/executor.go deleted file mode 100644 index f9c9fa5a..00000000 --- a/executor/executor.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package executor - -import ( - "context" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" -) - -// Engine represents the interface for Vela integrating -// with the different supported operating systems. -type Engine interface { - - // API interface functions - - // GetBuild defines a function for the API - // that gets the current build in execution. - GetBuild() (*library.Build, error) - // GetRepo defines a function for the API - // that gets the current repo in execution. - GetRepo() (*library.Repo, error) - // GetPipeline defines a function for the API - // that gets the current pipeline in execution. - GetPipeline() (*pipeline.Build, error) - // KillBuild defines a function for the API - // that kills the current build in execution. - KillBuild() (*library.Build, error) - - // Secrets Engine Interface Functions - - // PullSecret defines a function that pulls - // the secrets for a given pipeline. - PullSecret(context.Context) error - - // Service Engine Interface Functions - - // CreateService defines a function that - // configures the service for execution. - CreateService(context.Context, *pipeline.Container) error - // PlanService defines a function that - // prepares the service for execution. - PlanService(context.Context, *pipeline.Container) error - // ExecService defines a function that - // runs a service. - ExecService(context.Context, *pipeline.Container) error - // StreamService defines a function that - // tails the output for a service. - StreamService(context.Context, *pipeline.Container) error - // DestroyService defines a function that - // cleans up the service after execution. - DestroyService(context.Context, *pipeline.Container) error - - // Step Engine Interface Functions - - // CreateStep defines a function that - // configures the step for execution. - CreateStep(context.Context, *pipeline.Container) error - // PlanStep defines a function that - // prepares the step for execution. - PlanStep(context.Context, *pipeline.Container) error - // ExecStep defines a function that - // runs a step. - ExecStep(context.Context, *pipeline.Container) error - // StreamStep defines a function that - // tails the output for a step. - StreamStep(context.Context, *pipeline.Container) error - // DestroyStep defines a function that - // cleans up the step after execution. - DestroyStep(context.Context, *pipeline.Container) error - - // Stage Engine Interface Functions - - // CreateStage defines a function that - // configures the stage for execution. - CreateStage(context.Context, *pipeline.Stage) error - // PlanStage defines a function that - // prepares the stage for execution. - PlanStage(context.Context, *pipeline.Stage, map[string]chan error) error - // ExecStage defines a function that - // runs a stage. - ExecStage(context.Context, *pipeline.Stage, map[string]chan error) error - // DestroyStage defines a function that - // cleans up the stage after execution. - DestroyStage(context.Context, *pipeline.Stage) error - - // Build Engine interface functions - - // CreateBuild defines a function that - // configures the build for execution. - CreateBuild(context.Context) error - // PlanBuild defines a function that - // prepares the build for execution. - PlanBuild(context.Context) error - // ExecBuild defines a function that - // runs a pipeline for a build. - ExecBuild(context.Context) error - // DestroyBuild defines a function that - // cleans up the build after execution. - DestroyBuild(context.Context) error - - // With Engine interface functions - - // WithBuild defines a function that sets - // the library Build type in the Engine. - WithBuild(*library.Build) Engine - // WithPipeline defines a function that sets - // the pipeline Build type in the Engine. - WithPipeline(*pipeline.Build) Engine - // WithRepo defines a function that sets - // the library Repo type in the Engine. - WithRepo(*library.Repo) Engine - // WithUser defines a function that sets - // the library User type in the Engine. - WithUser(*library.User) Engine -} diff --git a/executor/linux/build.go b/executor/linux/build.go deleted file mode 100644 index b21ec00f..00000000 --- a/executor/linux/build.go +++ /dev/null @@ -1,597 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "fmt" - "strings" - "syscall" - "time" - - "golang.org/x/sync/errgroup" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" -) - -// CreateBuild configures the build for execution. -func (c *client) CreateBuild(ctx context.Context) error { - b := c.build - r := c.repo - e := c.err - - // update engine logger with extra metadata - c.logger = c.logger.WithFields(logrus.Fields{ - "build": b.GetNumber(), - "repo": r.GetFullName(), - }) - - defer func() { - // NOTE: When an error occurs during a build that does not have to do - // with a pipeline we should set build status to "error" not "failed" - // because it is worker related and not build. - if e != nil { - b.SetError(e.Error()) - b.SetStatus(constants.StatusError) - } - - c.logger.Info("uploading build state") - // send API call to update the build - _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errorred state: %v", err) - } - }() - - // update the build fields - b.SetStatus(constants.StatusRunning) - b.SetStarted(time.Now().UTC().Unix()) - b.SetHost(c.Hostname) - // TODO: This should not be hardcoded - b.SetDistribution("linux") - b.SetRuntime("docker") - - c.logger.Info("uploading build state") - // send API call to update the build - b, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - e = err - return fmt.Errorf("unable to upload start state: %w", err) - } - - c.build = b - - // TODO: Pull this out into a the plan function for steps. - c.logger.Info("pulling secrets") - // pull secrets for the build - err = c.PullSecret(ctx) - if err != nil { - e = err - return fmt.Errorf("unable to pull secrets: %v", err) - } - - return nil -} - -// PlanBuild defines a function that -// prepares the build for execution. -func (c *client) PlanBuild(ctx context.Context) error { - b := c.build - p := c.pipeline - r := c.repo - e := c.err - - // update engine logger with extra metadata - c.logger = c.logger.WithFields(logrus.Fields{ - "build": b.GetNumber(), - "repo": r.GetFullName(), - }) - - defer func() { - // NOTE: When an error occurs during a build that does not have to do - // with a pipeline we should set build status to "error" not "failed" - // because it is worker related and not build. - if e != nil { - b.SetError(e.Error()) - b.SetStatus(constants.StatusError) - } - - c.logger.Info("uploading build state") - // send API call to update the build - _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errorred state: %v", err) - } - }() - - // TODO: make this better - init := new(pipeline.Container) - if len(p.Steps) > 0 { - init = p.Steps[0] - - c.logger.Infof("creating %s step", init.Name) - // create the step - err := c.CreateStep(ctx, init) - if err != nil { - e = err - return fmt.Errorf("unable to create %s step: %w", init.Name, err) - } - - c.logger.Infof("planning %s step", init.Name) - // plan the step - err = c.PlanStep(ctx, init) - if err != nil { - e = err - return fmt.Errorf("unable to plan %s step: %w", init.Name, err) - } - } - - // TODO: make this better - if len(p.Stages) > 0 { - init = p.Stages[0].Steps[0] - - c.logger.Infof("creating %s step", init.Name) - // create the step - err := c.CreateStep(ctx, init) - if err != nil { - e = err - return fmt.Errorf("unable to create %s step: %w", init.Name, err) - } - - c.logger.Infof("planning %s step", init.Name) - // plan the step - err = c.PlanStep(ctx, init) - if err != nil { - e = err - return fmt.Errorf("unable to plan %s step: %w", init.Name, err) - } - } - - // TODO: make this cleaner - result, ok := c.steps.Load(init.ID) - if !ok { - err := fmt.Errorf("unable to get %s step from client", init.Name) - e = err - - return err - } - - s := result.(*library.Step) - - result, ok = c.stepLogs.Load(init.ID) - if !ok { - err := fmt.Errorf("unable to get %s step from client", init.Name) - e = err - - return err - } - - l := result.(*library.Log) - - defer func() { - s.SetFinished(time.Now().UTC().Unix()) - c.logger.Infof("uploading %s step state", init.Name) - // send API call to update the step - _, _, err := c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) - if err != nil { - c.logger.Errorf("unable to upload %s state: %v", init.Name, err) - } - - c.logger.Infof("uploading %s step logs", init.Name) - // send API call to update the logs for the step - l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), init.Number, l) - if err != nil { - c.logger.Errorf("unable to upload %s logs: %v", init.Name, err) - } - }() - - c.logger.Info("creating network") - // create the runtime network for the pipeline - err := c.Runtime.CreateNetwork(ctx, p) - if err != nil { - e = err - return fmt.Errorf("unable to create network: %w", err) - } - - // update the init log with progress - l.SetData(append(l.GetData(), []byte("$ Inspecting runtime network...\n")...)) - - // inspect the runtime network for the pipeline - network, err := c.Runtime.InspectNetwork(ctx, p) - if err != nil { - e = err - return fmt.Errorf("unable to inspect network: %w", err) - } - - // update the init log with network info - l.SetData(append(l.GetData(), network...)) - - c.logger.Info("creating volume") - // create the runtime volume for the pipeline - err = c.Runtime.CreateVolume(ctx, p) - if err != nil { - e = err - return fmt.Errorf("unable to create volume: %w", err) - } - - // update the init log with progress - l.SetData(append(l.GetData(), []byte("$ Inspecting runtime volume...\n")...)) - - // inspect the runtime volume for the pipeline - volume, err := c.Runtime.InspectVolume(ctx, p) - if err != nil { - e = err - return fmt.Errorf("unable to inspect volume: %w", err) - } - - // update the init log with volume info - l.SetData(append(l.GetData(), volume...)) - - // update the init log with progress - l.SetData(append(l.GetData(), []byte("$ Pulling service images...\n")...)) - - // create the services for the pipeline - for _, s := range p.Services { - // TODO: remove this; but we need it for tests - s.Detach = true - s.Pull = true - - // TODO: remove hardcoded reference - // update the init log with progress - l.SetData( - append( - l.GetData(), - []byte(fmt.Sprintf(" $ docker image inspect %s\n", s.Image))..., - ), - ) - - c.logger.Infof("creating %s service", s.Name) - // create the service - err = c.CreateService(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to create %s service: %w", s.Name, err) - } - - c.logger.Infof("inspecting %s service", s.Name) - // inspect the service image - image, err := c.Runtime.InspectImage(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to inspect %s service: %w", s.Name, err) - } - - // update the init log with service image info - l.SetData(append(l.GetData(), image...)) - } - - // update the init log with progress - l.SetData( - append(l.GetData(), []byte("$ Pulling stage images...\n")...), - ) - - // create the stages for the pipeline - for _, s := range p.Stages { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - c.logger.Infof("creating %s stage", s.Name) - // create the stage - err = c.CreateStage(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to create %s stage: %w", s.Name, err) - } - } - - // update the init log with progress - l.SetData( - append(l.GetData(), []byte("$ Pulling step images...\n")...), - ) - - // create the steps for the pipeline - for _, s := range p.Steps { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - // TODO: make this not hardcoded - // update the init log with progress - l.SetData( - append( - l.GetData(), - []byte(fmt.Sprintf(" $ docker image inspect %s\n", s.Image))..., - ), - ) - - c.logger.Infof("creating %s step", s.Name) - // create the step - err = c.CreateStep(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to create %s step: %w", s.Name, err) - } - - c.logger.Infof("inspecting %s step", s.Name) - // inspect the step image - image, err := c.Runtime.InspectImage(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to inspect %s step: %w", s.Name, err) - } - - // update the init log with step image info - l.SetData(append(l.GetData(), image...)) - } - - return nil -} - -// ExecBuild runs a pipeline for a build. -func (c *client) ExecBuild(ctx context.Context) error { - b := c.build - p := c.pipeline - r := c.repo - e := c.err - - b.SetStatus(constants.StatusSuccess) - c.build = b - - defer func() { - // NOTE: When an error occurs during a build that does not have to do - // with a pipeline we should set build status to "error" not "failed" - // because it is worker related and not build. - if e != nil { - b.SetError(e.Error()) - b.SetStatus(constants.StatusError) - } - - // update the build fields - b.SetFinished(time.Now().UTC().Unix()) - - c.logger.Info("uploading build state") - // send API call to update the build - _, _, err := c.Vela.Build.Update(r.GetOrg(), r.GetName(), b) - if err != nil { - c.logger.Errorf("unable to upload errorred state: %v", err) - } - }() - - // execute the services for the pipeline - for _, s := range p.Services { - c.logger.Infof("planning %s service", s.Name) - // plan the service - err := c.PlanService(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to plan service: %w", err) - } - - c.logger.Infof("executing %s service", s.Name) - // execute the service - err = c.ExecService(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to execute service: %w", err) - } - } - - // execute the steps for the pipeline - for _, s := range p.Steps { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - // check if the build status is successful - if !strings.EqualFold(b.GetStatus(), constants.StatusSuccess) { - // break out of loop to stop running steps - break - } - - c.logger.Infof("planning %s step", s.Name) - // plan the step - err := c.PlanStep(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to plan step: %w", err) - } - - c.logger.Infof("executing %s step", s.Name) - // execute the step - err = c.ExecStep(ctx, s) - if err != nil { - e = err - return fmt.Errorf("unable to execute step: %w", err) - } - - result, ok := c.steps.Load(s.ID) - if !ok { - e = err - return fmt.Errorf("unable to get step %s from client", s.Name) - } - - cStep := result.(*library.Step) - - // check the step exit code - if s.ExitCode != 0 { - // check if we ignore step failures - if !s.Ruleset.Continue { - // set build status to failure - b.SetStatus(constants.StatusFailure) - } - - // update the step fields - cStep.SetExitCode(s.ExitCode) - cStep.SetStatus(constants.StatusFailure) - } - - cStep.SetFinished(time.Now().UTC().Unix()) - c.logger.Infof("uploading %s step state", s.Name) - // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cStep) - if err != nil { - return err - } - } - - // create an error group with the context for each stage - stages, stageCtx := errgroup.WithContext(ctx) - // create a map to track the progress of each stage - stageMap := make(map[string]chan error) - - // iterate through each stage in the pipeline - for _, s := range p.Stages { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - // https://golang.org/doc/faq#closures_and_goroutines - stage := s - - // create a new channel for each stage in the map - stageMap[stage.Name] = make(chan error) - - stages.Go(func() error { - c.logger.Infof("planning %s stage", stage.Name) - // plan the stage - err := c.PlanStage(stageCtx, stage, stageMap) - if err != nil { - e = err - return fmt.Errorf("unable to plan stage: %w", err) - } - - c.logger.Infof("executing %s stage", stage.Name) - // execute the stage - err = c.ExecStage(stageCtx, stage, stageMap) - if err != nil { - e = err - return fmt.Errorf("unable to execute stage: %w", err) - } - - return nil - }) - } - - c.logger.Debug("waiting for stages completion") - // wait for the stages to complete or return an error - err := stages.Wait() - if err != nil { - e = err - return fmt.Errorf("unable to wait for stages: %v", err) - } - - return nil -} - -// DestroyBuild cleans up the build after execution. -func (c *client) DestroyBuild(ctx context.Context) error { - var err error - - b := c.build - p := c.pipeline - r := c.repo - - // destroy the steps for the pipeline - for _, s := range p.Steps { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - c.logger.Infof("destroying %s step", s.Name) - // destroy the step - err = c.DestroyStep(ctx, s) - if err != nil { - c.logger.Errorf("unable to destroy step: %v", err) - } - } - - // destroy the stages for the pipeline - for _, s := range p.Stages { - // TODO: remove hardcoded reference - if s.Name == "init" { - continue - } - - c.logger.Infof("destroying %s stage", s.Name) - // destroy the stage - err = c.DestroyStage(ctx, s) - if err != nil { - c.logger.Errorf("unable to destroy stage: %v", err) - } - } - - // destroy the services for the pipeline - for _, s := range p.Services { - c.logger.Infof("destroying %s service", s.Name) - // destroy the service - err = c.DestroyService(ctx, s) - if err != nil { - c.logger.Errorf("unable to destroy service: %v", err) - } - - c.logger.Infof("uploading %s service state", s.Name) - - // send API call to update the build - result, ok := c.services.Load(s.ID) - if !ok { - return fmt.Errorf("unable to get service from client") - } - - cService := result.(*library.Service) - cService.SetExitCode(s.ExitCode) - cService.SetFinished(time.Now().UTC().Unix()) - - _, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cService) - if err != nil { - c.logger.Errorf("unable to upload service status: %v", err) - } - } - - c.logger.Info("deleting volume") - // remove the runtime volume for the pipeline - err = c.Runtime.RemoveVolume(ctx, p) - if err != nil { - c.logger.Errorf("unable to remove volume: %v", err) - } - - c.logger.Info("deleting network") - // remove the runtime network for the pipeline - err = c.Runtime.RemoveNetwork(ctx, p) - if err != nil { - c.logger.Errorf("unable to remove network: %v", err) - } - - return err -} - -// KillBuild kills the current build in execution. -func (c *client) KillBuild() (*library.Build, error) { - b := c.build - - // check if the build resource is available - if b == nil { - return nil, fmt.Errorf("build resource not found") - } - - // set the build status to killed - b.SetStatus(constants.StatusKilled) - - err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM) - if err != nil { - return nil, fmt.Errorf("unable to kill PID: %w", err) - } - - return b, nil -} diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go deleted file mode 100644 index 7593e3fa..00000000 --- a/executor/linux/build_test.go +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/go-vela/mock/server" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/gin-gonic/gin" -) - -func TestExecutor_CreateBuild_Success(t *testing.T) { - // setup global vars - var ( - _build = &library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - } - - _repo = &library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - } - ) - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - vela, _ := vela.NewClient(s.URL, nil) - - // setup types - r, _ := docker.NewMock() - - e, _ := New(vela, r) - - tests := []struct { - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - }{ - { // pipeline with steps - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - repo: _repo, - }, - { // pipeline with stages - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 1, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }, - repo: _repo, - }, - } - - // run test - for _, test := range tests { - e.WithBuild(test.build) - e.WithPipeline(test.pipeline) - e.WithRepo(test.repo) - - got := e.CreateBuild(context.Background()) - - if got != nil { - t.Errorf("CreateBuild is %v, want nil", got) - } - } -} - -func TestExecutor_ExecBuild_Success(t *testing.T) { - // setup global vars - var ( - _build = &library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - } - - _repo = &library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - } - ) - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - vela, _ := vela.NewClient(s.URL, nil) - - // setup types - r, _ := docker.NewMock() - - e, _ := New(vela, r) - - tests := []struct { - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - }{ - { // pipeline with steps - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Number: 1, - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - repo: _repo, - }, - { // pipeline with stages - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Number: 1, - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 1, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }, - repo: _repo, - }, - } - - // run test - for _, test := range tests { - e.WithBuild(test.build) - e.WithPipeline(test.pipeline) - e.WithRepo(test.repo) - - err := e.PlanBuild(context.Background()) - if err != nil { - t.Errorf("PlanBuild returned err: %v", err) - } - - err = e.ExecBuild(context.Background()) - if err != nil { - t.Errorf("ExecBuild returned err: %v", err) - } - } -} - -func TestExecutor_DestroyBuild_Success(t *testing.T) { - // setup global vars - var ( - _build = &library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - } - - _repo = &library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - } - ) - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - // setup types - r, _ := docker.NewMock() - - e, _ := New(c, r) - - tests := []struct { - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - }{ - { // pipeline with steps - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Number: 1, - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - repo: _repo, - }, - { // pipeline with stages - build: _build, - pipeline: &pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Number: 1, - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 1, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }, - repo: _repo, - }, - } - - // run test - for _, test := range tests { - e.WithBuild(test.build) - e.WithPipeline(test.pipeline) - e.WithRepo(test.repo) - - svc := new(library.Service) - svc.SetNumber(1) - e.services.Store(e.pipeline.Services[0].ID, svc) - - got := e.DestroyBuild(context.Background()) - - if got != nil { - t.Errorf("DestroyBuild is %v, want nil", got) - } - } -} diff --git a/executor/linux/doc.go b/executor/linux/doc.go deleted file mode 100644 index 413879c4..00000000 --- a/executor/linux/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package linux provides the ability for Vela to -// integrate with a Linux as an operating system. -// -// Usage: -// -// import "github.com/go-vela/worker/executor/linux" -package linux diff --git a/executor/linux/linux.go b/executor/linux/linux.go deleted file mode 100644 index 0d99b746..00000000 --- a/executor/linux/linux.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "fmt" - "os" - "sync" - - "github.com/go-vela/worker/executor" - - "github.com/go-vela/pkg-runtime/runtime" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" -) - -type client struct { - Vela *vela.Client - Runtime runtime.Engine - Secrets map[string]*library.Secret - Hostname string - - // private fields - logger *logrus.Entry - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - services sync.Map - serviceLogs sync.Map - steps sync.Map - stepLogs sync.Map - user *library.User - err error -} - -// New returns an Executor implementation that integrates with a Linux instance. -func New(c *vela.Client, r runtime.Engine) (*client, error) { - // immediately return if a nil Vela client is provided - if c == nil { - return nil, fmt.Errorf("empty Vela client provided to executor") - } - - // immediately return if a nil runtime Engine is provided - if r == nil { - return nil, fmt.Errorf("empty runtime provided to executor") - } - - // capture the hostname - h, _ := os.Hostname() - - // create the logger object - l := logrus.WithFields(logrus.Fields{ - "host": h, - }) - - return &client{ - Vela: c, - Runtime: r, - Hostname: h, - logger: l, - services: sync.Map{}, - serviceLogs: sync.Map{}, - steps: sync.Map{}, - stepLogs: sync.Map{}, - err: nil, - }, nil -} - -// WithBuild sets the library build type in the Engine. -func (c *client) WithBuild(b *library.Build) executor.Engine { - // set build in engine if one is provided - if b != nil { - c.build = b - } - - return c -} - -// WithPipeline sets the pipeline Build type in the Engine. -func (c *client) WithPipeline(p *pipeline.Build) executor.Engine { - // set pipeline in engine if one is provided - if p != nil { - c.pipeline = p - } - - return c -} - -// WithRepo sets the library Repo type in the Engine. -func (c *client) WithRepo(r *library.Repo) executor.Engine { - // set repo in engine if one is provided - if r != nil { - c.repo = r - } - - return c -} - -// WithUser sets the library User type in the Engine. -func (c *client) WithUser(u *library.User) executor.Engine { - // set user in engine if one is provided - if u != nil { - c.user = u - } - - return c -} - -// GetBuild gets the current build in execution. -func (c *client) GetBuild() (*library.Build, error) { - b := c.build - - // check if the build resource is available - if b == nil { - return nil, fmt.Errorf("build resource not found") - } - - return b, nil -} - -// GetPipeline gets the current pipeline in execution. -func (c *client) GetPipeline() (*pipeline.Build, error) { - p := c.pipeline - - // check if the pipeline resource is available - if p == nil { - return nil, fmt.Errorf("pipeline resource not found") - } - - return p, nil -} - -// GetRepo gets the current repo in execution. -func (c *client) GetRepo() (*library.Repo, error) { - r := c.repo - - // check if the repo resource is available - if r == nil { - return nil, fmt.Errorf("repo resource not found") - } - - return r, nil -} diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go deleted file mode 100644 index 7ce0170f..00000000 --- a/executor/linux/linux_test.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "reflect" - "testing" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" -) - -func TestLinux_WithBuild(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := int64(1) - b := &library.Build{ID: &id} - - want, _ := New(vela, r) - want.build = b - - // run test - got, err := New(vela, r) - if err != nil { - t.Errorf("Unable to create new compiler: %v", err) - } - - if !reflect.DeepEqual(got.WithBuild(b), want) { - t.Errorf("WithBuild is %v, want %v", got, want) - } -} - -func TestLinux_WithPipeline(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := string(1) - b := &pipeline.Build{ID: id} - - want, _ := New(vela, r) - want.pipeline = b - - // run test - got, err := New(vela, r) - if err != nil { - t.Errorf("Unable to create new compiler: %v", err) - } - - if !reflect.DeepEqual(got.WithPipeline(b), want) { - t.Errorf("WithBuild is %v, want %v", got, want) - } -} - -func TestLinux_WithRepo(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := int64(1) - repo := &library.Repo{ID: &id} - - want, _ := New(vela, r) - want.repo = repo - - // run test - got, err := New(vela, r) - if err != nil { - t.Errorf("Unable to create new compiler: %v", err) - } - - if !reflect.DeepEqual(got.WithRepo(repo), want) { - t.Errorf("WithBuild is %v, want %v", got, want) - } -} - -func TestLinux_WithUser(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := int64(1) - u := &library.User{ID: &id} - - want, _ := New(vela, r) - want.user = u - - // run test - got, err := New(vela, r) - if err != nil { - t.Errorf("Unable to create new compiler: %v", err) - } - - if !reflect.DeepEqual(got.WithUser(u), want) { - t.Errorf("WithBuild is %v, want %v", got, want) - } -} - -func TestLinux_GetBuild(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := int64(1) - b := &library.Build{ID: &id} - want := b - - executor, _ := New(vela, r) - executor.WithBuild(b) - - // run test - got, err := executor.GetBuild() - if err != nil { - t.Errorf("Unable to get build from compiler: %v", err) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("GetBuild is %v, want %v", got, want) - } -} - -func TestLinux_GetPipeline(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := "1" - p := &pipeline.Build{ID: id} - want := p - - executor, _ := New(vela, r) - executor.WithPipeline(p) - - // run test - got, err := executor.GetPipeline() - if err != nil { - t.Errorf("Unable to get pipeline from compiler: %v", err) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("GetPipeline is %v, want %v", got, want) - } -} - -func TestLinux_GetRepo(t *testing.T) { - // setup types - vela, _ := vela.NewClient("http://localhost:8080", nil) - r, _ := docker.NewMock() - - id := int64(1) - repo := &library.Repo{ID: &id} - want := repo - - executor, _ := New(vela, r) - executor.WithRepo(repo) - - // run test - got, err := executor.GetRepo() - if err != nil { - t.Errorf("Unable to get repo from compiler: %v", err) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("GetPipeline is %v, want %v", got, want) - } -} diff --git a/executor/linux/secret.go b/executor/linux/secret.go deleted file mode 100644 index c580e1bd..00000000 --- a/executor/linux/secret.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "fmt" - "strings" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" -) - -// PullSecret defines a function that pulls the secrets for a given pipeline. -func (c *client) PullSecret(ctx context.Context) error { - var err error - - p := c.pipeline - - secrets := make(map[string]*library.Secret) - sec := new(library.Secret) - - // iterate through each secret provided in the pipeline - for _, s := range p.Secrets { - // if the secret isn't a native or vault type - if !strings.EqualFold(s.Engine, constants.DriverNative) && - !strings.EqualFold(s.Engine, constants.DriverVault) { - return fmt.Errorf("unrecognized secret engine: %s", s.Engine) - } - - switch s.Type { - // handle org secrets - case constants.SecretOrg: - c.logger.Debug("pulling org secret") - // get org secret - sec, err = c.getOrg(s) - if err != nil { - return err - } - // handle repo secrets - case constants.SecretRepo: - c.logger.Debug("pulling repo secret") - // get repo secret - sec, err = c.getRepo(s) - if err != nil { - return err - } - // handle shared secrets - case constants.SecretShared: - c.logger.Debug("pulling shared secret") - // get shared secret - sec, err = c.getShared(s) - if err != nil { - return err - } - default: - return fmt.Errorf("unrecognized secret type: %s", s.Type) - } - - // add secret to the map - secrets[s.Name] = sec - } - - // overwrite the engine secret map - c.Secrets = secrets - - return nil -} - -// getOrg is a helper function to parse and capture -// the org secret from the provided secret engine. -func (c *client) getOrg(s *pipeline.Secret) (*library.Secret, error) { - c.logger.Tracef("pulling %s %s secret %s", s.Engine, s.Type, s.Name) - - // variables necessary for secret - org := c.repo.GetOrg() - repo := "*" - path := s.Key - - // check if the full path was provided - if strings.Contains(path, "/") { - // split the full path into parts - parts := strings.SplitN(path, "/", 2) - - // secret is invalid - if len(parts) != 2 { - return nil, fmt.Errorf("path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) - } - - // check if the org provided matches what we expect - if strings.EqualFold(parts[0], org) { - // update the variables - org = parts[0] - path = parts[1] - } - } - - // send API call to capture the org secret - secret, _, err := c.Vela.Secret.Get(s.Engine, s.Type, org, repo, path) - if err != nil { - return nil, fmt.Errorf("unable to retrieve %s secret %s: %w", s.Type, s.Key, err) - } - - // overwrite the secret value - s.Value = secret.GetValue() - - return secret, nil -} - -// getRepo is a helper function to parse and capture -// the repo secret from the provided secret engine. -func (c *client) getRepo(s *pipeline.Secret) (*library.Secret, error) { - c.logger.Tracef("pulling %s %s secret %s", s.Engine, s.Type, s.Name) - - // variables necessary for secret - org := c.repo.GetOrg() - repo := c.repo.GetName() - path := s.Key - - // check if the full path was provided - if strings.Contains(path, "/") { - // split the full path into parts - parts := strings.SplitN(path, "/", 3) - - // secret is invalid - if len(parts) != 3 { - return nil, fmt.Errorf("path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) - } - - // check if the org provided matches what we expect - if strings.EqualFold(parts[0], org) { - // update the org variable - org = parts[0] - - // check if the repo provided matches what we expect - if strings.EqualFold(parts[1], repo) { - // update the variables - repo = parts[1] - path = parts[2] - } - } - } - - // send API call to capture the repo secret - secret, _, err := c.Vela.Secret.Get(s.Engine, s.Type, org, repo, path) - if err != nil { - return nil, fmt.Errorf("unable to retrieve %s secret %s: %w", s.Type, s.Key, err) - } - - // overwrite the secret value - s.Value = secret.GetValue() - - return secret, nil -} - -// getShared is a helper function to parse and capture -// the shared secret from the provided secret engine. -func (c *client) getShared(s *pipeline.Secret) (*library.Secret, error) { - c.logger.Tracef("pulling %s %s secret %s", s.Engine, s.Type, s.Name) - - // variables necessary for secret - var ( - team string - org string - ) - - path := s.Key - - // check if the full path was provided - if strings.Contains(path, "/") { - // split the full path into parts - parts := strings.SplitN(path, "/", 3) - - // secret is invalid - if len(parts) != 3 { - return nil, fmt.Errorf("path %s for %s secret %s is invalid", s.Key, s.Type, s.Name) - } - - // check if the org provided is not empty - if len(parts[0]) == 0 { - // update the org variable - org = parts[0] - - // check if the team provided is not empty - if len(parts[1]) == 0 { - // update the variables - team = parts[1] - path = parts[2] - } - } - } - - // send API call to capture the shared secret - secret, _, err := c.Vela.Secret.Get(s.Engine, s.Type, org, team, path) - if err != nil { - return nil, fmt.Errorf("unable to retrieve %s secret %s: %w", s.Type, s.Key, err) - } - - // overwrite the secret value - s.Value = secret.GetValue() - - return secret, nil -} - -// helper function to check secret whitelist before setting value -// TODO: Evaluate pulling this into a "bool" types function for injecting -func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error { - // inject secrets for step - for _, secret := range ctn.Secrets { - logrus.Tracef("looking up secret %s from pipeline secrets", secret.Source) - // lookup container secret in map - s, ok := m[secret.Source] - if !ok { - continue - } - - logrus.Tracef("matching secret %s to container %s", secret.Source, ctn.Name) - // ensure the secret matches with the container - if s.Match(ctn) { - ctn.Environment[strings.ToUpper(secret.Target)] = s.GetValue() - } - } - - return nil -} diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go deleted file mode 100644 index 6ee41e8a..00000000 --- a/executor/linux/secret_test.go +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/gin-gonic/gin" - - "github.com/go-vela/mock/server" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/google/go-cmp/cmp" -) - -func TestExecutor_PullSecret_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - vela, _ := vela.NewClient(s.URL, nil) - - e, _ := New(vela, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - Secrets: pipeline.SecretSlice{ - &pipeline.Secret{ - Name: "foo", - Key: "github/octocat/foo", - Engine: "native", - Type: "repo", - }, - &pipeline.Secret{ - Name: "foo", - Key: "github/foo", - Engine: "native", - Type: "org", - }, - &pipeline.Secret{ - Name: "foo", - Key: "github/octokitties/foo", - Engine: "native", - Type: "shared", - }, - }, - }) - - // run test - got := e.PullSecret(context.Background()) - - if got != nil { - t.Errorf("PullSecret is %v, want nil", got) - } -} - -func TestLinux_Secret_injectSecret(t *testing.T) { - // name and value of secret - v := "foo" - - // setup types - tests := []struct { - step *pipeline.Container - msec map[string]*library.Secret - want *pipeline.Container - }{ - // Tests for secrets with image ACLs - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine:latest"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: make(map[string]string), - }, - }, - - // Tests for secrets with event ACLs - { // push event checks - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - }, - }, - { // pull_request event checks - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "pull_request"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "pull_request"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "pull_request"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "pull_request"}, - }, - }, - { // tag event checks - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "tag"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "tag"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "tag"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "tag"}, - }, - }, - { // deployment event checks - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "deployment"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "deployment"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "deployment"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "deployment"}, - }, - }, - - // Tests for secrets with event and image ACLs - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - }, - }, - { - step: &pipeline.Container{ - Image: "centos:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}, Images: &[]string{"centos"}}}, - want: &pipeline.Container{ - Image: "centos:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - }, - }, - { - step: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, - Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, - }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, - want: &pipeline.Container{ - Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, - }, - }, - } - - // run test - for _, test := range tests { - _ = injectSecrets(test.step, test.msec) - got := test.step - - // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. - // Switching to a Google library for increased clarity. - // https://github.com/google/go-cmp - if diff := cmp.Diff(test.want.Environment, got.Environment); diff != "" { - t.Errorf("injectSecrets mismatch (-want +got):\n%s", diff) - } - } -} diff --git a/executor/linux/service.go b/executor/linux/service.go deleted file mode 100644 index a5c8cef3..00000000 --- a/executor/linux/service.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "bufio" - "bytes" - "context" - "fmt" - "time" - - "github.com/go-vela/worker/version" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" -) - -// CreateService configures the service for execution. -func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) error { - var err error - - b := c.build - r := c.repo - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "service": ctn.Name, - }) - - // update the engine service object - s := new(library.Service) - s.SetName(ctn.Name) - s.SetNumber(ctn.Number) - s.SetStatus(constants.StatusRunning) - s.SetStarted(time.Now().UTC().Unix()) - - logger.Debug("uploading service state") - // send API call to update the service - s, _, err = c.Vela.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) - if err != nil { - return err - } - - s.SetStatus(constants.StatusSuccess) - - // add a service to a map - c.services.Store(ctn.ID, s) - - // get the service log here - logger.Debug("retrieve service log") - // send API call to capture the service log - l, _, err := c.Vela.Log.GetService(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) - if err != nil { - return err - } - - // add a step log to a map - c.serviceLogs.Store(ctn.ID, l) - - return nil -} - -// PlanService prepares the service for execution. -func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "service": ctn.Name, - }) - - ctn.Environment["BUILD_HOST"] = c.Hostname - ctn.Environment["VELA_HOST"] = c.Hostname - ctn.Environment["VELA_VERSION"] = version.Version.String() - // TODO: remove hardcoded reference - ctn.Environment["VELA_RUNTIME"] = "docker" - ctn.Environment["VELA_DISTRIBUTION"] = "linux" - - logger.Debug("setting up container") - // setup the runtime container - err := c.Runtime.SetupContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} - -// ExecService runs a service. -func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "service": ctn.Name, - }) - - logger.Debug("running container") - // run the runtime container - err := c.Runtime.RunContainer(ctx, ctn, c.pipeline) - if err != nil { - return err - } - - go func() { - logger.Debug("stream logs for container") - // stream logs from container - err := c.StreamService(ctx, ctn) - if err != nil { - logrus.Error(err) - } - }() - - // do not wait for detached containers - if ctn.Detach { - return nil - } - - logger.Debug("waiting for container") - // wait for the runtime container - err = c.Runtime.WaitContainer(ctx, ctn) - if err != nil { - return err - } - - logger.Debug("inspecting container") - // inspect the runtime container - err = c.Runtime.InspectContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} - -// StreamService tails the output for a service. -func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { - // TODO: remove hardcoded reference - if ctn.Name == "init" { - return nil - } - - b := c.build - r := c.repo - - result, ok := c.stepLogs.Load(ctn.ID) - if !ok { - return fmt.Errorf("unable to get step log from client") - } - - l := result.(*library.Log) - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - // create new buffer for uploading logs - logs := new(bytes.Buffer) - - logger.Debug("tailing container") - // tail the runtime container - rc, err := c.Runtime.TailContainer(ctx, ctn) - if err != nil { - return err - } - defer rc.Close() - - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("appending logs") - // send API call to append the logs for the service - l, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } - - // flush the buffer of logs - logs.Reset() - } - } - logger.Trace(logs.String()) - - // update the existing log with the last bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("uploading logs") - // send API call to update the logs for the service - _, _, err = c.Vela.Log.UpdateService(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } - - return nil -} - -// DestroyService cleans up services after execution. -func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) error { - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "service": ctn.Name, - }) - - logger.Debug("inspecting container") - // inspect the runtime container - err := c.Runtime.InspectContainer(ctx, ctn) - if err != nil { - return err - } - - logger.Debug("removing container") - // remove the runtime container - err = c.Runtime.RemoveContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go deleted file mode 100644 index ab27c77e..00000000 --- a/executor/linux/service_test.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/gin-gonic/gin" - - "github.com/go-vela/mock/server" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" -) - -func TestExecutor_CreateService_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - Pull: true, - }, - }, - }) - - // run test - got := e.CreateService(context.Background(), e.pipeline.Services[0]) - - if got != nil { - t.Errorf("CreateService is %v, want nil", got) - } -} - -func TestExecutor_PlanService_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithBuild(&library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - }) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Number: 1, - Ports: []string{"5432:5432"}, - }, - }, - }) - e.WithRepo(&library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - }) - - // run test - got := e.PlanService(context.Background(), e.pipeline.Services[0]) - - if got != nil { - t.Errorf("PlanService is %v, want nil", got) - } -} - -func TestExecutor_ExecService_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithBuild(&library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - }) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - }) - e.WithRepo(&library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - }) - e.serviceLogs.Store(e.pipeline.Services[0].ID, new(library.Log)) - e.services.Store(e.pipeline.Services[0].ID, new(library.Service)) - - // run test - got := e.ExecService(context.Background(), e.pipeline.Services[0]) - - if got != nil { - t.Errorf("ExecService is %v, want nil", got) - } -} - -func TestExecutor_DestroyService_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - ExitCode: 0, - }, - }, - }) - - // run test - got := e.DestroyService(context.Background(), e.pipeline.Services[0]) - - if got != nil { - t.Errorf("DestroyService is %v, want nil", got) - } -} diff --git a/executor/linux/stage.go b/executor/linux/stage.go deleted file mode 100644 index 2c540e4c..00000000 --- a/executor/linux/stage.go +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "fmt" - "time" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" -) - -// CreateStage prepares the stage for execution. -func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { - init := c.pipeline.Stages[0].Steps[0] - // TODO: make this cleaner - result, ok := c.stepLogs.Load(init.ID) - if !ok { - return fmt.Errorf("unable to get init step log from client") - } - - l := result.(*library.Log) - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "stage": s.Name, - }) - - // update the init log with progress - l.SetData( - append( - l.GetData(), - []byte(fmt.Sprintf(" $ Pulling step images for stage %s...\n", s.Name))..., - ), - ) - - // create the steps for the stage - for _, step := range s.Steps { - // TODO: make this not hardcoded - // update the init log with progress - l.SetData( - append( - l.GetData(), - []byte(fmt.Sprintf(" $ docker image inspect %s\n", step.Image))..., - ), - ) - - logger.Debugf("creating %s step", step.Name) - // create the step - err := c.CreateStep(ctx, step) - if err != nil { - return err - } - - c.logger.Infof("inspecting %s step", step.Name) - // inspect the step image - image, err := c.Runtime.InspectImage(ctx, step) - if err != nil { - return err - } - - // update the init log with step image info - l.SetData(append(l.GetData(), image...)) - } - - return nil -} - -// PlanStage prepares the stage for execution. -func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage, m map[string]chan error) error { - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "stage": s.Name, - }) - - logger.Debug("gathering stage dependency tree") - // ensure dependent stages have completed - for _, needs := range s.Needs { - logger.Debugf("looking up dependency %s", needs) - // check if a dependency stage has completed - stageErr, ok := m[needs] - if !ok { // stage not found so we continue - continue - } - - logger.Debugf("waiting for dependency %s", needs) - // wait for the stage channel to close - select { - case <-ctx.Done(): - return fmt.Errorf("errgroup context is done") - case err := <-stageErr: - if err != nil { - logger.WithError(err).Errorf("%s stage produced error", needs) - return err - } - - continue - } - } - - return nil -} - -// ExecStage runs a stage. -func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m map[string]chan error) error { - b := c.build - r := c.repo - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "stage": s.Name, - }) - - // close the stage channel at the end - defer close(m[s.Name]) - - logger.Debug("starting execution of stage") - // execute the steps for the stage - for _, step := range s.Steps { - c.logger.Infof("planning %s step", step.Name) - // plan the step - err := c.PlanStep(ctx, step) - if err != nil { - return fmt.Errorf("unable to plan step %s: %w", step.Name, err) - } - - logger.Debugf("executing %s step", step.Name) - // execute the step - err = c.ExecStep(ctx, step) - if err != nil { - return err - } - - result, ok := c.steps.Load(step.ID) - if !ok { - return fmt.Errorf("unable to get step %s from client", step.Name) - } - - cStep := result.(*library.Step) - - // check the step exit code - if step.ExitCode != 0 { - // check if we ignore step failures - if !step.Ruleset.Continue { - // set build status to failure - b.SetStatus(constants.StatusFailure) - } - - // update the step fields - cStep.SetExitCode(step.ExitCode) - cStep.SetStatus(constants.StatusFailure) - } - - cStep.SetFinished(time.Now().UTC().Unix()) - c.logger.Infof("uploading %s step state", step.Name) - // send API call to update the build - _, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), cStep) - if err != nil { - return err - } - } - - return nil -} - -// DestroyStage cleans up the stage after execution. -func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { - // update logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "stage": s.Name, - }) - - // destroy the steps for the stage - for _, step := range s.Steps { - logger.Debugf("destroying %s step", step.Name) - // destroy the step - err := c.DestroyStep(ctx, step) - if err != nil { - return err - } - } - - return nil -} diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go deleted file mode 100644 index 86b695a4..00000000 --- a/executor/linux/stage_test.go +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/gin-gonic/gin" - - "github.com/go-vela/mock/server" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" -) - -func TestExecutor_CreateStage_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "init", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_init_init", - Environment: map[string]string{}, - Image: "#init", - Name: "init", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 2, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 3, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 4, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }) - - // run test - err := e.CreateStep(context.Background(), e.pipeline.Stages[0].Steps[0]) - if err != nil { - t.Errorf("Unable to create init step: %v", err) - } - - got := e.CreateStage(context.Background(), e.pipeline.Stages[1]) - - if got != nil { - t.Errorf("CreateStage is %v, want nil", got) - } -} - -func TestExecutor_ExecStage_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - stageMap := make(map[string]chan error) - stageMap["clone"] = make(chan error) - stageMap["exit"] = make(chan error) - stageMap["echo"] = make(chan error) - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 1, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }) - e.WithBuild(&library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - }) - e.WithRepo(&library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - }) - - // run test - err := e.CreateStep(context.Background(), e.pipeline.Stages[0].Steps[0]) - if err != nil { - t.Errorf("Unable to create init step: %v", err) - } - - err = e.CreateStage(context.Background(), e.pipeline.Stages[0]) - if err != nil { - t.Errorf("CreateStage returned err: %v", err) - } - - err = e.ExecStage(context.Background(), e.pipeline.Stages[0], stageMap) - if err != nil { - t.Errorf("ExecStage returned err: %v", err) - } -} - -func TestExecutor_DestroyStage_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Stages: pipeline.StageSlice{ - &pipeline.Stage{ - Name: "clone", - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - }, - }, - &pipeline.Stage{ - Name: "exit", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_exit_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - }, - }, - &pipeline.Stage{ - Name: "echo", - Needs: []string{"clone"}, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_echo_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 1, - Pull: true, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }, - }, - }) - - // run test - got := e.DestroyStage(context.Background(), e.pipeline.Stages[0]) - - if got != nil { - t.Errorf("DestroyStage is %v, want nil", got) - } -} diff --git a/executor/linux/step.go b/executor/linux/step.go deleted file mode 100644 index 56ab5189..00000000 --- a/executor/linux/step.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "bufio" - "bytes" - "context" - "encoding/json" - "fmt" - "strings" - "time" - - "github.com/go-vela/worker/version" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/drone/envsubst" - "github.com/sirupsen/logrus" -) - -// CreateStep configures the step for execution. -func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error { - var err error - - b := c.build - r := c.repo - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - ctn.Environment["BUILD_HOST"] = c.Hostname - ctn.Environment["VELA_HOST"] = c.Hostname - ctn.Environment["VELA_VERSION"] = version.Version.String() - // TODO: remove hardcoded reference - ctn.Environment["VELA_RUNTIME"] = "docker" - ctn.Environment["VELA_DISTRIBUTION"] = "linux" - - // update the engine step object - s := new(library.Step) - s.SetName(ctn.Name) - s.SetNumber(ctn.Number) - s.SetStatus(constants.StatusRunning) - s.SetStarted(time.Now().UTC().Unix()) - s.SetHost(ctn.Environment["VELA_HOST"]) - s.SetRuntime(ctn.Environment["VELA_RUNTIME"]) - s.SetDistribution(ctn.Environment["VELA_DISTRIBUTION"]) - - logger.Debug("uploading step state") - // send API call to update the step - s, _, err = c.Vela.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) - if err != nil { - return err - } - - s.SetStatus(constants.StatusSuccess) - - // add a step to a map - c.steps.Store(ctn.ID, s) - - // get the step log here - logger.Debug("retrieve step log") - // send API call to capture the step log - l, _, err := c.Vela.Log.GetStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber()) - if err != nil { - return err - } - - // add a step log to a map - c.stepLogs.Store(ctn.ID, l) - - return nil -} - -// PlanStep prepares the step for execution. -func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { - // TODO: remove hardcoded reference - if ctn.Name == "init" { - return nil - } - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - logger.Debug("setting up container") - // setup the runtime container - err := c.Runtime.SetupContainer(ctx, ctn) - if err != nil { - return err - } - - logger.Debug("injecting secrets") - // inject secrets for step - err = injectSecrets(ctn, c.Secrets) - if err != nil { - return err - } - - logger.Debug("marshaling configuration") - // marshal container configuration - body, err := json.Marshal(ctn) - if err != nil { - return fmt.Errorf("unable to marshal configuration: %v", err) - } - - // create substitute function - subFunc := func(name string) string { - env := ctn.Environment[name] - if strings.Contains(env, "\n") { - env = fmt.Sprintf("%q", env) - } - - return env - } - - logger.Debug("substituting environment") - // substitute the environment variables - subStep, err := envsubst.Eval(string(body), subFunc) - if err != nil { - return fmt.Errorf("unable to substitute environment variables: %v", err) - } - - logger.Debug("unmarshaling configuration") - // unmarshal container configuration - err = json.Unmarshal([]byte(subStep), ctn) - if err != nil { - return fmt.Errorf("unable to unmarshal configuration: %v", err) - } - - return nil -} - -// ExecStep runs a step. -func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { - // TODO: remove hardcoded reference - if ctn.Name == "init" { - return nil - } - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - logger.Debug("running container") - // run the runtime container - err := c.Runtime.RunContainer(ctx, ctn, c.pipeline) - if err != nil { - return err - } - - go func() { - logger.Debug("stream logs for container") - // stream logs from container - err := c.StreamStep(ctx, ctn) - if err != nil { - logrus.Error(err) - } - }() - - // do not wait for detached containers - if ctn.Detach { - return nil - } - - logger.Debug("waiting for container") - // wait for the runtime container - err = c.Runtime.WaitContainer(ctx, ctn) - if err != nil { - return err - } - - logger.Debug("inspecting container") - // inspect the runtime container - err = c.Runtime.InspectContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} - -// StreamStep tails the output for a step. -func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { - // TODO: remove hardcoded reference - if ctn.Name == "init" { - return nil - } - - b := c.build - r := c.repo - - result, ok := c.stepLogs.Load(ctn.ID) - if !ok { - return fmt.Errorf("unable to get step log from client") - } - - l := result.(*library.Log) - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - // create new buffer for uploading logs - logs := new(bytes.Buffer) - - logger.Debug("tailing container") - // tail the runtime container - rc, err := c.Runtime.TailContainer(ctx, ctn) - if err != nil { - return err - } - defer rc.Close() - - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("appending logs") - // send API call to append the logs for the step - l, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } - - // flush the buffer of logs - logs.Reset() - } - } - logger.Trace(logs.String()) - - // update the existing log with the last bytes - l.SetData(append(l.GetData(), logs.Bytes()...)) - - logger.Debug("uploading logs") - // send API call to update the logs for the step - _, _, err = c.Vela.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), ctn.Number, l) - if err != nil { - return err - } - - return nil -} - -// DestroyStep cleans up steps after execution. -func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error { - // TODO: remove hardcoded reference - if ctn.Name == "init" { - return nil - } - - // update engine logger with extra metadata - logger := c.logger.WithFields(logrus.Fields{ - "step": ctn.Name, - }) - - logger.Debug("removing container") - // remove the runtime container - err := c.Runtime.RemoveContainer(ctx, ctn) - if err != nil { - return err - } - - return nil -} diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go deleted file mode 100644 index 7e9a7240..00000000 --- a/executor/linux/step_test.go +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package linux - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/go-vela/mock/server" - - "github.com/go-vela/pkg-runtime/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - - "github.com/gin-gonic/gin" -) - -func TestExecutor_CreateStep_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }) - - // run test - got := e.CreateStep(context.Background(), e.pipeline.Steps[0]) - - if got != nil { - t.Errorf("CreateStep is %v, want nil", got) - } -} - -func TestExecutor_PlanStep_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithBuild(&library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - }) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }) - e.WithRepo(&library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - }) - - // run test - got := e.PlanStep(context.Background(), e.pipeline.Steps[0]) - - if got != nil { - t.Errorf("CreateStep is %v, want nil", got) - } -} - -func TestExecutor_ExecStep_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithBuild(&library.Build{ - Number: vela.Int(1), - Parent: vela.Int(1), - Event: vela.String("push"), - Status: vela.String("success"), - Error: vela.String(""), - Enqueued: vela.Int64(1563474077), - Created: vela.Int64(1563474076), - Started: vela.Int64(1563474077), - Finished: vela.Int64(0), - Deploy: vela.String(""), - Clone: vela.String("https://github.com/github/octocat.git"), - Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), - Title: vela.String("push received from https://github.com/github/octocat"), - Message: vela.String("First commit..."), - Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), - Sender: vela.String("OctoKitty"), - Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), - BaseRef: vela.String(""), - Host: vela.String("example.company.com"), - Runtime: vela.String("docker"), - Distribution: vela.String("linux"), - }) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }) - e.WithRepo(&library.Repo{ - Org: vela.String("github"), - Name: vela.String("octocat"), - FullName: vela.String("github/octocat"), - Link: vela.String("https://github.com/github/octocat"), - Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), - Timeout: vela.Int64(60), - Visibility: vela.String("public"), - Private: vela.Bool(false), - Trusted: vela.Bool(false), - Active: vela.Bool(true), - AllowPull: vela.Bool(false), - AllowPush: vela.Bool(true), - AllowDeploy: vela.Bool(false), - AllowTag: vela.Bool(false), - }) - e.stepLogs.Store(e.pipeline.Steps[0].ID, new(library.Log)) - e.steps.Store(e.pipeline.Steps[0].ID, new(library.Step)) - - // run test - got := e.ExecStep(context.Background(), e.pipeline.Steps[0]) - - if got != nil { - t.Errorf("ExecStep is %v, want nil", got) - } -} - -func TestExecutor_DestroyStep_Success(t *testing.T) { - // setup - r, _ := docker.NewMock() - - // setup context - gin.SetMode(gin.TestMode) - - s := httptest.NewServer(server.FakeHandler()) - c, _ := vela.NewClient(s.URL, nil) - - e, _ := New(c, r) - e.WithPipeline(&pipeline.Build{ - Version: "1", - ID: "__0", - Services: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "service_org_repo_0_postgres;", - Environment: map[string]string{}, - Image: "postgres:11-alpine", - Name: "postgres", - Ports: []string{"5432:5432"}, - }, - }, - Steps: pipeline.ContainerSlice{ - &pipeline.Container{ - ID: "__0_clone", - Environment: map[string]string{}, - Image: "target/vela-plugins/git:1", - Name: "clone", - Number: 1, - Pull: true, - }, - &pipeline.Container{ - ID: "__0_exit", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "exit", - Number: 2, - Pull: true, - Ruleset: pipeline.Ruleset{ - Continue: true, - }, - Commands: []string{"exit 1"}, - }, - &pipeline.Container{ - ID: "__0_echo", - Environment: map[string]string{}, - Image: "alpine:latest", - Name: "echo", - Number: 2, - Pull: true, - Commands: []string{"echo ${FOOBAR}"}, - Secrets: pipeline.StepSecretSlice{ - &pipeline.StepSecret{ - Source: "foobar", - Target: "foobar", - }, - }, - }, - }, - }) - - // run test - got := e.DestroyStep(context.Background(), e.pipeline.Steps[0]) - - if got != nil { - t.Errorf("DestroyStep is %v, want nil", got) - } -} diff --git a/go.mod b/go.mod index cce5cc7b..f410ef93 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,12 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 - github.com/drone/envsubst v1.0.2 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/mock v0.3.0 github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 - github.com/google/go-cmp v0.3.1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.4.2 diff --git a/router/middleware/executor.go b/router/middleware/executor.go index 78e8b8af..e51a458f 100644 --- a/router/middleware/executor.go +++ b/router/middleware/executor.go @@ -6,14 +6,15 @@ package middleware import ( "github.com/gin-gonic/gin" - "github.com/go-vela/worker/executor" + + "github.com/go-vela/pkg-executor/executor" ) -// Executor is a middleware function that initializes the executor and -// attaches to the context of every http.Request. -func Executor(e map[int]executor.Engine) gin.HandlerFunc { +// Executors is a middleware function that attaches the +// executors to the context of every http.Request. +func Executors(e map[int]executor.Engine) gin.HandlerFunc { return func(c *gin.Context) { - executor.ToContext(c, e) + c.Set("executors", e) c.Next() } } diff --git a/router/middleware/executor/context.go b/router/middleware/executor/context.go deleted file mode 100644 index 2d801bd8..00000000 --- a/router/middleware/executor/context.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package executor - -import ( - "context" - - "github.com/go-vela/worker/executor" -) - -const key = "executor" - -// Setter defines a context that enables setting values. -type Setter interface { - Set(string, interface{}) -} - -// FromContext returns the Executor associated with this context. -func FromContext(c context.Context) executor.Engine { - value := c.Value(key) - if value == nil { - return nil - } - - r, ok := value.(executor.Engine) - if !ok { - return nil - } - - return r -} - -// ToContext adds the Executor to this context if it supports -// the Setter interface. -func ToContext(c Setter, e executor.Engine) { - c.Set(key, e) -} diff --git a/router/middleware/executor/context_test.go b/router/middleware/executor/context_test.go deleted file mode 100644 index b784db52..00000000 --- a/router/middleware/executor/context_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this executorsitory. - -package executor - -import ( - "testing" - - "github.com/go-vela/worker/executor/linux" - - "github.com/gin-gonic/gin" -) - -func TestRepo_FromContext(t *testing.T) { - // setup types - want, _ := linux.New(nil, nil) - - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, want) - - // run test - got := FromContext(context) - - if got != want { - t.Errorf("FromContext is %v, want %v", got, want) - } -} - -func TestRepo_FromContext_Bad(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, nil) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestRepo_FromContext_WrongType(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, 1) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestRepo_FromContext_Empty(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestRepo_ToContext(t *testing.T) { - // setup types - want, _ := linux.New(nil, nil) - - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - ToContext(context, want) - - // run test - got := context.Value(key) - - if got != want { - t.Errorf("ToContext is %v, want %v", got, want) - } -} diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index 92eb9da9..d3035572 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -5,21 +5,21 @@ package executor import ( - "strconv" - - "github.com/go-vela/types" - exec "github.com/go-vela/worker/executor" - "fmt" "net/http" + "strconv" "github.com/gin-gonic/gin" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/types" + "github.com/sirupsen/logrus" ) // Retrieve gets the repo in the given context -func Retrieve(c *gin.Context) exec.Engine { - return FromContext(c) +func Retrieve(c *gin.Context) executor.Engine { + return executor.FromGinContext(c) } // Establish sets the executor in the given context @@ -28,27 +28,52 @@ func Establish() gin.HandlerFunc { param := c.Param("executor") if len(param) == 0 { msg := "No executor parameter provided" + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + return } number, err := strconv.Atoi(param) if err != nil { msg := fmt.Sprintf("invalid executor parameter provided: %s", param) + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + + return + } + + // capture executors value from context + value := c.Value("executors") + if value == nil { + msg := fmt.Sprintf("no running executors found") + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + return + } + + // cast executors value to expected type + executors, ok := value.(map[int]executor.Engine) + if !ok { + msg := fmt.Sprintf("unable to get executors") + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + return } - executors := exec.FromContext(c) logrus.Debugf("Reading executor %s", param) e, ok := executors[number] if !ok { msg := fmt.Sprintf("unable to get executor %s", param) - c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + return } - ToContext(c, e) + executor.WithGinContext(c, e) c.Next() } } diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 1fdd6c6f..2ccf1ff1 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -11,19 +11,40 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/worker/executor" - "github.com/go-vela/worker/executor/linux" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" ) func TestExecutor_Retrieve(t *testing.T) { // setup types - want, _ := linux.New(nil, nil) - - // setup context gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - ToContext(context, want) + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want, err := executor.New(&executor.Setup{ + Driver: constants.DriverLinux, + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), + }) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup context + context := new(gin.Context) + executor.WithGinContext(context, want) // run test got := Retrieve(context) @@ -35,19 +56,38 @@ func TestExecutor_Retrieve(t *testing.T) { func TestExecutor_Establish(t *testing.T) { // setup types - want := make(map[int]executor.Engine) - want[0], _ = linux.New(nil, nil) - got := want[0] - - // setup context gin.SetMode(gin.TestMode) + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want, err := executor.New(&executor.Setup{ + Driver: constants.DriverLinux, + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), + }) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + _executors := make(map[int]executor.Engine) + _executors[0] = want + + got := *new(executor.Engine) + + // setup context resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) // setup mock server - engine.Use(func(c *gin.Context) { executor.ToContext(c, want) }) + engine.Use(func(c *gin.Context) { c.Set("executors", _executors) }) engine.Use(Establish()) engine.GET("/executors/:executor", func(c *gin.Context) { got = Retrieve(c) @@ -62,15 +102,16 @@ func TestExecutor_Establish(t *testing.T) { t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) } - if !reflect.DeepEqual(got, want[0]) { + if !reflect.DeepEqual(got, want) { t.Errorf("Establish is %v, want %v", got, want) } } func TestExecutor_Establish_NoExecutor(t *testing.T) { - // setup context + // setup types gin.SetMode(gin.TestMode) + // setup context resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) From 8b053814448e45dc263fab74fe86a57516d872b7 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 27 Mar 2020 15:19:00 -0500 Subject: [PATCH 082/430] test(router): add 100% coverage (#74) --- router/build.go | 1 + router/build_test.go | 44 ++++++++++++++++++++++ router/executor.go | 10 ----- router/executor_test.go | 68 ++++++++++++++++++++++++++++++++++ router/pipeline.go | 1 + router/pipeline_test.go | 38 +++++++++++++++++++ router/repo.go | 1 + router/repo_test.go | 38 +++++++++++++++++++ router/router.go | 10 ++--- router/router_test.go | 82 +++++++++++++++++++++++++++++++++++++++++ 10 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 router/build_test.go create mode 100644 router/executor_test.go create mode 100644 router/pipeline_test.go create mode 100644 router/repo_test.go create mode 100644 router/router_test.go diff --git a/router/build.go b/router/build.go index e5a9a1ec..2d2597e1 100644 --- a/router/build.go +++ b/router/build.go @@ -6,6 +6,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" ) diff --git a/router/build_test.go b/router/build_test.go new file mode 100644 index 00000000..bff2da71 --- /dev/null +++ b/router/build_test.go @@ -0,0 +1,44 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/api" +) + +func TestRouter_BuildHandlers(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + _engine := gin.New() + + want := gin.RoutesInfo{ + { + Method: "GET", + Path: "/build", + Handler: "github.com/go-vela/worker/api.GetBuild", + HandlerFunc: api.GetBuild, + }, + { + Method: "DELETE", + Path: "/build/kill", + Handler: "github.com/go-vela/worker/api.KillBuild", + HandlerFunc: api.KillBuild, + }, + } + + // run test + BuildHandlers(&_engine.RouterGroup) + + got := _engine.Routes() + + if len(got) != len(want) { + t.Errorf("BuildHandlers is %v, want %v", got, want) + } +} diff --git a/router/executor.go b/router/executor.go index 42664188..6c8bdd5e 100644 --- a/router/executor.go +++ b/router/executor.go @@ -10,16 +10,6 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) -// executorHandlers is a function that extends the provided base router group -// with the API handlers for build functionality. -// -// GET /api/v1/executors -// GET /api/v1/executors/:executor -// GET /api/v1/executors/:executor/build -// DELETE /api/v1/executors/:executor/build/kill -// GET /api/v1/executors/:executor/pipeline -// GET /api/v1/executors/:executor/repo - // ExecutorHandlers extends the provided base router group // by adding a collection of endpoints for handling // executor related requests. diff --git a/router/executor_test.go b/router/executor_test.go new file mode 100644 index 00000000..609ae5d8 --- /dev/null +++ b/router/executor_test.go @@ -0,0 +1,68 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/api" +) + +func TestRouter_ExecutorHandlers(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + _engine := gin.New() + + want := gin.RoutesInfo{ + { + Method: "GET", + Path: "/executors", + Handler: "github.com/go-vela/worker/api.GetExecutors", + HandlerFunc: api.GetExecutors, + }, + { + Method: "GET", + Path: "/executors/:executor", + Handler: "github.com/go-vela/worker/api.GetExecutor", + HandlerFunc: api.GetExecutor, + }, + { + Method: "GET", + Path: "/executors/:executor/build", + Handler: "github.com/go-vela/worker/api.GetBuild", + HandlerFunc: api.GetBuild, + }, + { + Method: "DELETE", + Path: "/executors/:executor/build/kill", + Handler: "github.com/go-vela/worker/api.KillBuild", + HandlerFunc: api.KillBuild, + }, + { + Method: "GET", + Path: "/executors/:executor/pipeline", + Handler: "github.com/go-vela/worker/api.GetPipeline", + HandlerFunc: api.GetPipeline, + }, + { + Method: "GET", + Path: "/executors/:executor/repo", + Handler: "github.com/go-vela/worker/api.GetRepo", + HandlerFunc: api.GetRepo, + }, + } + + // run test + ExecutorHandlers(&_engine.RouterGroup) + + got := _engine.Routes() + + if len(got) != len(want) { + t.Errorf("ExecutorHandlers is %v, want %v", got, want) + } +} diff --git a/router/pipeline.go b/router/pipeline.go index 6f333334..38854e39 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -6,6 +6,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" ) diff --git a/router/pipeline_test.go b/router/pipeline_test.go new file mode 100644 index 00000000..00dfe97a --- /dev/null +++ b/router/pipeline_test.go @@ -0,0 +1,38 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/api" +) + +func TestRouter_PipelineHandlers(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + _engine := gin.New() + + want := gin.RoutesInfo{ + { + Method: "GET", + Path: "/pipeline", + Handler: "github.com/go-vela/worker/api.GetPipeline", + HandlerFunc: api.GetPipeline, + }, + } + + // run test + PipelineHandlers(&_engine.RouterGroup) + + got := _engine.Routes() + + if len(got) != len(want) { + t.Errorf("PipelineHandlers is %v, want %v", got, want) + } +} diff --git a/router/repo.go b/router/repo.go index 629632ba..61187671 100644 --- a/router/repo.go +++ b/router/repo.go @@ -6,6 +6,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" ) diff --git a/router/repo_test.go b/router/repo_test.go new file mode 100644 index 00000000..2873f3dd --- /dev/null +++ b/router/repo_test.go @@ -0,0 +1,38 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/api" +) + +func TestRouter_RepoHandlers(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + _engine := gin.New() + + want := gin.RoutesInfo{ + { + Method: "GET", + Path: "/repo", + Handler: "github.com/go-vela/worker/api.GetRepo", + HandlerFunc: api.GetRepo, + }, + } + + // run test + RepoHandlers(&_engine.RouterGroup) + + got := _engine.Routes() + + if len(got) != len(want) { + t.Errorf("RepoHandlers is %v, want %v", got, want) + } +} diff --git a/router/router.go b/router/router.go index 2ade6005..b47403fc 100644 --- a/router/router.go +++ b/router/router.go @@ -70,15 +70,15 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group baseAPI := r.Group(base, user.Establish(), perm.MustServer()) { - // add a collection of endpoints for handling executor related requests - // - // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#ExecutorHandlers - ExecutorHandlers(baseAPI) - // add an endpoint for shutting down the worker // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.POST baseAPI.POST("/shutdown", api.Shutdown) + + // add a collection of endpoints for handling executor related requests + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#ExecutorHandlers + ExecutorHandlers(baseAPI) } return r diff --git a/router/router_test.go b/router/router_test.go new file mode 100644 index 00000000..d2e0e802 --- /dev/null +++ b/router/router_test.go @@ -0,0 +1,82 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package router + +import ( + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/api" +) + +func TestRouter_Load(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + want := gin.RoutesInfo{ + { + Method: "GET", + Path: "/health", + Handler: "github.com/go-vela/worker/api.Health", + HandlerFunc: api.Health, + }, + { + Method: "GET", + Path: "/metrics", + Handler: "github.com/go-vela/worker/api.Metrics", + HandlerFunc: gin.WrapH(api.Metrics()), + }, + { + Method: "POST", + Path: "/api/v1/shutdown", + Handler: "github.com/go-vela/worker/api.Shutdown", + HandlerFunc: api.Shutdown, + }, + { + Method: "GET", + Path: "/api/v1/executors", + Handler: "github.com/go-vela/worker/api.GetExecutors", + HandlerFunc: api.GetExecutors, + }, + { + Method: "GET", + Path: "/api/v1/executors/:executor", + Handler: "github.com/go-vela/worker/api.GetExecutor", + HandlerFunc: api.GetExecutor, + }, + { + Method: "GET", + Path: "/api/v1/executors/:executor/build", + Handler: "github.com/go-vela/worker/api.GetBuild", + HandlerFunc: api.GetBuild, + }, + { + Method: "DELETE", + Path: "/api/v1/executors/:executor/build/kill", + Handler: "github.com/go-vela/worker/api.KillBuild", + HandlerFunc: api.KillBuild, + }, + { + Method: "GET", + Path: "/api/v1/executors/:executor/pipeline", + Handler: "github.com/go-vela/worker/api.GetPipeline", + HandlerFunc: api.GetPipeline, + }, + { + Method: "GET", + Path: "/api/v1/executors/:executor/repo", + Handler: "github.com/go-vela/worker/api.GetRepo", + HandlerFunc: api.GetRepo, + }, + } + + // run test + got := Load() + + if len(got.Routes()) != len(want) { + t.Errorf("Load is %v, want %v", got.Routes(), want) + } +} From 2636862a034ebf456ab435a4363914b183333b99 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 30 Mar 2020 11:47:28 -0500 Subject: [PATCH 083/430] fix: explictly make executor map (#75) --- cmd/vela-worker/run.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index debc2551..9f2536d1 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -87,6 +87,7 @@ func run(c *cli.Context) error { Secret: c.String("server.secret"), }, }, + Executors: make(map[int]executor.Engine), } // validate the worker From de677718ef3d437b8a5a0773af7c6de44d0f6c0f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 31 Mar 2020 15:29:03 -0500 Subject: [PATCH 084/430] feat: enable setting hostname (#76) --- cmd/vela-worker/flags.go | 16 ++++++++++++---- cmd/vela-worker/main.go | 16 ++++++++++++++++ cmd/vela-worker/run.go | 7 +++++++ cmd/vela-worker/validate.go | 5 +++++ cmd/vela-worker/worker.go | 1 + go.mod | 6 +++--- go.sum | 28 ++++++++++++++++++++++------ 7 files changed, 66 insertions(+), 13 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 18ca8a3d..7efc6b2a 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -18,10 +18,9 @@ func flags() []cli.Flag { f := []cli.Flag{ cli.StringFlag{ - EnvVar: "WORKER_LOG_LEVEL,VELA_LOG_LEVEL,LOG_LEVEL", - Name: "log.level", - Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", - Value: "info", + EnvVar: "WORKER_HOSTNAME,VELA_HOSTNAME,HOSTNAME", + Name: "hostname", + Usage: "set hostname for the worker", }, // API Flags @@ -48,6 +47,15 @@ func flags() []cli.Flag { Value: 30 * time.Minute, }, + // Logging Flags + + cli.StringFlag{ + EnvVar: "WORKER_LOG_LEVEL,VELA_LOG_LEVEL,LOG_LEVEL", + Name: "log.level", + Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", + Value: "info", + }, + // Server Flags cli.StringFlag{ diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index fb6fdbf3..6d542f4a 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -17,6 +17,22 @@ import ( _ "github.com/joho/godotenv/autoload" ) +// hostname stores the worker host name reported by the kernel. +var hostname string + +// create an init function to set the hostname for the worker. +// +// https://golang.org/doc/effective_go.html#init +func init() { + // attempt to capture the hostname for the worker + hostname, _ = os.Hostname() + // check if a hostname is set + if len(hostname) == 0 { + // default the hostname to localhost + hostname = "localhost" + } +} + func main() { app := cli.NewApp() diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 9f2536d1..d27e1ac0 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -64,6 +64,8 @@ func run(c *cli.Context) error { Limit: c.Int("build.limit"), Timeout: c.Duration("build.timeout"), }, + // hostname configuration + Hostname: c.String("hostname"), // executor configuration Executor: &executor.Setup{ Driver: c.String("executor.driver"), @@ -90,6 +92,11 @@ func run(c *cli.Context) error { Executors: make(map[int]executor.Engine), } + // set the worker hostname if no flag was provided + if len(w.Config.Hostname) == 0 { + w.Config.Hostname = hostname + } + // validate the worker err := w.Validate() if err != nil { diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 5594d921..b2d32812 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -24,6 +24,11 @@ func (w *Worker) Validate() error { return fmt.Errorf("no worker build timeout provided") } + // verify a hostname was provided + if len(w.Config.Hostname) == 0 { + return fmt.Errorf("no worker hostname provided") + } + // verify a server address was provided if len(w.Config.Server.Address) == 0 { return fmt.Errorf("no worker server address provided") diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index e76be1b9..48124bf0 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -35,6 +35,7 @@ type ( API *API Build *Build Executor *executor.Setup + Hostname string Queue *queue.Setup Runtime *runtime.Setup Server *Server diff --git a/go.mod b/go.mod index f410ef93..fe80afb6 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce + github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 - github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 + github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 - github.com/sirupsen/logrus v1.4.2 + github.com/sirupsen/logrus v1.5.0 github.com/urfave/cli v1.22.3 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 diff --git a/go.sum b/go.sum index 62790100..39d940ef 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,7 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= @@ -73,6 +74,7 @@ github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJIC github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -109,14 +111,14 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-vela/compiler v0.3.1-0.20200302143952-6a5a26ba1fbc/go.mod h1:rO03l8MoeyQkhd450SnphZquB7l7Qs+cT/3BIVq8MfE= github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= -github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce h1:NOB5XcuWvaXvyQ29PERNwL2G4qFQnEer0fQZqyhuGcU= -github.com/go-vela/pkg-executor v0.0.0-20200320141426-919f31b8efce/go.mod h1:XoCJlIPkjC0s4/vn/L2Gu05FrfH6ceO+K4oAPPquiKc= +github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38 h1:IImUUJF4t0f/RVAh4K1uzzQtwaJLO01prIZjd8z3r54= +github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38/go.mod h1:NEOd1uO5PQDxXnlaFWdxtmNmlTZq2l276BPHhmthTJk= +github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc h1:2/0iTOpB8SeK+6kj21glS2l9BUnaoA7+8TIYn4v2HFE= +github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc/go.mod h1:Cu8fUZ0+OQnsiw0BVs96j3y6FymWv8VytcckKm7PVc0= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 h1:k+fWWmmBEqpWqdHoPFprmU6yNN84VipQQP49wORLzus= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50/go.mod h1:A6Wk/bIng02YxbEY3N7pUHZcYZyp4LW02dPI76zEPkE= -github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40 h1:HVgm8JDG+nziVBa2yA1nXzg3GUVUa8Kvrlg6f9n8yQc= -github.com/go-vela/pkg-runtime v0.0.0-20200313134933-49f853669b40/go.mod h1:J2xYqm8CgZpqQUojPWuLnYgJWS6hknr5rgZst9qKP84= -github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6 h1:itH+bt9u9UjnUignpZjeC4IO2QTyEV+JZpUjvMaseVc= -github.com/go-vela/pkg-runtime v0.0.0-20200320140020-301529af29f6/go.mod h1:kXPhZCxsVJjDK9enk3x80WHwB9q65l269qivJwQTjG8= +github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d h1:U7olyS7IAd5bwzOWp48OeXUEEkUz7vUoURNge9Q5IcA= +github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d/go.mod h1:vmADEw/T7DEv41UVfXa+HFiI3wK4ttUXox3h0GVjKBo= github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 h1:UluZMmYC/AHpmhOqB2n9YPCj2vAYi2aeYNwOdKAA+o4= @@ -141,6 +143,8 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -167,6 +171,8 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -250,6 +256,8 @@ github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -280,8 +288,11 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= +github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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= @@ -384,6 +395,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-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -404,6 +416,8 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -436,6 +450,8 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 6258a232c5fb5369db9d518f9679e48ae66f15c2 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 31 Mar 2020 16:19:27 -0500 Subject: [PATCH 085/430] feat: enable setting log format (#77) --- cmd/vela-worker/flags.go | 10 ++++++++-- cmd/vela-worker/main.go | 3 --- cmd/vela-worker/run.go | 27 ++++++++++++++++++++++----- cmd/vela-worker/worker.go | 7 +++++++ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 7efc6b2a..e0783462 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -47,12 +47,18 @@ func flags() []cli.Flag { Value: 30 * time.Minute, }, - // Logging Flags + // Logger Flags + cli.StringFlag{ + EnvVar: "WORKER_LOG_FORMAT,VELA_LOG_FORMAT,LOG_FORMAT", + Name: "log.format", + Usage: "set log format for the worker", + Value: "json", + }, cli.StringFlag{ EnvVar: "WORKER_LOG_LEVEL,VELA_LOG_LEVEL,LOG_LEVEL", Name: "log.level", - Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", + Usage: "set log level for the worker", Value: "info", }, diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 6d542f4a..a1de4dc8 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -59,9 +59,6 @@ func main() { app.Flags = flags() - // set logrus to log in JSON format - logrus.SetFormatter(&logrus.JSONFormatter{}) - // Worker Start err := app.Run(os.Args) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index d27e1ac0..a8492084 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -20,6 +20,16 @@ import ( // run executes the worker based off the configuration provided. func run(c *cli.Context) error { + // set log format for the worker + switch c.String("log.format") { + case "t", "text", "Text", "TEXT": + logrus.SetFormatter(&logrus.TextFormatter{}) + case "j", "json", "Json", "JSON": + fallthrough + default: + logrus.SetFormatter(&logrus.JSONFormatter{}) + } + // set log level for the worker switch c.String("log.level") { case "t", "trace", "Trace", "TRACE": @@ -28,9 +38,6 @@ func run(c *cli.Context) error { case "d", "debug", "Debug", "DEBUG": gin.SetMode(gin.DebugMode) logrus.SetLevel(logrus.DebugLevel) - case "i", "info", "Info", "INFO": - gin.SetMode(gin.ReleaseMode) - logrus.SetLevel(logrus.InfoLevel) case "w", "warn", "Warn", "WARN": gin.SetMode(gin.ReleaseMode) logrus.SetLevel(logrus.WarnLevel) @@ -43,6 +50,11 @@ func run(c *cli.Context) error { case "p", "panic", "Panic", "PANIC": gin.SetMode(gin.ReleaseMode) logrus.SetLevel(logrus.PanicLevel) + case "i", "info", "Info", "INFO": + fallthrough + default: + gin.SetMode(gin.ReleaseMode) + logrus.SetLevel(logrus.InfoLevel) } logrus.WithFields(logrus.Fields{ @@ -64,12 +76,17 @@ func run(c *cli.Context) error { Limit: c.Int("build.limit"), Timeout: c.Duration("build.timeout"), }, - // hostname configuration - Hostname: c.String("hostname"), // executor configuration Executor: &executor.Setup{ Driver: c.String("executor.driver"), }, + // hostname configuration + Hostname: c.String("hostname"), + // logger configuration + Logger: &Logger{ + Format: c.String("log.format"), + Level: c.String("log.level"), + }, // runtime configuration Runtime: &runtime.Setup{ Driver: c.String("runtime.driver"), diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 48124bf0..c1305b25 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -24,6 +24,12 @@ type ( Timeout time.Duration } + // Logger represents the worker configuration for logger information. + Logger struct { + Format string + Level string + } + // Server represents the worker configuration for server information. Server struct { Address string @@ -36,6 +42,7 @@ type ( Build *Build Executor *executor.Setup Hostname string + Logger *Logger Queue *queue.Setup Runtime *runtime.Setup Server *Server From 971e6277be585b3358caa952587e3f42579bda4f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 7 Apr 2020 09:51:20 -0500 Subject: [PATCH 086/430] feat: add exec() to run builds (#78) * chore: update go-vela dependencies * feat: add exec() to run builds * docs: add comments and links * refactor: fix linter errors --- cmd/vela-worker/client.go | 8 +- cmd/vela-worker/exec.go | 148 ++++++++++++++++++++++++++++++++++++ cmd/vela-worker/flags.go | 3 + cmd/vela-worker/operate.go | 135 ++++++-------------------------- cmd/vela-worker/run.go | 6 +- cmd/vela-worker/server.go | 11 ++- cmd/vela-worker/start.go | 32 ++++++-- cmd/vela-worker/validate.go | 4 + cmd/vela-worker/worker.go | 10 ++- go.mod | 4 +- go.sum | 8 +- 11 files changed, 238 insertions(+), 131 deletions(-) create mode 100644 cmd/vela-worker/exec.go diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 622c4ac5..157b4705 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -14,11 +14,17 @@ import ( func setupClient(s *Server) (*vela.Client, error) { logrus.Debug("creating vela client from worker configuration") + // create a new Vela client from the server configuration + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#NewClient vela, err := vela.NewClient(s.Address, nil) if err != nil { return nil, err } - // set token for auth + + // set token for authentication with the server + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#AuthenticationService.SetTokenAuth vela.Authentication.SetTokenAuth(s.Secret) return vela, nil diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go new file mode 100644 index 00000000..63290c33 --- /dev/null +++ b/cmd/vela-worker/exec.go @@ -0,0 +1,148 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "context" + "os" + "os/signal" + "syscall" + "time" + + "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/sirupsen/logrus" +) + +// exec is a helper function to poll the queue +// and execute Vela pipelines for the Worker. +func (w *Worker) exec(index int) error { + var err error + + // setup the runtime + // + // https://pkg.go.dev/github.com/go-vela/pkg-runtime/runtime?tab=doc#New + w.Runtime, err = runtime.New(w.Config.Runtime) + if err != nil { + return err + } + + // capture an item from the queue + item, err := w.Queue.Pop() + if err != nil { + return err + } + + // setup the executor + // + // https://godoc.org/github.com/go-vela/pkg-executor/executor#New + _executor, err := executor.New(&executor.Setup{ + Driver: w.Config.Executor.Driver, + Client: w.VelaClient, + Hostname: w.Config.Hostname, + Runtime: w.Runtime, + Build: item.Build, + Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), + Repo: item.Repo, + User: item.User, + }) + + // add the executor to the worker + w.Executors[index] = _executor + + // create logger with extra metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields + logger := logrus.WithFields(logrus.Fields{ + "build": item.Build.GetNumber(), + "host": w.Config.Hostname, + "repo": item.Repo.GetFullName(), + }) + + // capture the configured build timeout + t := w.Config.Build.Timeout + // check if the repository has a custom timeout + if item.Repo.GetTimeout() > 0 { + // update timeout variable to repository custom timeout + t = time.Duration(item.Repo.GetTimeout()) * time.Minute + } + + // create a background context + ctx := context.Background() + + // add to the background context with a timeout + // built in for ensuring a build doesn't run forever + ctx, timeout := context.WithTimeout(ctx, t) + defer timeout() + + // create channel for catching OS signals + sigchan := make(chan os.Signal, 1) + + // add a cancelation signal to our current context + ctx, sig := context.WithCancel(ctx) + + // set the OS signals the Worker will respond to + signal.Notify(sigchan, syscall.SIGTERM) + + // defer canceling the context + defer func() { + signal.Stop(sigchan) + sig() + }() + + // spawn a goroutine to listen for the signals + go func() { + select { + case <-sigchan: + sig() + case <-ctx.Done(): + } + }() + + defer func() { + logger.Info("destroying build") + // destroy the build with the executor + err = _executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + }() + + logger.Info("creating build") + // create the build with the executor + err = _executor.CreateBuild(ctx) + if err != nil { + logger.Errorf("unable to create build: %v", err) + return err + } + + logger.Info("planning build") + // plan the build with the executor + err = _executor.PlanBuild(ctx) + if err != nil { + logger.Errorf("unable to plan build: %v", err) + return err + } + + logger.Info("executing build") + // execute the build with the executor + err = _executor.ExecBuild(ctx) + if err != nil { + logger.Errorf("unable to execute build: %v", err) + return err + } + + logger.Info("destroying build") + // destroy the build with the executor + err = _executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + + logger.Info("completed build") + + return nil +} diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index e0783462..f9f97ff3 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -14,6 +14,9 @@ import ( "github.com/urfave/cli" ) +// flags is a helper function to return the all +// supported command line interface (CLI) flags +// for the Worker. func flags() []cli.Flag { f := []cli.Flag{ diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index e5977338..cae7b66e 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -5,146 +5,59 @@ package main import ( - "context" - "os" - "os/signal" - "syscall" - "time" - - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-queue/queue" - "github.com/go-vela/pkg-runtime/runtime" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" ) -// operate is a helper function to ... +// operate is a helper function to initiate all +// subprocesses for the operator to poll the +// queue and execute Vela pipelines. func (w *Worker) operate() error { + var err error + // setup the client - _client, err := setupClient(w.Config.Server) + w.VelaClient, err = setupClient(w.Config.Server) if err != nil { - logrus.Fatal(err) + return err } // setup the queue + // + // https://pkg.go.dev/github.com/go-vela/pkg-queue/queue?tab=doc#New w.Queue, err = queue.New(w.Config.Queue) if err != nil { - logrus.Fatal(err) + return err } + // create the errgroup for managing operator subprocesses + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group executors := new(errgroup.Group) + // iterate till the configured build limit for i := 0; i < w.Config.Build.Limit; i++ { logrus.Infof("Thread ID %d listening to queue...", i) + + // spawn errgroup routine for operator subprocess + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Go executors.Go(func() error { + // create an infinite loop to poll for builds for { - // setup the runtime - w.Runtime, err = runtime.New(w.Config.Runtime) - if err != nil { - logrus.Fatal(err) - } - - // capture an item from the queue - item, err := w.Queue.Pop() + // exec operator subprocess to poll and execute builds + err = w.exec(i) if err != nil { return err } - - _executor, err := executor.New(&executor.Setup{ - Driver: w.Config.Executor.Driver, - Client: _client, - Runtime: w.Runtime, - Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), - Repo: item.Repo, - User: item.User, - }) - - w.Executors[i] = _executor - - // create logger with extra metadata - logger := logrus.WithFields(logrus.Fields{ - "build": item.Build.GetNumber(), - "repo": item.Repo.GetFullName(), - }) - - t := w.Config.Build.Timeout - // check if the repository has a custom timeout - if item.Repo.GetTimeout() > 0 { - // update timeout variable to repository custom timeout - t = time.Duration(item.Repo.GetTimeout()) * time.Minute - } - - ctx := context.Background() - - // add to the background context with a timeout - // built in for ensuring a build doesn't run forever - ctx, timeout := context.WithTimeout(ctx, t) - defer timeout() - - // add signals to the parent context so - // users can cancel builds - sigchan := make(chan os.Signal, 1) - ctx, sig := context.WithCancel(ctx) - signal.Notify(sigchan, syscall.SIGTERM) - defer func() { - signal.Stop(sigchan) - sig() - }() - go func() { - select { - case <-sigchan: - sig() - case <-ctx.Done(): - } - }() - - defer func() { - logger.Info("destroying build") - // destroy the build with the executor - err = _executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - }() - - logger.Info("creating build") - // create the build with the executor - err = _executor.CreateBuild(ctx) - if err != nil { - logger.Errorf("unable to create build: %v", err) - return err - } - - logger.Info("planning build") - // plan the build with the executor - err = _executor.PlanBuild(ctx) - if err != nil { - logger.Errorf("unable to plan build: %v", err) - return err - } - - logger.Info("executing build") - // execute the build with the executor - err = _executor.ExecBuild(ctx) - if err != nil { - logger.Errorf("unable to execute build: %v", err) - return err - } - - logger.Info("destroying build") - // destroy the build with the executor - err = _executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - - logger.Info("completed build") } }) } + // wait for errors from operator subprocesses + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait return executors.Wait() } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index a8492084..8c9f55c4 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -18,7 +18,8 @@ import ( _ "github.com/joho/godotenv/autoload" ) -// run executes the worker based off the configuration provided. +// run executes the worker based +// off the configuration provided. func run(c *cli.Context) error { // set log format for the worker switch c.String("log.format") { @@ -57,6 +58,9 @@ func run(c *cli.Context) error { logrus.SetLevel(logrus.InfoLevel) } + // create a log entry with extra metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields logrus.WithFields(logrus.Fields{ "code": "https://github.com/go-vela/worker/", "docs": "https://go-vela.github.io/docs/concepts/infrastructure/worker/", diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index f23c96fa..40109c61 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -13,10 +13,13 @@ import ( "github.com/sirupsen/logrus" ) -// server is a helper function to ... +// server is a helper function to listen and serve +// traffic for web and API requests for the Worker. func (w *Worker) server() error { // create the worker router to listen and serve traffic - router := router.Load( + // + // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#Load + _server := router.Load( middleware.RequestVersion, middleware.Executors(w.Executors), middleware.Secret(w.Config.Server.Secret), @@ -24,5 +27,7 @@ func (w *Worker) server() error { ) // start serving traffic on the provided worker port - return router.Run(w.Config.API.Port) + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run + return _server.Run(w.Config.API.Port) } diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 4dde23f4..c17241a8 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -10,19 +10,31 @@ import ( tomb "gopkg.in/tomb.v2" ) -// Start does stuff... +// Start initiates all subprocesses for the Worker +// from the provided configuration. The server +// subprocess enables the Worker to listen and +// serve traffic for web and API requests. The +// operator subprocess enables the Worker to +// poll the queue and execute Vela pipelines. func (w *Worker) Start() error { - // create the tomb for managing worker processes + // create the tomb for managing worker subprocesses + // + // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb tomb := new(tomb.Tomb) - // spawn a tomb goroutine to manage the worker processes + // spawn a tomb goroutine to manage the worker subprocesses + // + // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Go tomb.Go(func() error { - // spawn goroutine for starting the worker + // spawn goroutine for starting the server go func() { logrus.Info("starting worker server") // start the server for the worker err := w.server() if err != nil { + // kill the worker subprocesses + // + // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill tomb.Kill(err) } }() @@ -33,19 +45,29 @@ func (w *Worker) Start() error { // start the operator for the worker err := w.operate() if err != nil { + // kill the worker subprocesses + // + // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill tomb.Kill(err) } }() + // create an infinite loop to poll for errors for { + // create a select statement to check for errors select { + // check if one of the worker subprocesses died case <-tomb.Dying(): + // fatally log that we're shutting down the worker logrus.Fatal("shutting down worker") + return tomb.Err() } } }) - // watch for errors from worker processes + // wait for errors from worker subprocesses + // + // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Wait return tomb.Wait() } diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index b2d32812..9406bad7 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -45,12 +45,16 @@ func (w *Worker) Validate() error { } // verify the queue configuration + // + // https://godoc.org/github.com/go-vela/pkg-queue/queue#Setup.Validate err := w.Config.Queue.Validate() if err != nil { return err } // verify the runtime configuration + // + // https://godoc.org/github.com/go-vela/pkg-runtime/runtime#Setup.Validate err = w.Config.Runtime.Validate() if err != nil { return err diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index c1305b25..d10f9dbb 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -10,6 +10,7 @@ import ( "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/sdk-go/vela" ) type ( @@ -51,9 +52,10 @@ type ( // Worker represents all configuration and // system processes for the worker. Worker struct { - Config *Config - Executors map[int]executor.Engine - Queue queue.Service - Runtime runtime.Engine + Config *Config + Executors map[int]executor.Engine + Queue queue.Service + Runtime runtime.Engine + VelaClient *vela.Client } ) diff --git a/go.mod b/go.mod index fe80afb6..3da06003 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc + github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 - github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d + github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 github.com/joho/godotenv v1.3.0 diff --git a/go.sum b/go.sum index 39d940ef..c3233849 100644 --- a/go.sum +++ b/go.sum @@ -113,12 +113,12 @@ github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38 h1:IImUUJF4t0f/RVAh4K1uzzQtwaJLO01prIZjd8z3r54= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38/go.mod h1:NEOd1uO5PQDxXnlaFWdxtmNmlTZq2l276BPHhmthTJk= -github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc h1:2/0iTOpB8SeK+6kj21glS2l9BUnaoA7+8TIYn4v2HFE= -github.com/go-vela/pkg-executor v0.0.0-20200331192901-7edc7f0f4dfc/go.mod h1:Cu8fUZ0+OQnsiw0BVs96j3y6FymWv8VytcckKm7PVc0= +github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff h1:7+q5ET5eB/omkn/gnGWNcoN66N80dgrRDUPpCq2MKlM= +github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff/go.mod h1:tvPMsbsaFgGbnY2DUuKDhBxUTcSm4kSK+N8rzJuc/Ls= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 h1:k+fWWmmBEqpWqdHoPFprmU6yNN84VipQQP49wORLzus= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50/go.mod h1:A6Wk/bIng02YxbEY3N7pUHZcYZyp4LW02dPI76zEPkE= -github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d h1:U7olyS7IAd5bwzOWp48OeXUEEkUz7vUoURNge9Q5IcA= -github.com/go-vela/pkg-runtime v0.0.0-20200330182441-a73120dc8c1d/go.mod h1:vmADEw/T7DEv41UVfXa+HFiI3wK4ttUXox3h0GVjKBo= +github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 h1:R1EiJBdYXZrP0N6eWqjATHtU2U6x5gyvAEfEgkVikKQ= +github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838/go.mod h1:vmADEw/T7DEv41UVfXa+HFiI3wK4ttUXox3h0GVjKBo= github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 h1:UluZMmYC/AHpmhOqB2n9YPCj2vAYi2aeYNwOdKAA+o4= From beb7ecf9e9ecf6533139802b6435d05ad054dbac Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 7 Apr 2020 15:38:20 -0500 Subject: [PATCH 087/430] test(middleware): add 100% coverage (#79) --- router/middleware/executor/executor_test.go | 98 ++++++++++++++++++++- router/middleware/executor_test.go | 48 ++++++++++ router/middleware/header_test.go | 16 +--- router/middleware/perm/perm_test.go | 4 +- router/middleware/secret_test.go | 46 ++++++++++ 5 files changed, 194 insertions(+), 18 deletions(-) create mode 100644 router/middleware/executor_test.go create mode 100644 router/middleware/secret_test.go diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 2ccf1ff1..38df89c1 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -107,7 +107,53 @@ func TestExecutor_Establish(t *testing.T) { } } -func TestExecutor_Establish_NoExecutor(t *testing.T) { +func TestExecutor_Establish_NoParam(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + // setup context + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/", nil) + + // setup mock server + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusBadRequest { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusBadRequest) + } +} + +func TestExecutor_Establish_InvalidParam(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + // setup context + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/foo", nil) + + // setup mock server + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusBadRequest { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusBadRequest) + } +} + +func TestExecutor_Establish_NoExecutors(t *testing.T) { // setup types gin.SetMode(gin.TestMode) @@ -126,6 +172,54 @@ func TestExecutor_Establish_NoExecutor(t *testing.T) { engine.ServeHTTP(context.Writer, context.Request) if resp.Code != http.StatusInternalServerError { - t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusInternalServerError) + } +} + +func TestExecutor_Establish_InvalidExecutors(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + // setup context + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) + + // setup mock server + engine.Use(func(c *gin.Context) { c.Set("executors", "invalid") }) + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusInternalServerError { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusInternalServerError) + } +} + +func TestExecutor_Establish_ExecutorNotFound(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + // setup context + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/executors/0", nil) + + // setup mock server + engine.Use(func(c *gin.Context) { c.Set("executors", make(map[int]executor.Engine)) }) + engine.Use(Establish()) + engine.GET("/executors/:executor", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusBadRequest { + t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusBadRequest) } } diff --git a/router/middleware/executor_test.go b/router/middleware/executor_test.go new file mode 100644 index 00000000..a5aee7cd --- /dev/null +++ b/router/middleware/executor_test.go @@ -0,0 +1,48 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/pkg-executor/executor" +) + +func TestMiddleware_Executors(t *testing.T) { + // setup types + got := map[int]executor.Engine{} + want := make(map[int]executor.Engine) + + // setup context + gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) + + // setup mock server + engine.Use(Executors(want)) + engine.GET("/health", func(c *gin.Context) { + got = c.Value("executors").(map[int]executor.Engine) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("Executors returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Executors is %v, want %v", got, want) + } +} diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index c34f51ab..11ebc8a5 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -163,7 +163,6 @@ func TestMiddleware_Options_InvalidMethod(t *testing.T) { func TestMiddleware_Secure(t *testing.T) { // setup types - wantOrigin := "*" wantFrameOptions := "DENY" wantContentTypeOptions := "nosniff" wantProtection := "1; mode=block" @@ -184,7 +183,6 @@ func TestMiddleware_Secure(t *testing.T) { // run test engine.ServeHTTP(context.Writer, context.Request) - gotOrigin := context.Writer.Header().Get("Access-Control-Allow-Origin") gotFrameOptions := context.Writer.Header().Get("X-Frame-Options") gotContentTypeOptions := context.Writer.Header().Get("X-Content-Type-Options") gotProtection := context.Writer.Header().Get("X-XSS-Protection") @@ -193,10 +191,6 @@ func TestMiddleware_Secure(t *testing.T) { t.Errorf("Secure returned %v, want %v", resp.Code, http.StatusOK) } - if !reflect.DeepEqual(gotOrigin, wantOrigin) { - t.Errorf("Secure Access-Control-Allow-Origin is %v, want %v", gotOrigin, wantOrigin) - } - if !reflect.DeepEqual(gotFrameOptions, wantFrameOptions) { t.Errorf("Secure X-Frame-Options is %v, want %v", gotFrameOptions, wantFrameOptions) } @@ -212,7 +206,6 @@ func TestMiddleware_Secure(t *testing.T) { func TestMiddleware_Secure_TLS(t *testing.T) { // setup types - wantOrigin := "*" wantFrameOptions := "DENY" wantContentTypeOptions := "nosniff" wantProtection := "1; mode=block" @@ -235,7 +228,6 @@ func TestMiddleware_Secure_TLS(t *testing.T) { // run test engine.ServeHTTP(context.Writer, context.Request) - gotOrigin := context.Writer.Header().Get("Access-Control-Allow-Origin") gotFrameOptions := context.Writer.Header().Get("X-Frame-Options") gotContentTypeOptions := context.Writer.Header().Get("X-Content-Type-Options") gotProtection := context.Writer.Header().Get("X-XSS-Protection") @@ -245,10 +237,6 @@ func TestMiddleware_Secure_TLS(t *testing.T) { t.Errorf("Secure returned %v, want %v", resp.Code, http.StatusOK) } - if !reflect.DeepEqual(gotOrigin, wantOrigin) { - t.Errorf("Secure Access-Control-Allow-Origin is %v, want %v", gotOrigin, wantOrigin) - } - if !reflect.DeepEqual(gotFrameOptions, wantFrameOptions) { t.Errorf("Secure X-Frame-Options is %v, want %v", gotFrameOptions, wantFrameOptions) } @@ -271,7 +259,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { wantVersion := "0.3.0" // setup context - gin.SetMode(gin.TestMode) + gin.SetMode(gin.DebugMode) resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) @@ -333,7 +321,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { wantVersion := "0.3.0" // setup context - gin.SetMode(gin.TestMode) + gin.SetMode(gin.DebugMode) resp := httptest.NewRecorder() context, engine := gin.CreateTestContext(resp) diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index e6eaa319..6b67bd1c 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -76,7 +76,7 @@ func TestPerm_MustServer_failure(t *testing.T) { // setup vela mock server engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(user.Establish()) + engine.Use(func(c *gin.Context) { c.Set("user", u) }) engine.Use(MustServer()) engine.GET("/server/users", func(c *gin.Context) { c.Status(http.StatusOK) @@ -88,7 +88,7 @@ func TestPerm_MustServer_failure(t *testing.T) { // run test engine.ServeHTTP(context.Writer, context.Request) - if resp.Code != http.StatusOK { + if resp.Code != http.StatusUnauthorized { t.Errorf("MustServer returned %v, want %v", resp.Code, http.StatusUnauthorized) } } diff --git a/router/middleware/secret_test.go b/router/middleware/secret_test.go new file mode 100644 index 00000000..47502a62 --- /dev/null +++ b/router/middleware/secret_test.go @@ -0,0 +1,46 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" +) + +func TestMiddleware_Secret(t *testing.T) { + // setup types + got := "" + want := "foobar" + + // setup context + gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) + + // setup mock server + engine.Use(Secret(want)) + engine.GET("/health", func(c *gin.Context) { + got = c.Value("secret").(string) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("Secret returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Secret is %v, want %v", got, want) + } +} From f0d5b2abb4c6e65da844368febfec3c4d1148b90 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Thu, 9 Apr 2020 10:43:15 -0500 Subject: [PATCH 088/430] feat: add pkg-executor with comment changes (#80) * feat: add pkg-executor with comment changes * chore: update dependencies Co-authored-by: Neal --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3da06003..952c8993 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff + github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 - github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 + github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.5.0 diff --git a/go.sum b/go.sum index c3233849..28607d8a 100644 --- a/go.sum +++ b/go.sum @@ -113,8 +113,8 @@ github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38 h1:IImUUJF4t0f/RVAh4K1uzzQtwaJLO01prIZjd8z3r54= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38/go.mod h1:NEOd1uO5PQDxXnlaFWdxtmNmlTZq2l276BPHhmthTJk= -github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff h1:7+q5ET5eB/omkn/gnGWNcoN66N80dgrRDUPpCq2MKlM= -github.com/go-vela/pkg-executor v0.0.0-20200406204152-c0de0c76a2ff/go.mod h1:tvPMsbsaFgGbnY2DUuKDhBxUTcSm4kSK+N8rzJuc/Ls= +github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e h1:6tjjSABPpoT03zQ/ulkL5SgqmFS+Pl1j5W/5c96cxC8= +github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e/go.mod h1:Tzq53GtS5RtRz87gzCkjsbt9TOFm0E8nI+c8DvlO47s= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 h1:k+fWWmmBEqpWqdHoPFprmU6yNN84VipQQP49wORLzus= github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50/go.mod h1:A6Wk/bIng02YxbEY3N7pUHZcYZyp4LW02dPI76zEPkE= github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 h1:R1EiJBdYXZrP0N6eWqjATHtU2U6x5gyvAEfEgkVikKQ= @@ -127,6 +127,8 @@ github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 h1:5+2BLMClLg+o6mky5G0xRTfw/15zOyyZhJKWp726vu4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 h1:2JfP3pDOiXpqSyCM3n5ttHviSSYsA7zyVvGTYHP9fEA= +github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= github.com/go-vela/worker v0.3.1/go.mod h1:V6G7l2gehP3zG6SCN+76H+5edoC13YWGU7tDYWpP7B4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From 256f7ec59317dbcf20371e0e6d86621bac1ec097 Mon Sep 17 00:00:00 2001 From: Gregory Dosh <6432753+GregoryDosh@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:48:07 -0500 Subject: [PATCH 089/430] chore(deps): updating github.com/urfave/cli to v2 (#83) * updating github.com/urfave/cli to v2 * temporarily adding replacement dependencies for testing purposes * temporarily adding replacement dependencies for testing purposes Co-authored-by: GregoryDosh --- cmd/vela-worker/flags.go | 76 ++++++++++++++++++++-------------------- cmd/vela-worker/main.go | 4 +-- cmd/vela-worker/run.go | 2 +- go.mod | 14 ++++++-- go.sum | 35 ++++++------------ 5 files changed, 64 insertions(+), 67 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index f9f97ff3..6cfa8e87 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -11,7 +11,7 @@ import ( "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) // flags is a helper function to return the all @@ -20,62 +20,62 @@ import ( func flags() []cli.Flag { f := []cli.Flag{ - cli.StringFlag{ - EnvVar: "WORKER_HOSTNAME,VELA_HOSTNAME,HOSTNAME", - Name: "hostname", - Usage: "set hostname for the worker", + &cli.StringFlag{ + EnvVars: []string{"WORKER_HOSTNAME", "VELA_HOSTNAME", "HOSTNAME"}, + Name: "hostname", + Usage: "set hostname for the worker", }, // API Flags - cli.StringFlag{ - EnvVar: "WORKER_API_PORT,VELA_API_PORT,API_PORT", - Name: "api.port", - Usage: "API port for the worker to listen on", - Value: ":8080", + &cli.StringFlag{ + EnvVars: []string{"WORKER_API_PORT", "VELA_API_PORT", "API_PORT"}, + Name: "api.port", + Usage: "API port for the worker to listen on", + Value: ":8080", }, // Build Flags - cli.IntFlag{ - EnvVar: "WORKER_BUILD_LIMIT,VELA_BUILD_LIMIT,BUILD_LIMIT", - Name: "build.limit", - Usage: "maximum amount of builds that can run concurrently", - Value: 1, + &cli.IntFlag{ + EnvVars: []string{"WORKER_BUILD_LIMIT", "VELA_BUILD_LIMIT", "BUILD_LIMIT"}, + Name: "build.limit", + Usage: "maximum amount of builds that can run concurrently", + Value: 1, }, - cli.DurationFlag{ - EnvVar: "WORKER_BUILD_TIMEOUT,VELA_BUILD_TIMEOUT,BUILD_TIMEOUT", - Name: "build.timeout", - Usage: "maximum amount of time a build can run for", - Value: 30 * time.Minute, + &cli.DurationFlag{ + EnvVars: []string{"WORKER_BUILD_TIMEOUT", "VELA_BUILD_TIMEOUT", "BUILD_TIMEOUT"}, + Name: "build.timeout", + Usage: "maximum amount of time a build can run for", + Value: 30 * time.Minute, }, // Logger Flags - cli.StringFlag{ - EnvVar: "WORKER_LOG_FORMAT,VELA_LOG_FORMAT,LOG_FORMAT", - Name: "log.format", - Usage: "set log format for the worker", - Value: "json", + &cli.StringFlag{ + EnvVars: []string{"WORKER_LOG_FORMAT", "VELA_LOG_FORMAT", "LOG_FORMAT"}, + Name: "log.format", + Usage: "set log format for the worker", + Value: "json", }, - cli.StringFlag{ - EnvVar: "WORKER_LOG_LEVEL,VELA_LOG_LEVEL,LOG_LEVEL", - Name: "log.level", - Usage: "set log level for the worker", - Value: "info", + &cli.StringFlag{ + EnvVars: []string{"WORKER_LOG_LEVEL", "VELA_LOG_LEVEL", "LOG_LEVEL"}, + Name: "log.level", + Usage: "set log level for the worker", + Value: "info", }, // Server Flags - cli.StringFlag{ - EnvVar: "WORKER_SERVER_ADDR,VELA_SERVER_ADDR,VELA_SERVER,SERVER_ADDR", - Name: "server.addr", - Usage: "Vela server address as a fully qualified url (://)", + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_ADDR", "VELA_SERVER_ADDR", "VELA_SERVER", "SERVER_ADDR"}, + Name: "server.addr", + Usage: "Vela server address as a fully qualified url (://)", }, - cli.StringFlag{ - EnvVar: "WORKER_SERVER_SECRET,VELA_SERVER_SECRET,SERVER_SECRET", - Name: "server.secret", - Usage: "secret used for server <-> worker communication", + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_SECRET", "VELA_SERVER_SECRET", "SERVER_SECRET"}, + Name: "server.secret", + Usage: "secret used for server <-> worker communication", }, } diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index a1de4dc8..79b2a838 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -12,7 +12,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" _ "github.com/joho/godotenv/autoload" ) @@ -42,7 +42,7 @@ func main() { app.HelpName = "vela-executor" app.Usage = "Vela executor package for integrating with different executors" app.Copyright = "Copyright (c) 2020 Target Brands, Inc. All rights reserved." - app.Authors = []cli.Author{ + app.Authors = []*cli.Author{ { Name: "Vela Admins", Email: "vela@target.com", diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 8c9f55c4..a22401e5 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -13,7 +13,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" _ "github.com/joho/godotenv/autoload" ) diff --git a/go.mod b/go.mod index 952c8993..c18b11d7 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,23 @@ require ( github.com/gin-gonic/gin v1.5.0 github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 - github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 + github.com/go-vela/pkg-runtime v0.0.0-20200409170123-8220bae0dff7 github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/sirupsen/logrus v1.5.0 - github.com/urfave/cli v1.22.3 + github.com/urfave/cli/v2 v2.2.0 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) + +replace github.com/go-vela/pkg-executor => github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f + +replace github.com/go-vela/pkg-queue => github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4 + +replace github.com/go-vela/pkg-runtime => github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14 + +replace github.com/go-vela/worker => github.com/GregoryDosh/worker v0.3.2-0.20200410002335-f24601f8a167 + +replace github.com/go-vela/compiler => github.com/GregoryDosh/compiler v0.3.1 diff --git a/go.sum b/go.sum index 28607d8a..084da9b7 100644 --- a/go.sum +++ b/go.sum @@ -15,6 +15,14 @@ github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABb github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= +github.com/GregoryDosh/compiler v0.3.1/go.mod h1:tYW8rQCmt3BlVYQi1Uatc0ir3HnYuUknjA4+uiP6uU0= +github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f h1:SAbktxmRaUL3677a/o4zqKfn4OvlnqBB0tQIx3KIBS0= +github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f/go.mod h1:7Pec5AgoZVTbujcgLmrOwrZYB1vDVlLErP/9/TEQxuM= +github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4 h1:Itj/waC2/4VB2cjjL07OzQP2pZWkaAGwYdZgPbj45sE= +github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4/go.mod h1:34uMbWFP1mYRnG11FisxzcfunYoCF4w6rO+6U3XOQF4= +github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14 h1:RBzVfeBFRmn5D62qBWnkQ01WQjS2jyUHb/BlNCAC+dg= +github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14/go.mod h1:28KHemLyasKErUlGL9BuQfRB4rBeqGp3pmyErpTuiug= +github.com/GregoryDosh/worker v0.3.2-0.20200410002335-f24601f8a167/go.mod h1:7iU43JsoNx4IuGVBHmcb2wx2FcBOoj3uG/8bN59BrzQ= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= @@ -42,8 +50,6 @@ github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZa github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -103,22 +109,13 @@ github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rm github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg= -github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.3.1-0.20200302143952-6a5a26ba1fbc/go.mod h1:rO03l8MoeyQkhd450SnphZquB7l7Qs+cT/3BIVq8MfE= github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38 h1:IImUUJF4t0f/RVAh4K1uzzQtwaJLO01prIZjd8z3r54= github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38/go.mod h1:NEOd1uO5PQDxXnlaFWdxtmNmlTZq2l276BPHhmthTJk= -github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e h1:6tjjSABPpoT03zQ/ulkL5SgqmFS+Pl1j5W/5c96cxC8= -github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e/go.mod h1:Tzq53GtS5RtRz87gzCkjsbt9TOFm0E8nI+c8DvlO47s= -github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 h1:k+fWWmmBEqpWqdHoPFprmU6yNN84VipQQP49wORLzus= -github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50/go.mod h1:A6Wk/bIng02YxbEY3N7pUHZcYZyp4LW02dPI76zEPkE= -github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838 h1:R1EiJBdYXZrP0N6eWqjATHtU2U6x5gyvAEfEgkVikKQ= -github.com/go-vela/pkg-runtime v0.0.0-20200406123433-d78d766e8838/go.mod h1:vmADEw/T7DEv41UVfXa+HFiI3wK4ttUXox3h0GVjKBo= github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 h1:UluZMmYC/AHpmhOqB2n9YPCj2vAYi2aeYNwOdKAA+o4= @@ -127,9 +124,9 @@ github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 h1:5+2BLMClLg+o6mky5G0xRTfw/15zOyyZhJKWp726vu4= github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= +github.com/go-vela/types v0.3.1-0.20200406195903-8be24be6c8f1/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 h1:2JfP3pDOiXpqSyCM3n5ttHviSSYsA7zyVvGTYHP9fEA= github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= -github.com/go-vela/worker v0.3.1/go.mod h1:V6G7l2gehP3zG6SCN+76H+5edoC13YWGU7tDYWpP7B4= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -171,8 +168,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= @@ -240,8 +235,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -271,8 +264,6 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee h1:iBZPTYkGLvdu6+A5TsMUJQkQX9Ad4aCEnSQtdxPuTCQ= -github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= @@ -280,8 +271,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= 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/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -309,10 +298,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.3 h1:FpNT6zq26xNpHZy08emi755QwzLPs6Pukqjlc7RfOMU= -github.com/urfave/cli v1.22.3/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= +github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= From 6cd7b7b44a3f60ee30153f17c09c389930f30f73 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 10 Apr 2020 14:53:03 -0500 Subject: [PATCH 090/430] chore: update for v0.4.0-rc1 (#84) --- go.mod | 23 ++++++++--------------- go.sum | 43 ++++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index c18b11d7..8b3fb806 100644 --- a/go.mod +++ b/go.mod @@ -3,27 +3,20 @@ module github.com/go-vela/worker go 1.13 require ( + github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.0.0-20200409152007-dd0ea738d48e - github.com/go-vela/pkg-queue v0.0.0-20200324143217-040845faaf50 - github.com/go-vela/pkg-runtime v0.0.0-20200409170123-8220bae0dff7 - github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 - github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 + github.com/go-vela/pkg-executor v0.4.0-rc1 + github.com/go-vela/pkg-queue v0.4.0-rc1 + github.com/go-vela/pkg-runtime v0.4.0-rc1 + github.com/go-vela/sdk-go v0.4.0-rc1 + github.com/go-vela/types v0.4.0-rc1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 + github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect + github.com/prometheus/procfs v0.0.8 // indirect github.com/sirupsen/logrus v1.5.0 github.com/urfave/cli/v2 v2.2.0 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) - -replace github.com/go-vela/pkg-executor => github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f - -replace github.com/go-vela/pkg-queue => github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4 - -replace github.com/go-vela/pkg-runtime => github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14 - -replace github.com/go-vela/worker => github.com/GregoryDosh/worker v0.3.2-0.20200410002335-f24601f8a167 - -replace github.com/go-vela/compiler => github.com/GregoryDosh/compiler v0.3.1 diff --git a/go.sum b/go.sum index 084da9b7..b1d02361 100644 --- a/go.sum +++ b/go.sum @@ -15,14 +15,6 @@ github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABb github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= -github.com/GregoryDosh/compiler v0.3.1/go.mod h1:tYW8rQCmt3BlVYQi1Uatc0ir3HnYuUknjA4+uiP6uU0= -github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f h1:SAbktxmRaUL3677a/o4zqKfn4OvlnqBB0tQIx3KIBS0= -github.com/GregoryDosh/pkg-executor v0.0.0-20200410001857-bf649792150f/go.mod h1:7Pec5AgoZVTbujcgLmrOwrZYB1vDVlLErP/9/TEQxuM= -github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4 h1:Itj/waC2/4VB2cjjL07OzQP2pZWkaAGwYdZgPbj45sE= -github.com/GregoryDosh/pkg-queue v0.0.0-20200409234805-1d6182a8eba4/go.mod h1:34uMbWFP1mYRnG11FisxzcfunYoCF4w6rO+6U3XOQF4= -github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14 h1:RBzVfeBFRmn5D62qBWnkQ01WQjS2jyUHb/BlNCAC+dg= -github.com/GregoryDosh/pkg-runtime v0.0.0-20200410000527-9a1b10bc1f14/go.mod h1:28KHemLyasKErUlGL9BuQfRB4rBeqGp3pmyErpTuiug= -github.com/GregoryDosh/worker v0.3.2-0.20200410002335-f24601f8a167/go.mod h1:7iU43JsoNx4IuGVBHmcb2wx2FcBOoj3uG/8bN59BrzQ= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= @@ -50,6 +42,8 @@ github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZa github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -112,21 +106,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/mock v0.3.0 h1:R+0NWK+JgW4dy85TUi6qt1CgbDvGMeGCG/Vcqxt4754= -github.com/go-vela/mock v0.3.0/go.mod h1:pVJNaFvhqN174VZctH09HAdwvsWexA1Y9jT4xgyBRLM= -github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38 h1:IImUUJF4t0f/RVAh4K1uzzQtwaJLO01prIZjd8z3r54= -github.com/go-vela/mock v0.3.1-0.20200330162331-99c39325ff38/go.mod h1:NEOd1uO5PQDxXnlaFWdxtmNmlTZq2l276BPHhmthTJk= -github.com/go-vela/sdk-go v0.3.0 h1:7QOISiwlKIwQ+gBo35d7v9kVMJ5AHRITgFlmKOaATco= -github.com/go-vela/sdk-go v0.3.0/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= -github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711 h1:UluZMmYC/AHpmhOqB2n9YPCj2vAYi2aeYNwOdKAA+o4= -github.com/go-vela/sdk-go v0.3.1-0.20200316181126-22974be2a711/go.mod h1:HweT1gVTnbEKX95IJmqoe22i0k326whrzY4ytjB06JY= -github.com/go-vela/types v0.3.0 h1:wteEelsBvfWeXpnMbWK1NcQ2dZHmLOlPvBaZX7YabAE= -github.com/go-vela/types v0.3.0/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= -github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782 h1:5+2BLMClLg+o6mky5G0xRTfw/15zOyyZhJKWp726vu4= -github.com/go-vela/types v0.3.1-0.20200228213236-820f8df3a782/go.mod h1:LNDrn7/nV38H0HmRfYv6YfPNb881R5NRE1YKXeVqpF4= -github.com/go-vela/types v0.3.1-0.20200406195903-8be24be6c8f1/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= -github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11 h1:2JfP3pDOiXpqSyCM3n5ttHviSSYsA7zyVvGTYHP9fEA= -github.com/go-vela/types v0.3.1-0.20200408124446-5750ec2cac11/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= +github.com/go-vela/compiler v0.4.0-rc1/go.mod h1:mEBy+f9nPTVJSDOsRxzWmXs7DZjXYCCvJQVggXnYD5E= +github.com/go-vela/mock v0.4.0-rc1 h1:azyMn3gb20EF7WeufFWyRrE8FOcUvE9gFc/TiydZlDU= +github.com/go-vela/mock v0.4.0-rc1/go.mod h1:aYxarMYdXI3uya3rNoRriX5x+2gTVxSz33U93RVR+tY= +github.com/go-vela/pkg-executor v0.4.0-rc1 h1:4cMt6PLGpNJMylhUjPzi1V30umx+K40hHR7np4GvS+w= +github.com/go-vela/pkg-executor v0.4.0-rc1/go.mod h1:EFcHcELnBaVFO/J78OTdcW0XCsUPAfm3gwrvLk0AQ/o= +github.com/go-vela/pkg-queue v0.4.0-rc1 h1:xbCZWG9Pa+hWB6vM7+C3/d2i77njYdYHSpFaQTsoyOQ= +github.com/go-vela/pkg-queue v0.4.0-rc1/go.mod h1:W2TE+wq29ZSFZUqTg2UjkyjDdPK5t+V9lXnBQLi4BfM= +github.com/go-vela/pkg-runtime v0.4.0-rc1 h1:P3kvFHyab3e7y+W/5/WqRdOWz7n+941Egz4t+S5GB24= +github.com/go-vela/pkg-runtime v0.4.0-rc1/go.mod h1:GCsTE95qbx6E1VXzyYpPR0RI/VFkH5B++PCgKRl7N04= +github.com/go-vela/sdk-go v0.4.0-rc1 h1:7zhuazKfC4m1VuUuNXpcb8pZZOvIhUcYTND77z6ILhM= +github.com/go-vela/sdk-go v0.4.0-rc1/go.mod h1:B6dtMfwQxVktPE/j2ThtblFMDpH+fKPaVNmzLlor2/o= +github.com/go-vela/types v0.4.0-rc1 h1:pXHj1pcCCWiBiReAPpACK2V0qltQaBlqf9IPro24FlQ= +github.com/go-vela/types v0.4.0-rc1/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -235,6 +227,7 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -264,6 +257,8 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee h1:iBZPTYkGLvdu6+A5TsMUJQkQX9Ad4aCEnSQtdxPuTCQ= +github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= @@ -271,6 +266,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= 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/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= From b4f497df814a5ae7ef19647b661f70230526844c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 10 Apr 2020 15:10:12 -0500 Subject: [PATCH 091/430] chore: uptick version for release (#85) --- router/middleware/header_test.go | 8 ++++---- version/version.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 11ebc8a5..fbe8b233 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.3.0" + wantVersion := "0.4.0" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.3.0" + wantVersion := "0.4.0" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.3.0" + wantVersion := "0.4.0" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.3.0" + wantVersion := "0.4.0" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index d3227798..7ffb4693 100644 --- a/version/version.go +++ b/version/version.go @@ -10,10 +10,10 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor int64 = 3 + VersionMinor int64 = 4 // VersionPatch is for backwards-compatible bug fixes VersionPatch int64 - // VersionDev indicates drone build number. Releases will be empty string. + // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From e82f66cf3eb78a9709efb72b484a31d2b6b81986 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 24 Apr 2020 12:00:35 -0500 Subject: [PATCH 092/430] chore: update dependencies for v0.4.0-rc2 (#86) --- go.mod | 10 +++++----- go.sum | 28 +++++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 8b3fb806..8a638b1a 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.0-rc1 - github.com/go-vela/pkg-queue v0.4.0-rc1 - github.com/go-vela/pkg-runtime v0.4.0-rc1 - github.com/go-vela/sdk-go v0.4.0-rc1 - github.com/go-vela/types v0.4.0-rc1 + github.com/go-vela/pkg-executor v0.4.0-rc2 + github.com/go-vela/pkg-queue v0.4.0-rc2 + github.com/go-vela/pkg-runtime v0.4.0-rc2 + github.com/go-vela/sdk-go v0.4.0-rc2 + github.com/go-vela/types v0.4.0-rc2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index b1d02361..5aea4618 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= @@ -81,6 +82,7 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -106,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.0-rc1/go.mod h1:mEBy+f9nPTVJSDOsRxzWmXs7DZjXYCCvJQVggXnYD5E= -github.com/go-vela/mock v0.4.0-rc1 h1:azyMn3gb20EF7WeufFWyRrE8FOcUvE9gFc/TiydZlDU= -github.com/go-vela/mock v0.4.0-rc1/go.mod h1:aYxarMYdXI3uya3rNoRriX5x+2gTVxSz33U93RVR+tY= -github.com/go-vela/pkg-executor v0.4.0-rc1 h1:4cMt6PLGpNJMylhUjPzi1V30umx+K40hHR7np4GvS+w= -github.com/go-vela/pkg-executor v0.4.0-rc1/go.mod h1:EFcHcELnBaVFO/J78OTdcW0XCsUPAfm3gwrvLk0AQ/o= -github.com/go-vela/pkg-queue v0.4.0-rc1 h1:xbCZWG9Pa+hWB6vM7+C3/d2i77njYdYHSpFaQTsoyOQ= -github.com/go-vela/pkg-queue v0.4.0-rc1/go.mod h1:W2TE+wq29ZSFZUqTg2UjkyjDdPK5t+V9lXnBQLi4BfM= -github.com/go-vela/pkg-runtime v0.4.0-rc1 h1:P3kvFHyab3e7y+W/5/WqRdOWz7n+941Egz4t+S5GB24= -github.com/go-vela/pkg-runtime v0.4.0-rc1/go.mod h1:GCsTE95qbx6E1VXzyYpPR0RI/VFkH5B++PCgKRl7N04= -github.com/go-vela/sdk-go v0.4.0-rc1 h1:7zhuazKfC4m1VuUuNXpcb8pZZOvIhUcYTND77z6ILhM= -github.com/go-vela/sdk-go v0.4.0-rc1/go.mod h1:B6dtMfwQxVktPE/j2ThtblFMDpH+fKPaVNmzLlor2/o= -github.com/go-vela/types v0.4.0-rc1 h1:pXHj1pcCCWiBiReAPpACK2V0qltQaBlqf9IPro24FlQ= -github.com/go-vela/types v0.4.0-rc1/go.mod h1:vph+YTAkIw0fJr7gmlIjXRIuc4QXUnQvdDvH2/Oh7ts= +github.com/go-vela/compiler v0.4.0-rc2/go.mod h1:YrtHlGNiSwSBegWvHF5zAxM4fpKbDDaNKW7aEhjEfgs= +github.com/go-vela/mock v0.4.0-rc2 h1:Upk6eZw4qbcs3YTOpqqMdQKvZ9UT6n/65vw4vdhukik= +github.com/go-vela/mock v0.4.0-rc2/go.mod h1:nOCsvVlnc2/B02xxB/HchAyS3E6Ewbn7tGo10UinoXM= +github.com/go-vela/pkg-executor v0.4.0-rc2 h1:INMT2rufCltWBRvMt0S1RxmIpooXIipTTWHYfkVHBtY= +github.com/go-vela/pkg-executor v0.4.0-rc2/go.mod h1:cKnFXNyhPQ/suwRoVZWAGy5M0QHzOfmaTj0yOBTVfM4= +github.com/go-vela/pkg-queue v0.4.0-rc2 h1:iF3uN8mi5NH4MsV0NNGRPGRC4n6PL4rfbymZspNVFIE= +github.com/go-vela/pkg-queue v0.4.0-rc2/go.mod h1:7M/LDLkg2nZhGBDEKgBwTeYWOole69qDeNZJAgCJAag= +github.com/go-vela/pkg-runtime v0.4.0-rc2 h1:IJ7xH2BKq4fMDcdWn+Zo2WlVxabXrGiH4r+D1t3oF3U= +github.com/go-vela/pkg-runtime v0.4.0-rc2/go.mod h1:0CXOageqvomJvVZZW9yGQW3yNY6Omvkoq40EE3n36Do= +github.com/go-vela/sdk-go v0.4.0-rc2 h1:Zahay7djog8BsIOhTwoFhM4TpeYMGxyFoi+XFuIMBQg= +github.com/go-vela/sdk-go v0.4.0-rc2/go.mod h1:eoNvDzUCT3iIE4UqtQpnrlp8wUjMxajql2IjBz61X7Q= +github.com/go-vela/types v0.4.0-rc2 h1:0rS6yOK4Huy1RbTMlwC2gl3WeEqOY822XIqaZxmjLfw= +github.com/go-vela/types v0.4.0-rc2/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From bfa887d346e8cbdb322ac005b116f5e1dede57ed Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Mon, 27 Apr 2020 14:00:57 -0500 Subject: [PATCH 093/430] chore: update version to v0.4.0-rc3 (#87) --- go.mod | 10 +++++----- go.sum | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 8a638b1a..5b2e8cf9 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.0-rc2 - github.com/go-vela/pkg-queue v0.4.0-rc2 - github.com/go-vela/pkg-runtime v0.4.0-rc2 - github.com/go-vela/sdk-go v0.4.0-rc2 - github.com/go-vela/types v0.4.0-rc2 + github.com/go-vela/pkg-executor v0.4.0-rc3 + github.com/go-vela/pkg-queue v0.4.0-rc3 + github.com/go-vela/pkg-runtime v0.4.0-rc3 + github.com/go-vela/sdk-go v0.4.0-rc3 + github.com/go-vela/types v0.4.0-rc3 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index 5aea4618..ee42cd46 100644 --- a/go.sum +++ b/go.sum @@ -108,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.0-rc2/go.mod h1:YrtHlGNiSwSBegWvHF5zAxM4fpKbDDaNKW7aEhjEfgs= -github.com/go-vela/mock v0.4.0-rc2 h1:Upk6eZw4qbcs3YTOpqqMdQKvZ9UT6n/65vw4vdhukik= -github.com/go-vela/mock v0.4.0-rc2/go.mod h1:nOCsvVlnc2/B02xxB/HchAyS3E6Ewbn7tGo10UinoXM= -github.com/go-vela/pkg-executor v0.4.0-rc2 h1:INMT2rufCltWBRvMt0S1RxmIpooXIipTTWHYfkVHBtY= -github.com/go-vela/pkg-executor v0.4.0-rc2/go.mod h1:cKnFXNyhPQ/suwRoVZWAGy5M0QHzOfmaTj0yOBTVfM4= -github.com/go-vela/pkg-queue v0.4.0-rc2 h1:iF3uN8mi5NH4MsV0NNGRPGRC4n6PL4rfbymZspNVFIE= -github.com/go-vela/pkg-queue v0.4.0-rc2/go.mod h1:7M/LDLkg2nZhGBDEKgBwTeYWOole69qDeNZJAgCJAag= -github.com/go-vela/pkg-runtime v0.4.0-rc2 h1:IJ7xH2BKq4fMDcdWn+Zo2WlVxabXrGiH4r+D1t3oF3U= -github.com/go-vela/pkg-runtime v0.4.0-rc2/go.mod h1:0CXOageqvomJvVZZW9yGQW3yNY6Omvkoq40EE3n36Do= -github.com/go-vela/sdk-go v0.4.0-rc2 h1:Zahay7djog8BsIOhTwoFhM4TpeYMGxyFoi+XFuIMBQg= -github.com/go-vela/sdk-go v0.4.0-rc2/go.mod h1:eoNvDzUCT3iIE4UqtQpnrlp8wUjMxajql2IjBz61X7Q= -github.com/go-vela/types v0.4.0-rc2 h1:0rS6yOK4Huy1RbTMlwC2gl3WeEqOY822XIqaZxmjLfw= -github.com/go-vela/types v0.4.0-rc2/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/compiler v0.4.0-rc3/go.mod h1:DujGFVUpkAJ83XKs71z8KXIwGMPELvA9exrWsDPRrNs= +github.com/go-vela/mock v0.4.0-rc3 h1:nrhXWyfra8ecS7gLFsBBxUwFchQU4/EkSoAtLQEQ470= +github.com/go-vela/mock v0.4.0-rc3/go.mod h1:WiQ8juR+dlcOFKSWliJHAgyBzLLwstb8fKBFhe4z1tY= +github.com/go-vela/pkg-executor v0.4.0-rc3 h1:LPalRL3FaRi8SChIXDGzDQ2gJKJUSRzr8Q6Bf6jlS4E= +github.com/go-vela/pkg-executor v0.4.0-rc3/go.mod h1:RcpqSPYTghe3Mc36qBw8AXTx9zK7ZXOcl3Ezon4QPC4= +github.com/go-vela/pkg-queue v0.4.0-rc3 h1:e1PNr99tGyEcxwqo5XgknY7xBb7ybFMJdksdYECFF3Y= +github.com/go-vela/pkg-queue v0.4.0-rc3/go.mod h1:uQzRpxOUqKkTvP66OVOKYFV8eRJDV50kOLSioqKpR3M= +github.com/go-vela/pkg-runtime v0.4.0-rc3 h1:3X2nqc4HK8+oflEUoH0iTLdfWL6E710svvzlrr5tpbM= +github.com/go-vela/pkg-runtime v0.4.0-rc3/go.mod h1:soqW12zgBZETtAGK3WTp/OeFYFY+cq1oxl/1V4yA9vs= +github.com/go-vela/sdk-go v0.4.0-rc3 h1:zU3REEsJTdfcqQtfsDjpJEi0yLy/6dwDOctbchkC0iE= +github.com/go-vela/sdk-go v0.4.0-rc3/go.mod h1:wOyN2Sm/F8g6atzxwr2IWm5AIrrBm4WYVk5U+IKZLbU= +github.com/go-vela/types v0.4.0-rc3 h1:YD7I2FJNUejRgYQCDiTPioKMpddVQa7iaWZHMFCHnqI= +github.com/go-vela/types v0.4.0-rc3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From c07dbe4371be2d23945a272ba2522a94841884b0 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 1 May 2020 10:41:57 -0500 Subject: [PATCH 094/430] chore: update dependencies to v0.4.0 (#88) --- go.mod | 10 +++++----- go.sum | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 5b2e8cf9..3767a286 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.0-rc3 - github.com/go-vela/pkg-queue v0.4.0-rc3 - github.com/go-vela/pkg-runtime v0.4.0-rc3 - github.com/go-vela/sdk-go v0.4.0-rc3 - github.com/go-vela/types v0.4.0-rc3 + github.com/go-vela/pkg-executor v0.4.0 + github.com/go-vela/pkg-queue v0.4.0 + github.com/go-vela/pkg-runtime v0.4.0 + github.com/go-vela/sdk-go v0.4.0 + github.com/go-vela/types v0.4.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index ee42cd46..5ddcfc94 100644 --- a/go.sum +++ b/go.sum @@ -108,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.0-rc3/go.mod h1:DujGFVUpkAJ83XKs71z8KXIwGMPELvA9exrWsDPRrNs= -github.com/go-vela/mock v0.4.0-rc3 h1:nrhXWyfra8ecS7gLFsBBxUwFchQU4/EkSoAtLQEQ470= -github.com/go-vela/mock v0.4.0-rc3/go.mod h1:WiQ8juR+dlcOFKSWliJHAgyBzLLwstb8fKBFhe4z1tY= -github.com/go-vela/pkg-executor v0.4.0-rc3 h1:LPalRL3FaRi8SChIXDGzDQ2gJKJUSRzr8Q6Bf6jlS4E= -github.com/go-vela/pkg-executor v0.4.0-rc3/go.mod h1:RcpqSPYTghe3Mc36qBw8AXTx9zK7ZXOcl3Ezon4QPC4= -github.com/go-vela/pkg-queue v0.4.0-rc3 h1:e1PNr99tGyEcxwqo5XgknY7xBb7ybFMJdksdYECFF3Y= -github.com/go-vela/pkg-queue v0.4.0-rc3/go.mod h1:uQzRpxOUqKkTvP66OVOKYFV8eRJDV50kOLSioqKpR3M= -github.com/go-vela/pkg-runtime v0.4.0-rc3 h1:3X2nqc4HK8+oflEUoH0iTLdfWL6E710svvzlrr5tpbM= -github.com/go-vela/pkg-runtime v0.4.0-rc3/go.mod h1:soqW12zgBZETtAGK3WTp/OeFYFY+cq1oxl/1V4yA9vs= -github.com/go-vela/sdk-go v0.4.0-rc3 h1:zU3REEsJTdfcqQtfsDjpJEi0yLy/6dwDOctbchkC0iE= -github.com/go-vela/sdk-go v0.4.0-rc3/go.mod h1:wOyN2Sm/F8g6atzxwr2IWm5AIrrBm4WYVk5U+IKZLbU= -github.com/go-vela/types v0.4.0-rc3 h1:YD7I2FJNUejRgYQCDiTPioKMpddVQa7iaWZHMFCHnqI= -github.com/go-vela/types v0.4.0-rc3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/compiler v0.4.0/go.mod h1:xSwR92izpiR6zs+FjSim/ic7BbKumMz0QlAjnVKKvRA= +github.com/go-vela/mock v0.4.0 h1:dsGhJHDbM/4FibLqCdHsUV+oADEqht1I+dlA5oa6ADU= +github.com/go-vela/mock v0.4.0/go.mod h1:rYOHTgSHhYPbgn/4h5N7cIOmRpH5XogLbCz3FyW+Xv0= +github.com/go-vela/pkg-executor v0.4.0 h1:oFxdWNG0KyB4HP3IkWMM+z4pigjUNok2A8qHw4pcHv8= +github.com/go-vela/pkg-executor v0.4.0/go.mod h1:Iko0qFkcY7vrM9IrHPZ1MPmiiadg2IDdHBD7QkVsaVo= +github.com/go-vela/pkg-queue v0.4.0 h1:suwI1FZF+ApVmX7LlfLx6J6HC6cIrpINb9evOSJJoEc= +github.com/go-vela/pkg-queue v0.4.0/go.mod h1:5KR+OtelYJ3ldVLZus7bOwcmDI46nF6ffj4KdSp54uk= +github.com/go-vela/pkg-runtime v0.4.0 h1:2ZkGJoeeJh5mKt/x4p7ff74S0E3HcPbI9W5O2nByvWw= +github.com/go-vela/pkg-runtime v0.4.0/go.mod h1:zLlASzTa/oOJMKgVQixJyumzRsEQKcUYbzEUhhc5my4= +github.com/go-vela/sdk-go v0.4.0 h1:exnNeImHmvLBgTwp7tWtqjH0rh9G1GISJR1RFGomKTQ= +github.com/go-vela/sdk-go v0.4.0/go.mod h1:jhG5Hu7+3ka4P2avfmnyNZQ5SeYPh6BGlNi9enht8FI= +github.com/go-vela/types v0.4.0 h1:g2CceYM78QYJ3AbnPpSFoELTw3Ll+tAgoyFGyr2YGoU= +github.com/go-vela/types v0.4.0/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 7e7eb65a7709d4945ee3738eaccb8dfd8ebfbdd5 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 4 May 2020 19:27:19 +0000 Subject: [PATCH 095/430] ci: fix release dependency (#89) --- .github/workflows/release.yml | 60 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4bc1e61..193a8207 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,38 +16,38 @@ jobs: container: image: golang:latest steps: - - name: clone - uses: actions/checkout@v1 + - name: clone + uses: actions/checkout@v1 - - name: tags - run: | - git fetch --tags + - name: tags + run: | + git fetch --tags - - name: version - id: version - run: | - echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: version + id: version + run: | + echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - - name: install - run: | - go get github.com/git-chglog/git-chglog/cmd/git-chglog - go get github.com/itchio/gothub + - name: install + run: | + go get github.com/git-chglog/git-chglog/cmd/git-chglog + go get github.com/github-release/github-release - - name: changelog - run: | - # https://github.com/git-chglog/git-chglog#git-chglog - $(go env GOPATH)/bin/git-chglog \ - -o $GITHUB_WORKSPACE/CHANGELOG.md \ - ${{ steps.version.outputs.VERSION }} + - name: changelog + run: | + # https://github.com/git-chglog/git-chglog#git-chglog + $(go env GOPATH)/bin/git-chglog \ + -o $GITHUB_WORKSPACE/CHANGELOG.md \ + ${{ steps.version.outputs.VERSION }} - - name: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # https://github.com/itchio/gothub#gothub - $(go env GOPATH)/bin/gothub edit \ - --user go-vela \ - --repo worker \ - --tag ${{ steps.version.outputs.VERSION }} \ - --name ${{ steps.version.outputs.VERSION }} \ - --description "$(cat $GITHUB_WORKSPACE/CHANGELOG.md)" + - name: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # https://github.com/github-release/github-release#how-to-use + $(go env GOPATH)/bin/github-release edit \ + --user go-vela \ + --repo worker \ + --tag ${{ steps.version.outputs.VERSION }} \ + --name ${{ steps.version.outputs.VERSION }} \ + --description "$(cat $GITHUB_WORKSPACE/CHANGELOG.md)" From c36c5d8a804fb31431815aab4ac1636e31db9823 Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 7 May 2020 10:50:17 -0500 Subject: [PATCH 096/430] chore: update dependencies for release (#91) * refactor: work directory set moved to compiler * chore: updates for v0.3.0-rc3 * chore: update dependencies for release * chore: update dependencies for release --- go.mod | 10 +++++----- go.sum | 26 +++++++++++++------------- router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 3767a286..784a883d 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.0 - github.com/go-vela/pkg-queue v0.4.0 - github.com/go-vela/pkg-runtime v0.4.0 - github.com/go-vela/sdk-go v0.4.0 - github.com/go-vela/types v0.4.0 + github.com/go-vela/pkg-executor v0.4.1 + github.com/go-vela/pkg-queue v0.4.1 + github.com/go-vela/pkg-runtime v0.4.1 + github.com/go-vela/sdk-go v0.4.1 + github.com/go-vela/types v0.4.1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index 5ddcfc94..a22951cb 100644 --- a/go.sum +++ b/go.sum @@ -108,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.0/go.mod h1:xSwR92izpiR6zs+FjSim/ic7BbKumMz0QlAjnVKKvRA= -github.com/go-vela/mock v0.4.0 h1:dsGhJHDbM/4FibLqCdHsUV+oADEqht1I+dlA5oa6ADU= -github.com/go-vela/mock v0.4.0/go.mod h1:rYOHTgSHhYPbgn/4h5N7cIOmRpH5XogLbCz3FyW+Xv0= -github.com/go-vela/pkg-executor v0.4.0 h1:oFxdWNG0KyB4HP3IkWMM+z4pigjUNok2A8qHw4pcHv8= -github.com/go-vela/pkg-executor v0.4.0/go.mod h1:Iko0qFkcY7vrM9IrHPZ1MPmiiadg2IDdHBD7QkVsaVo= -github.com/go-vela/pkg-queue v0.4.0 h1:suwI1FZF+ApVmX7LlfLx6J6HC6cIrpINb9evOSJJoEc= -github.com/go-vela/pkg-queue v0.4.0/go.mod h1:5KR+OtelYJ3ldVLZus7bOwcmDI46nF6ffj4KdSp54uk= -github.com/go-vela/pkg-runtime v0.4.0 h1:2ZkGJoeeJh5mKt/x4p7ff74S0E3HcPbI9W5O2nByvWw= -github.com/go-vela/pkg-runtime v0.4.0/go.mod h1:zLlASzTa/oOJMKgVQixJyumzRsEQKcUYbzEUhhc5my4= -github.com/go-vela/sdk-go v0.4.0 h1:exnNeImHmvLBgTwp7tWtqjH0rh9G1GISJR1RFGomKTQ= -github.com/go-vela/sdk-go v0.4.0/go.mod h1:jhG5Hu7+3ka4P2avfmnyNZQ5SeYPh6BGlNi9enht8FI= -github.com/go-vela/types v0.4.0 h1:g2CceYM78QYJ3AbnPpSFoELTw3Ll+tAgoyFGyr2YGoU= -github.com/go-vela/types v0.4.0/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/compiler v0.4.1/go.mod h1:e8DKedX+jeToGKGFjbU+mLrGVOlYf9YHVHPpjPjnNKc= +github.com/go-vela/mock v0.4.1 h1:7G92ioeNWF6xg+pUy30hWgfC6Y10139cowwF/H/L9jE= +github.com/go-vela/mock v0.4.1/go.mod h1:LygJGtLygd4TG35C159b6i0GnGsnVN2wRd2tBIaiMM4= +github.com/go-vela/pkg-executor v0.4.1 h1:nQtJSYYmAeozHdDHmOAHuMjqceCvoVAXXUA7dq0Y0Is= +github.com/go-vela/pkg-executor v0.4.1/go.mod h1:ywMmEcqNNCSxLJjEh8WzX18blDl6G9veGpu4230bV50= +github.com/go-vela/pkg-queue v0.4.1 h1:i5ufaEt9mtyakGGQ2+2YI85zE3WKgf1ItAgfIAvr5Ww= +github.com/go-vela/pkg-queue v0.4.1/go.mod h1:B8NkkyK8iHL7LLZIZfBQvx7vIWsxV6qGA0l4admNvHo= +github.com/go-vela/pkg-runtime v0.4.1 h1:JfS8EGz+7qyCAieSyxwfgRaB7d+f6y6hVeRLbqyMCWE= +github.com/go-vela/pkg-runtime v0.4.1/go.mod h1:/VdR+ulKnZQkBLEvAYl7vRKDST2sD9tCd3wcrzJy3gU= +github.com/go-vela/sdk-go v0.4.1 h1:mjynasl7lbcFtZjvo8TVOSfa1TmjGAZ88Tc7lSH0ESM= +github.com/go-vela/sdk-go v0.4.1/go.mod h1:s6fXrnegJ9XMTAqKxRqRZmHsFDeoqKVHVJn4Zdn4GLU= +github.com/go-vela/types v0.4.1 h1:XLRkvcLTr6wTUR2tz5sUYWCyDnIs5j5zdfN+4aCaScM= +github.com/go-vela/types v0.4.1/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index fbe8b233..044b4871 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.4.0" + wantVersion := "0.4.1" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.0" + wantVersion := "0.4.1" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.4.0" + wantVersion := "0.4.1" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.0" + wantVersion := "0.4.1" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index 7ffb4693..33a4ec6b 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 4 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 + VersionPatch int64 = 1 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From 224c96a432eb03570f8be320dc520c4c4247cf3d Mon Sep 17 00:00:00 2001 From: Neal Date: Wed, 20 May 2020 15:10:22 -0500 Subject: [PATCH 097/430] chore: update for patch release v0.4.2 (#92) --- go.mod | 10 +++++----- go.sum | 28 +++++++++++++++------------- router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 784a883d..b4a3ebbc 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.1 - github.com/go-vela/pkg-queue v0.4.1 - github.com/go-vela/pkg-runtime v0.4.1 - github.com/go-vela/sdk-go v0.4.1 - github.com/go-vela/types v0.4.1 + github.com/go-vela/pkg-executor v0.4.2 + github.com/go-vela/pkg-queue v0.4.2 + github.com/go-vela/pkg-runtime v0.4.2 + github.com/go-vela/sdk-go v0.4.2 + github.com/go-vela/types v0.4.2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index a22951cb..c6676cc6 100644 --- a/go.sum +++ b/go.sum @@ -108,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.1/go.mod h1:e8DKedX+jeToGKGFjbU+mLrGVOlYf9YHVHPpjPjnNKc= -github.com/go-vela/mock v0.4.1 h1:7G92ioeNWF6xg+pUy30hWgfC6Y10139cowwF/H/L9jE= -github.com/go-vela/mock v0.4.1/go.mod h1:LygJGtLygd4TG35C159b6i0GnGsnVN2wRd2tBIaiMM4= -github.com/go-vela/pkg-executor v0.4.1 h1:nQtJSYYmAeozHdDHmOAHuMjqceCvoVAXXUA7dq0Y0Is= -github.com/go-vela/pkg-executor v0.4.1/go.mod h1:ywMmEcqNNCSxLJjEh8WzX18blDl6G9veGpu4230bV50= -github.com/go-vela/pkg-queue v0.4.1 h1:i5ufaEt9mtyakGGQ2+2YI85zE3WKgf1ItAgfIAvr5Ww= -github.com/go-vela/pkg-queue v0.4.1/go.mod h1:B8NkkyK8iHL7LLZIZfBQvx7vIWsxV6qGA0l4admNvHo= -github.com/go-vela/pkg-runtime v0.4.1 h1:JfS8EGz+7qyCAieSyxwfgRaB7d+f6y6hVeRLbqyMCWE= -github.com/go-vela/pkg-runtime v0.4.1/go.mod h1:/VdR+ulKnZQkBLEvAYl7vRKDST2sD9tCd3wcrzJy3gU= -github.com/go-vela/sdk-go v0.4.1 h1:mjynasl7lbcFtZjvo8TVOSfa1TmjGAZ88Tc7lSH0ESM= -github.com/go-vela/sdk-go v0.4.1/go.mod h1:s6fXrnegJ9XMTAqKxRqRZmHsFDeoqKVHVJn4Zdn4GLU= -github.com/go-vela/types v0.4.1 h1:XLRkvcLTr6wTUR2tz5sUYWCyDnIs5j5zdfN+4aCaScM= -github.com/go-vela/types v0.4.1/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/compiler v0.4.2/go.mod h1:v/Ey7edOBwldinSrm9srTpZzrJ2TK0KT0AuXtE7Z7A4= +github.com/go-vela/mock v0.4.2 h1:IjwKSHfKknEdnawkdPG/+Nf7bGAillp8//iuh+GFP8c= +github.com/go-vela/mock v0.4.2/go.mod h1:5ZzMY1Zb5oT9LLVr8PIGo0E2237UvYipznMI4deucTI= +github.com/go-vela/pkg-executor v0.4.2 h1:ru4ictVmCGmR2nTkoSljwPuY3PWKeSSHP/bfv/LMFQM= +github.com/go-vela/pkg-executor v0.4.2/go.mod h1:ctKc3iJZkzimkTGa2E4cyrhCY80lndgqQLXx87oW9vs= +github.com/go-vela/pkg-queue v0.4.2 h1:wUS+YoEB8rPpm3/Uxmtd6hQQdC0fAcwg5TQr3pOKVHs= +github.com/go-vela/pkg-queue v0.4.2/go.mod h1:wKOn7AiYcAPUAt0/woJoxMdQc+0D8LITOhI2ouAN4cI= +github.com/go-vela/pkg-runtime v0.4.2 h1:sEyk6tXRfcfpo96B4RqEnQjoRdAm3bYpIR5DgI4xuFI= +github.com/go-vela/pkg-runtime v0.4.2/go.mod h1:HjXEvy5A9kNBupOlt2nDKz1UMVUsYDBeELwSVE9Z3Kc= +github.com/go-vela/sdk-go v0.4.2 h1:SKtwKKjEog9308dt4ft3K8+CZh86DaH1h3RcGJIFFuo= +github.com/go-vela/sdk-go v0.4.2/go.mod h1:Nz2y3aO5O4zjEXJV/wwqyyf5SkkNRXUJIZwkd816IC0= +github.com/go-vela/types v0.4.2 h1:PO8IXVwMkDjp/07hXuLn7PkGVb3YkOQz1SP1H2QtCEc= +github.com/go-vela/types v0.4.2/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -436,6 +436,8 @@ gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 044b4871..51b62bcf 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.4.1" + wantVersion := "0.4.2" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.1" + wantVersion := "0.4.2" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.4.1" + wantVersion := "0.4.2" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.1" + wantVersion := "0.4.2" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index 33a4ec6b..ff48fd92 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 4 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 1 + VersionPatch int64 = 2 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From c078be17b340b1e51e8e6df4d14fda55c5bd769b Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 21 May 2020 08:49:33 -0500 Subject: [PATCH 098/430] chore: update for patch release v0.4.3 (#93) --- go.mod | 10 +++++----- go.sum | 26 +++++++++++++------------- router/middleware/header_test.go | 8 ++++---- version/version.go | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index b4a3ebbc..bcdfbb6e 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.5.0 - github.com/go-vela/pkg-executor v0.4.2 - github.com/go-vela/pkg-queue v0.4.2 - github.com/go-vela/pkg-runtime v0.4.2 - github.com/go-vela/sdk-go v0.4.2 - github.com/go-vela/types v0.4.2 + github.com/go-vela/pkg-executor v0.4.3 + github.com/go-vela/pkg-queue v0.4.3 + github.com/go-vela/pkg-runtime v0.4.3 + github.com/go-vela/sdk-go v0.4.3 + github.com/go-vela/types v0.4.3 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect diff --git a/go.sum b/go.sum index c6676cc6..7df07e9b 100644 --- a/go.sum +++ b/go.sum @@ -108,19 +108,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.2/go.mod h1:v/Ey7edOBwldinSrm9srTpZzrJ2TK0KT0AuXtE7Z7A4= -github.com/go-vela/mock v0.4.2 h1:IjwKSHfKknEdnawkdPG/+Nf7bGAillp8//iuh+GFP8c= -github.com/go-vela/mock v0.4.2/go.mod h1:5ZzMY1Zb5oT9LLVr8PIGo0E2237UvYipznMI4deucTI= -github.com/go-vela/pkg-executor v0.4.2 h1:ru4ictVmCGmR2nTkoSljwPuY3PWKeSSHP/bfv/LMFQM= -github.com/go-vela/pkg-executor v0.4.2/go.mod h1:ctKc3iJZkzimkTGa2E4cyrhCY80lndgqQLXx87oW9vs= -github.com/go-vela/pkg-queue v0.4.2 h1:wUS+YoEB8rPpm3/Uxmtd6hQQdC0fAcwg5TQr3pOKVHs= -github.com/go-vela/pkg-queue v0.4.2/go.mod h1:wKOn7AiYcAPUAt0/woJoxMdQc+0D8LITOhI2ouAN4cI= -github.com/go-vela/pkg-runtime v0.4.2 h1:sEyk6tXRfcfpo96B4RqEnQjoRdAm3bYpIR5DgI4xuFI= -github.com/go-vela/pkg-runtime v0.4.2/go.mod h1:HjXEvy5A9kNBupOlt2nDKz1UMVUsYDBeELwSVE9Z3Kc= -github.com/go-vela/sdk-go v0.4.2 h1:SKtwKKjEog9308dt4ft3K8+CZh86DaH1h3RcGJIFFuo= -github.com/go-vela/sdk-go v0.4.2/go.mod h1:Nz2y3aO5O4zjEXJV/wwqyyf5SkkNRXUJIZwkd816IC0= -github.com/go-vela/types v0.4.2 h1:PO8IXVwMkDjp/07hXuLn7PkGVb3YkOQz1SP1H2QtCEc= -github.com/go-vela/types v0.4.2/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/compiler v0.4.3/go.mod h1:icFuaC+TsCdZBLajFW3qGtpL9nEc0WDAu3vvBSnY8ds= +github.com/go-vela/mock v0.4.3 h1:Ts60thJEd8lkrC7ulvSxoT8p0sL+/38DtwiAB0XI1y8= +github.com/go-vela/mock v0.4.3/go.mod h1:0jefMm79gmAiHt2vlYwHrZX3TUeHK8ktQzGgM2Tvi9M= +github.com/go-vela/pkg-executor v0.4.3 h1:hdcbfx5Ermy21dwgKGZieyjZHjiG9h8X6MpCS+DD1aI= +github.com/go-vela/pkg-executor v0.4.3/go.mod h1:MOaXHpre7chBHSAfK2jx9dvtgSe/hq7gqV9jxsM9K4A= +github.com/go-vela/pkg-queue v0.4.3 h1:GsyL/OG0Dket7V2hovebHFAwLqYvqycTIpwFJMSz1PQ= +github.com/go-vela/pkg-queue v0.4.3/go.mod h1:FC1cSRFEK2vpOaZlQ8kUVDLFczMAwwid6r6EqJ6tB7w= +github.com/go-vela/pkg-runtime v0.4.3 h1:BcBTNv41A0PSDIKlxHSzRuCLuNUSZPl3LYRSxKrN9GY= +github.com/go-vela/pkg-runtime v0.4.3/go.mod h1:YuQmn2Tal43HjNfPT07rcmsVJrnNP29R8J5hCVh+YPg= +github.com/go-vela/sdk-go v0.4.3 h1:+mfDcwSCLlM2tn1HIq1jOgJnJ2nkoaucWd5wTgfddsM= +github.com/go-vela/sdk-go v0.4.3/go.mod h1:rhbY07rm6SaesHzzvS5SvWYDFGbGi4ESnB2frVhENwk= +github.com/go-vela/types v0.4.3 h1:AMAbCyaoLCPAlxgae4myCKJQq1xIvc9hy+nCEL6l/+E= +github.com/go-vela/types v0.4.3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 51b62bcf..1e7c7c89 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.4.2" + wantVersion := "0.4.3" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.2" + wantVersion := "0.4.3" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.4.2" + wantVersion := "0.4.3" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.2" + wantVersion := "0.4.3" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index ff48fd92..597a2731 100644 --- a/version/version.go +++ b/version/version.go @@ -12,7 +12,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor int64 = 4 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 2 + VersionPatch int64 = 3 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From d9198a4ac335c42d328ee5c2c91aeae251ea6a9d Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 22 May 2020 13:16:20 -0500 Subject: [PATCH 099/430] perf: add more startup logs (#94) --- cmd/vela-worker/operate.go | 8 ++++++++ cmd/vela-worker/server.go | 10 ++++++++++ cmd/vela-worker/start.go | 20 ++++++++++++++++++++ cmd/vela-worker/validate.go | 3 +++ 4 files changed, 41 insertions(+) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index cae7b66e..773dd689 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -39,6 +39,9 @@ func (w *Worker) operate() error { // iterate till the configured build limit for i := 0; i < w.Config.Build.Limit; i++ { + // log a message indicating the start of an operator thread + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Infof("Thread ID %d listening to queue...", i) // spawn errgroup routine for operator subprocess @@ -50,6 +53,11 @@ func (w *Worker) operate() error { // exec operator subprocess to poll and execute builds err = w.exec(i) if err != nil { + // log the error received from the executor + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf + logrus.Errorf("failing worker executor: %v", err) + return err } } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 40109c61..78dbbe3a 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -16,6 +16,11 @@ import ( // server is a helper function to listen and serve // traffic for web and API requests for the Worker. func (w *Worker) server() error { + // log a message indicating the setup of the server handlers + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Trace + logrus.Trace("loading router with server handlers") + // create the worker router to listen and serve traffic // // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#Load @@ -26,6 +31,11 @@ func (w *Worker) server() error { middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) + // log a message indicating the start of serving traffic + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Tracef + logrus.Tracef("serving traffic on %s", w.Config.API.Port) + // start serving traffic on the provided worker port // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index c17241a8..e38efcab 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -28,10 +28,19 @@ func (w *Worker) Start() error { tomb.Go(func() error { // spawn goroutine for starting the server go func() { + // log a message indicating the start of the server + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Info("starting worker server") + // start the server for the worker err := w.server() if err != nil { + // log the error received from the server + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf + logrus.Errorf("failing worker server: %v", err) + // kill the worker subprocesses // // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill @@ -41,10 +50,19 @@ func (w *Worker) Start() error { // spawn goroutine for starting the operator go func() { + // log a message indicating the start of the operator + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Info("starting worker operator") + // start the operator for the worker err := w.operate() if err != nil { + // log the error received from the operator + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf + logrus.Errorf("failing worker operator: %v", err) + // kill the worker subprocesses // // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill @@ -59,6 +77,8 @@ func (w *Worker) Start() error { // check if one of the worker subprocesses died case <-tomb.Dying(): // fatally log that we're shutting down the worker + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Fatal logrus.Fatal("shutting down worker") return tomb.Err() diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 9406bad7..c7d192db 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -12,6 +12,9 @@ import ( // Validate verifies the Worker is properly configured. func (w *Worker) Validate() error { + // log a message indicating the configuration verification + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Info("validating worker configuration") // verify a build limit was provided From 97823fad72c0ebffe33132bf355f68d78c59d4a1 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 26 May 2020 13:36:50 -0500 Subject: [PATCH 100/430] docs: divert bugs and features to community (#95) --- .github/CONTRIBUTING.md | 8 ++++---- .github/ISSUE_TEMPLATE/not_here.md | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/not_here.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a213628f..021f4535 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,13 +2,13 @@ We'd love to accept your contributions to this project! There are just a few guidelines you need to follow. -## Feature Requests +## Bugs -Feature Requests should be opened up as [Issues](/issues/new/) on this repository! +Bug reports should be opened up as [issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues) on the [go-vela/community](https://github.com/go-vela/community) repository! -## Issues +## Feature Requests -[Issues](/issues/new/) are always welcome! +Feature Requests should be opened up as [issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues) on the [go-vela/community](https://github.com/go-vela/community) repository! ## Pull Requests diff --git a/.github/ISSUE_TEMPLATE/not_here.md b/.github/ISSUE_TEMPLATE/not_here.md new file mode 100644 index 00000000..753105a8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/not_here.md @@ -0,0 +1,7 @@ +## Not Here + +**Please refrain from opening your issue here!** + +Instead, we ask that you open your issue in the [go-vela/community](https://github.com/go-vela/community) repository. + +For more information, you can see our [contributing](../CONTRIBUTING.md) documentation. From 6601d64e0ee4eac01467f3a0a2b3ae5cc64fc176 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 28 May 2020 14:04:23 -0500 Subject: [PATCH 101/430] revert: repo issue template (#96) --- .github/CONTRIBUTING.md | 2 +- .github/ISSUE_TEMPLATE/not_here.md | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/not_here.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 021f4535..907b8320 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -14,7 +14,7 @@ Feature Requests should be opened up as [issues](https://help.github.com/en/gith **NOTE: We recommend you start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, it's helpful to know what people are working on.** -We are always welcome to new PRs! You can follow the below guide for learning how you can contribute to the project! +We are always open to new PRs! You can follow the below guide for learning how you can contribute to the project! ## Getting Started diff --git a/.github/ISSUE_TEMPLATE/not_here.md b/.github/ISSUE_TEMPLATE/not_here.md deleted file mode 100644 index 753105a8..00000000 --- a/.github/ISSUE_TEMPLATE/not_here.md +++ /dev/null @@ -1,7 +0,0 @@ -## Not Here - -**Please refrain from opening your issue here!** - -Instead, we ask that you open your issue in the [go-vela/community](https://github.com/go-vela/community) repository. - -For more information, you can see our [contributing](../CONTRIBUTING.md) documentation. From d888968b86721efb894b638bbf452dca6452451c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 12 Jun 2020 14:54:18 -0500 Subject: [PATCH 102/430] feat: add reviewdog with golangci-lint (#97) --- .github/workflows/reviewdog.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 00000000..dbcb32bc --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,41 @@ +# name of the action +name: reviewdog + +# trigger on pull_request events +on: + pull_request: + +# pipeline to execute +jobs: + diff-review: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + + - name: golangci-lint + uses: reviewdog/action-golangci-lint@v1 + with: + github_token: ${{ secrets.github_token }} + golangci_lint_flags: "--config=.golangci.yml" + fail_on_error: true + filter_mode: diff_context + reporter: github-pr-review + + full-review: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + + - name: golangci-lint + uses: reviewdog/action-golangci-lint@v1 + with: + github_token: ${{ secrets.github_token }} + golangci_lint_flags: "--config=.golangci.yml" + fail_on_error: false + filter_mode: nofilter From 3f80226b03caae4d4404d363c21ed9ec66a86961 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 2 Jul 2020 15:54:06 -0500 Subject: [PATCH 103/430] ci: refactor Makefile. improve linter setup. upgrade deps. (#98) * ci: add .PHONY make tags * ci: add make targets for dependencies * ci: skip codecov patch status * ci: add more linters. skip some linters on tests * ci: bump checkout action to v2 * ci: add go fix to validate workflow * chore: upgrade go dependencies --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 4 +- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 4 +- .golangci.yml | 144 +++++++++++++++------ Makefile | 216 +++++++++++++++++++++++++++---- codecov.yml | 13 +- go.mod | 32 ++++- go.sum | 120 +++++++++++++++-- 12 files changed, 448 insertions(+), 95 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e262df0f..4b95230f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: build run: | diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 67a39f84..aa9b519f 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -15,7 +15,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: build env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4e3dc428..3f68b857 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: build env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 193a8207..a625d367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: tags run: | diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index dbcb32bc..efb9f856 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -13,7 +13,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: golangci-lint uses: reviewdog/action-golangci-lint@v1 @@ -30,7 +30,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: golangci-lint uses: reviewdog/action-golangci-lint@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d70a7e8..e32bc53d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: install run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 867909fc..b95283e0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,7 +14,7 @@ jobs: image: golang:latest steps: - name: clone - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: validate run: | @@ -24,3 +24,5 @@ jobs: go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go fix ./... produces a zero diff; clean up any changes afterwards. + go fix ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) diff --git a/.golangci.yml b/.golangci.yml index 60daee7c..665b1f01 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,72 +2,136 @@ # some defaults explicitly provided. There is a large number of # linters we've enabled that are usually disabled by default. # -# https://github.com/golangci/golangci-lint#config-file +# https://golangci-lint.run/usage/configuration/#config-file # This section provides the configuration for how golangci # outputs it results from the linters it executes. output: + # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" format: colored-line-number + + # print lines of code with issue, default is true print-issued-lines: true + + # print linter name in the end of issue text, default is true print-linter-name: true + # make issues output unique by line, default is true + uniq-by-line: true + +# This section provides the configuration for each linter +# we've instructed golangci to execute. +linters-settings: + # https://github.com/mibk/dupl + dupl: + threshold: 100 + + # https://github.com/ultraware/funlen + funlen: + lines: 100 + statements: 50 + + # https://github.com/golang/lint + golint: + min-confidence: 0 + + # https://github.com/tommy-muehle/go-mnd + gomnd: + settings: + mnd: + # don't include the "operation" and "assign" + checks: argument,case,condition,return + + # https://github.com/walle/lll + lll: + line-length: 100 + + # https://github.com/mdempsky/maligned + maligned: + suggest-new: true + + # https://github.com/client9/misspell + misspell: + locale: US + + # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint + nolintlint: + allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) + allow-unused: false # report any unused nolint directives + require-explanation: false # don't require an explanation for nolint directives + require-specific: false # don't require nolint directives to be specific about which linter is being skipped + # This section provides the configuration for which linters # golangci will execute. Several of them were disabled by # default but we've opted to enable them. linters: # disable all linters as new linters might be added to golangci disable-all: true + + # enable a specific set of linters to run enable: - # linters enabled by default - - deadcode - - errcheck - - govet - - gosimple # a.k.a. megacheck - - ineffassign - - staticcheck - - structcheck - - typecheck - - unused - - varcheck - - # linters disabled by default - bodyclose - - gocognit + - deadcode # enabled by default + - dupl + - errcheck # enabled by default + - funlen - goconst - gocyclo + - godot + - gofmt - goimports + - golint + - gomnd + - goprintffuncname - gosec - - funlen + - gosimple # enabled by default + - govet # enabled by default + - ineffassign # enabled by default + - lll - maligned - misspell + - nakedret + - nolintlint + - staticcheck # enabled by default + - structcheck # enabled by default - stylecheck + - typecheck # enabled by default + - unconvert - unparam + - unused # enabled by default + - varcheck # enabled by default - whitespace - - wsl # static list of linters we know golangci can run but we've # chosen to leave disabled for now - # - # disable: - # - depguard - # - dogsled - # - dupl - # - gocritic - # - gochecknoinits - # - gochecknoglobals - # - godox - # - gofmt - # - golint - # - gomnd - # - interfacer - # - lll - # - nakedret - # - scopelint - # - unconvert + # - asciicheck + # - depguard + # - dogsled + # - exhaustive + # - gochecknoinits + # - gochecknoglobals + # - gocognit + # - gocritic + # - godox + # - goerr113 + # - interfacer + # - nestif + # - noctx + # - prealloc + # - rowserrcheck + # - scopelint + # - testpackage + # - wsl -# This section provides the configuration for each linter -# we've instructed golangci to execute. -linters-settings: - funlen: - lines: 100 - statements: 60 +# This section provides the configuration for how golangci +# will report the issues it finds. +issues: + # Excluding configuration per-path, per-linter, per-text and per-source + exclude-rules: + # prevent linters from running on *_test.go files + - path: _test\.go + linters: + - funlen + - goconst + - gocyclo + - gomnd diff --git a/Makefile b/Makefile index 5c07a0c6..4e9505b0 100644 --- a/Makefile +++ b/Makefile @@ -2,41 +2,211 @@ # # Use of this source code is governed by the LICENSE file in this repository. +# The `clean` target is intended to clean the workspace +# and prepare the local changes for submission. +# +# Usage: `make clean` +.PHONY: clean +clean: tidy vet fmt fix + +# The `restart` target is intended to destroy and +# create the local Docker compose stack. +# +# Usage: `make restart` +.PHONY: restart restart: down up -up: build compose-up +# The `up` target is intended to create +# the local Docker compose stack. +# +# Usage: `make up` +.PHONY: up +up: build pull compose-up +# The `down` target is intended to destroy +# the local Docker compose stack. +# +# Usage: `make down` +.PHONY: down down: compose-down -rebuild: build compose-up - -clean: - ################################# - ###### Go clean ###### - ################################# - +# The `tidy` target is intended to clean up +# the Go module files (go.mod & go.sum). +# +# Usage: `make tidy` +.PHONY: tidy +tidy: + @echo + @echo "### Tidying Go module" @go mod tidy + +# The `vet` target is intended to inspect the +# Go source code for potential issues. +# +# Usage: `make vet` +.PHONY: vet +vet: + @echo + @echo "### Vetting Go code" @go vet ./... + +# The `fmt` target is intended to format the +# Go source code to meet the language standards. +# +# Usage: `make fmt` +.PHONY: fmt +fmt: + @echo + @echo "### Formatting Go Code" @go fmt ./... - @echo "I'm kind of the only name in clean energy right now" +# The `fix` target is intended to rewrite the +# Go source code using old APIs. +# +# Usage: `make fix` +.PHONY: fix +fix: + @echo + @echo "### Fixing Go Code" + @go fix ./... + +# The `test` target is intended to run +# the tests for the Go source code. +# +# Usage: `make test` +.PHONY: test +test: + @echo + @echo "### Testing Go Code" + @go test -race ./... + +# The `test-cover` target is intended to run +# the tests for the Go source code and then +# open the test coverage report. +# +# Usage: `make test-cover` +.PHONY: test-cover +test-cover: + @echo + @echo "### Creating test coverage report" + @go test -race -covermode=atomic -coverprofile=coverage.out ./... + @echo + @echo "### Opening test coverage report" + @go tool cover -html=coverage.out + +# The `build` target is intended to compile +# the Go source code into a binary. +# +# Usage: `make build` +.PHONY: build build: - ################################# - ###### Build Golang Binary ###### - ################################# + @echo + @echo "### Building release/vela-worker binary" + GOOS=linux CGO_ENABLED=0 \ + go build -a \ + -o release/vela-worker \ + github.com/go-vela/worker/cmd/vela-worker - GOOS=linux CGO_ENABLED=0 go build -o release/vela-worker github.com/go-vela/worker/cmd/vela-worker +# The `build-static` target is intended to compile +# the Go source code into a statically linked binary. +# +# Usage: `make build-static` +.PHONY: build-static +build-static: + @echo + @echo "### Building static release/vela-worker binary" + GOOS=linux CGO_ENABLED=0 \ + go build -a \ + -ldflags '-s -w -extldflags "-static"' \ + -o release/vela-worker \ + github.com/go-vela/worker/cmd/vela-worker -compose-up: - ################################# - ###### Docker Build/Start ###### - ################################# +# The `check` target is intended to output all +# dependencies from the Go module that need updates. +# +# Usage: `make check` +.PHONY: check +check: check-install + @echo + @echo "### Checking dependencies for updates" + @go list -u -m -json all | go-mod-outdated -update - @docker-compose -f docker-compose.yml up -d --build # build and start app +# The `check-direct` target is intended to output direct +# dependencies from the Go module that need updates. +# +# Usage: `make check-direct` +.PHONY: check-direct +check-direct: check-install + @echo + @echo "### Checking direct dependencies for updates" + @go list -u -m -json all | go-mod-outdated -direct -compose-down: - ################################# - ###### Docker Tear Down ###### - ################################# +# The `check-full` target is intended to output +# all dependencies from the Go module. +# +# Usage: `make check-full` +.PHONY: check-full +check-full: check-install + @echo + @echo "### Checking all dependencies for updates" + @go list -u -m -json all | go-mod-outdated + +# The `check-install` target is intended to download +# the tool used to check dependencies from the Go module. +# +# Usage: `make check-install` +.PHONY: check-install +check-install: + @echo + @echo "### Installing psampaz/go-mod-outdated" + @go get -u github.com/psampaz/go-mod-outdated + +# The `bump-deps` target is intended to upgrade +# non-test dependencies for the Go module. +# +# Usage: `make bump-deps` +.PHONY: bump-deps +bump-deps: check + @echo + @echo "### Upgrading dependencies" + @go get -u ./... - @docker-compose -f docker-compose.yml down -v +# The `bump-deps-full` target is intended to upgrade +# all dependencies for the Go module. +# +# Usage: `make bump-deps-full` +.PHONY: bump-deps-full +bump-deps-full: check + @echo + @echo "### Upgrading all dependencies" + @go get -t -u ./... + +# The `pull` target is intended to pull all +# images for the local Docker compose stack. +# +# Usage: `make pull` +.PHONY: pull +pull: + @echo + @echo "### Pulling images for docker-compose stack" + @docker-compose pull + +# The `compose-up` target is intended to build and create +# all containers for the local Docker compose stack. +# +# Usage: `make compose-up` +.PHONY: compose-up +compose-up: + @echo + @echo "### Creating containers for docker-compose stack" + @docker-compose -f docker-compose.yml up -d --build + +# The `compose-down` target is intended to destroy +# all containers for the local Docker compose stack. +# +# Usage: `make compose-down` +.PHONY: compose-down +compose-down: + @echo + @echo "### Destroying containers for docker-compose stack" + @docker-compose -f docker-compose.yml down diff --git a/codecov.yml b/codecov.yml index f23cd41a..e6503ede 100644 --- a/codecov.yml +++ b/codecov.yml @@ -20,10 +20,17 @@ coverage: round: down range: "70...100" + # https://docs.codecov.io/docs/commit-status status: - project: yes - patch: yes - changes: no + # set rules for the project status report + project: + default: + target: 90% + threshold: 0% + # disable the patch status report + patch: off + # disable the changes status report + changes: off # This section provides the configuration for the # parsers codecov uses for the coverage report. diff --git a/go.mod b/go.mod index bcdfbb6e..263db29e 100644 --- a/go.mod +++ b/go.mod @@ -3,20 +3,38 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/alicebob/miniredis/v2 v2.13.0 // indirect github.com/coreos/go-semver v0.3.0 - github.com/gin-gonic/gin v1.5.0 + github.com/evanphx/json-patch v4.5.0+incompatible // indirect + github.com/gin-gonic/gin v1.6.3 + github.com/go-playground/validator/v10 v10.3.0 // indirect + github.com/go-redis/redis v6.15.8+incompatible // indirect github.com/go-vela/pkg-executor v0.4.3 github.com/go-vela/pkg-queue v0.4.3 github.com/go-vela/pkg-runtime v0.4.3 github.com/go-vela/sdk-go v0.4.3 github.com/go-vela/types v0.4.3 + github.com/google/gofuzz v1.1.0 // indirect + github.com/googleapis/gnostic v0.3.1 // indirect + github.com/imdario/mergo v0.3.9 // indirect github.com/joho/godotenv v1.3.0 - github.com/prometheus/client_golang v1.2.1 - github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect - github.com/prometheus/procfs v0.0.8 // indirect - github.com/sirupsen/logrus v1.5.0 + github.com/kr/pretty v0.2.0 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/prometheus/client_golang v1.7.1 + github.com/sirupsen/logrus v1.6.0 github.com/urfave/cli/v2 v2.2.0 - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e // indirect + golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect + golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 + golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect + golang.org/x/text v0.3.3 // indirect + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 // indirect + google.golang.org/grpc v1.30.0 // indirect + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 + k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index 7df07e9b..37487871 100644 --- a/go.sum +++ b/go.sum @@ -31,9 +31,13 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.11.4 h1:GsuyeunTx7EllZBU3/6Ji3dhMQZDpC9rLf1luJ+6M5M= github.com/alicebob/miniredis/v2 v2.11.4/go.mod h1:VL3UDEfAH59bSa7MuHMuFToxkqyHh69s/WUbYlOAuyg= +github.com/alicebob/miniredis/v2 v2.13.0 h1:QPosMaxm+r6Qs+YcCtL2Z2a2RSdC9VfXJLpd80l8ICU= +github.com/alicebob/miniredis/v2 v2.13.0/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -41,8 +45,6 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -70,15 +72,19 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -88,6 +94,8 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -97,6 +105,8 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -105,8 +115,14 @@ github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rm github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= +github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= +github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.4.3/go.mod h1:icFuaC+TsCdZBLajFW3qGtpL9nEc0WDAu3vvBSnY8ds= github.com/go-vela/mock v0.4.3 h1:Ts60thJEd8lkrC7ulvSxoT8p0sL+/38DtwiAB0XI1y8= @@ -138,7 +154,16 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -147,6 +172,9 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -154,6 +182,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= @@ -161,6 +191,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= +github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -174,6 +206,8 @@ github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -182,6 +216,9 @@ github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62F github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -190,9 +227,13 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGi github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -209,6 +250,8 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -240,6 +283,8 @@ github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -253,23 +298,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= +github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee h1:iBZPTYkGLvdu6+A5TsMUJQkQX9Ad4aCEnSQtdxPuTCQ= -github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 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/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -280,6 +323,8 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -293,6 +338,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= @@ -303,6 +350,8 @@ github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBU github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e h1:oIpIX9VKxSCFrfjsKpluGbNPBGq9iNnT9crH781j9wY= +github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -311,6 +360,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -331,11 +382,15 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -343,6 +398,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -358,23 +415,31 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -393,6 +458,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -400,12 +467,30 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 h1:4BC1C1i30F3MZeiIO6y6IIo4DxrtOwITK87bQl3lhFA= +google.golang.org/genproto v0.0.0-20200702021140-07506425bd67/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -432,6 +517,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= @@ -456,11 +542,17 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUc k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 h1:7Nu2dTj82c6IaWvL7hImJzcXoTPz1MsSCH7r+0m6rfo= +k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 08a3fb6bb1dbf864c80cf7d41b2121f8f76a1812 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Wed, 8 Jul 2020 18:54:06 -0500 Subject: [PATCH 104/430] feat(api): add open api (swagger) spec (#99) * swagger: add initial api spec * swagger: add api-spec * update api-spec, remove unneeded objects * name api-spec * go mod tidy * revert docker-compose change --- api-spec/vela-worker-v0.4.3.json | 930 +++++++++++++++++++++++++++++++ api/build.go | 57 ++ api/executor.go | 53 ++ api/health.go | 15 + api/metrics.go | 15 + api/pipeline.go | 29 + api/repo.go | 29 + api/shutdown.go | 20 + go.mod | 2 +- go.sum | 3 + router/router.go | 21 + 11 files changed, 1173 insertions(+), 1 deletion(-) create mode 100644 api-spec/vela-worker-v0.4.3.json diff --git a/api-spec/vela-worker-v0.4.3.json b/api-spec/vela-worker-v0.4.3.json new file mode 100644 index 00000000..727efc02 --- /dev/null +++ b/api-spec/vela-worker-v0.4.3.json @@ -0,0 +1,930 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "description": "API for a Vela worker", + "title": "Vela worker", + "version": "0.4.3" + }, + "paths": { + "/api/v1/executors": { + "get": { + "description": "Get all currently running executors", + "produces": [ + "application/json" + ], + "tags": [ + "executor" + ], + "operationId": "GetExecutors", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all running executors", + "schema": { + "$ref": "#/definitions/Executor" + } + }, + "500": { + "description": "Unable to retrieve all running executors" + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/executors/{executor}": { + "get": { + "description": "Get a currently running executor", + "produces": [ + "application/json" + ], + "tags": [ + "executor" + ], + "operationId": "GetExecutor", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "The executor to retrieve", + "name": "executor", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the executor", + "schema": { + "$ref": "#/definitions/Executor" + } + }, + "500": { + "description": "Unable to retrieve the executor" + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/executors/{executor}/build": { + "get": { + "description": "Get the currently running build", + "produces": [ + "application/json" + ], + "tags": [ + "build" + ], + "operationId": "GetBuild", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "The executor running the build", + "name": "executor", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the build", + "schema": { + "$ref": "#/definitions/Build" + } + }, + "500": { + "description": "Unable to retrieve the build", + "schema": { + "type": "string" + } + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/executors/{executor}/build/kill": { + "delete": { + "description": "Kill the currently running build", + "produces": [ + "application/json" + ], + "tags": [ + "build" + ], + "operationId": "KillBuild", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "The executor running the build", + "name": "executor", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully killed the build" + }, + "500": { + "description": "Unable to kill the build" + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/executors/{executor}/pipeline": { + "get": { + "description": "Get a currently running pipeline", + "produces": [ + "application/json" + ], + "tags": [ + "pipeline" + ], + "operationId": "GetPipeline", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "The executor running the pipeline", + "name": "executor", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the pipeline", + "schema": { + "$ref": "#/definitions/PipelineBuild" + } + }, + "500": { + "description": "Unable to retrieve the pipeline" + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/executors/{executor}/repo": { + "get": { + "description": "Get a currently running repo", + "produces": [ + "application/json" + ], + "tags": [ + "repo" + ], + "operationId": "GetRepo", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "The executor running the build", + "name": "executor", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the repo", + "schema": { + "$ref": "#/definitions/Repo" + } + }, + "500": { + "description": "Unable to retrieve the repo" + } + }, + "x-success_http_code": "200" + } + }, + "/api/v1/shutdown": { + "post": { + "description": "Perform a soft shutdown of the worker", + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "operationId": "Shutdown", + "parameters": [ + { + "type": "string", + "description": "Vela server token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "501": { + "description": "Endpoint is not yet implemented", + "schema": { + "type": "string" + } + } + }, + "x-success_http_code": "501" + } + }, + "/health": { + "get": { + "description": "Check if the worker API is available", + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "operationId": "Health", + "responses": { + "200": { + "description": "Successful 'ping' of Vela worker API", + "schema": { + "type": "string" + } + } + }, + "x-success_http_code": "200" + } + }, + "/metrics": { + "get": { + "description": "Retrieve metrics from the worker", + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "operationId": "Metrics", + "responses": { + "200": { + "description": "Successful retrieval of worker metrics", + "schema": { + "type": "string" + } + } + }, + "x-success_http_code": "200" + } + } + }, + "definitions": { + "Build": { + "type": "object", + "title": "Build is the library representation of a build for a pipeline.", + "properties": { + "author": { + "type": "string", + "x-go-name": "Author" + }, + "base_ref": { + "type": "string", + "x-go-name": "BaseRef" + }, + "branch": { + "type": "string", + "x-go-name": "Branch" + }, + "clone": { + "type": "string", + "x-go-name": "Clone" + }, + "commit": { + "type": "string", + "x-go-name": "Commit" + }, + "created": { + "type": "integer", + "format": "int64", + "x-go-name": "Created" + }, + "deploy": { + "type": "string", + "x-go-name": "Deploy" + }, + "distribution": { + "type": "string", + "x-go-name": "Distribution" + }, + "email": { + "type": "string", + "x-go-name": "Email" + }, + "enqueued": { + "type": "integer", + "format": "int64", + "x-go-name": "Enqueued" + }, + "error": { + "type": "string", + "x-go-name": "Error" + }, + "event": { + "type": "string", + "x-go-name": "Event" + }, + "finished": { + "type": "integer", + "format": "int64", + "x-go-name": "Finished" + }, + "host": { + "type": "string", + "x-go-name": "Host" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "link": { + "type": "string", + "x-go-name": "Link" + }, + "message": { + "type": "string", + "x-go-name": "Message" + }, + "number": { + "type": "integer", + "format": "int64", + "x-go-name": "Number" + }, + "parent": { + "type": "integer", + "format": "int64", + "x-go-name": "Parent" + }, + "ref": { + "type": "string", + "x-go-name": "Ref" + }, + "repo_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RepoID" + }, + "runtime": { + "type": "string", + "x-go-name": "Runtime" + }, + "sender": { + "type": "string", + "x-go-name": "Sender" + }, + "source": { + "type": "string", + "x-go-name": "Source" + }, + "started": { + "type": "integer", + "format": "int64", + "x-go-name": "Started" + }, + "status": { + "type": "string", + "x-go-name": "Status" + }, + "title": { + "type": "string", + "x-go-name": "Title" + } + }, + "x-go-package": "github.com/go-vela/types/library" + }, + "Container": { + "type": "object", + "properties": { + "commands": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Commands" + }, + "detach": { + "type": "boolean", + "x-go-name": "Detach" + }, + "directory": { + "type": "string", + "x-go-name": "Directory" + }, + "entrypoint": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Entrypoint" + }, + "environment": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Environment" + }, + "exit_code": { + "type": "integer", + "format": "int64", + "x-go-name": "ExitCode" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "image": { + "type": "string", + "x-go-name": "Image" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "needs": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Needs" + }, + "networks": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Networks" + }, + "number": { + "type": "integer", + "format": "int64", + "x-go-name": "Number" + }, + "ports": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Ports" + }, + "privileged": { + "type": "boolean", + "x-go-name": "Privileged" + }, + "pull": { + "type": "boolean", + "x-go-name": "Pull" + }, + "ruleset": { + "$ref": "#/definitions/Ruleset" + }, + "secrets": { + "$ref": "#/definitions/StepSecretSlice" + }, + "ulimits": { + "$ref": "#/definitions/UlimitSlice" + }, + "volumes": { + "$ref": "#/definitions/VolumeSlice" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "ContainerSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/Container" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Executor": { + "type": "object", + "title": "Executor is the library representation of an executor for a worker.", + "properties": { + "build": { + "$ref": "#/definitions/Build" + }, + "distribution": { + "type": "string", + "x-go-name": "Distribution" + }, + "host": { + "type": "string", + "x-go-name": "Host" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "pipeline": { + "$ref": "#/definitions/PipelineBuild" + }, + "repo": { + "$ref": "#/definitions/Repo" + }, + "runtime": { + "type": "string", + "x-go-name": "Runtime" + } + }, + "x-go-package": "github.com/go-vela/types/library" + }, + "PipelineBuild": { + "type": "object", + "title": "Build is the pipeline representation of a build for a pipeline.", + "properties": { + "id": { + "type": "string", + "x-go-name": "ID" + }, + "metadata": { + "$ref": "#/definitions/PipelineMetadata" + }, + "secrets": { + "$ref": "#/definitions/SecretSlice" + }, + "services": { + "$ref": "#/definitions/ContainerSlice" + }, + "stages": { + "$ref": "#/definitions/StageSlice" + }, + "steps": { + "$ref": "#/definitions/ContainerSlice" + }, + "version": { + "type": "string", + "x-go-name": "Version" + }, + "worker": { + "$ref": "#/definitions/PipelineWorker" + } + }, + "x-go-name": "Build", + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "PipelineMetadata": { + "type": "object", + "title": "Metadata is the yaml representation of the metadata block for a pipeline.", + "properties": { + "template": { + "type": "boolean", + "x-go-name": "Template" + } + }, + "x-go-name": "Metadata", + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "PipelineWorker": { + "type": "object", + "title": "Worker is the yaml representation of the worker block for a pipeline.", + "properties": { + "flavor": { + "type": "string", + "x-go-name": "Flavor" + }, + "platform": { + "type": "string", + "x-go-name": "Platform" + } + }, + "x-go-name": "Worker", + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Repo": { + "type": "object", + "title": "Repo is the library representation of a repo.", + "properties": { + "active": { + "type": "boolean", + "x-go-name": "Active" + }, + "allow_comment": { + "type": "boolean", + "x-go-name": "AllowComment" + }, + "allow_deploy": { + "type": "boolean", + "x-go-name": "AllowDeploy" + }, + "allow_pull": { + "type": "boolean", + "x-go-name": "AllowPull" + }, + "allow_push": { + "type": "boolean", + "x-go-name": "AllowPush" + }, + "allow_tag": { + "type": "boolean", + "x-go-name": "AllowTag" + }, + "branch": { + "type": "string", + "x-go-name": "Branch" + }, + "clone": { + "type": "string", + "x-go-name": "Clone" + }, + "full_name": { + "type": "string", + "x-go-name": "FullName" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "link": { + "type": "string", + "x-go-name": "Link" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "org": { + "type": "string", + "x-go-name": "Org" + }, + "private": { + "type": "boolean", + "x-go-name": "Private" + }, + "timeout": { + "type": "integer", + "format": "int64", + "x-go-name": "Timeout" + }, + "trusted": { + "type": "boolean", + "x-go-name": "Trusted" + }, + "user_id": { + "type": "integer", + "format": "int64", + "x-go-name": "UserID" + }, + "visibility": { + "type": "string", + "x-go-name": "Visibility" + } + }, + "x-go-package": "github.com/go-vela/types/library" + }, + "Rules": { + "type": "object", + "properties": { + "branch": { + "$ref": "#/definitions/Ruletype" + }, + "comment": { + "$ref": "#/definitions/Ruletype" + }, + "event": { + "$ref": "#/definitions/Ruletype" + }, + "path": { + "$ref": "#/definitions/Ruletype" + }, + "repo": { + "$ref": "#/definitions/Ruletype" + }, + "status": { + "$ref": "#/definitions/Ruletype" + }, + "tag": { + "$ref": "#/definitions/Ruletype" + }, + "target": { + "$ref": "#/definitions/Ruletype" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Ruleset": { + "type": "object", + "properties": { + "continue": { + "type": "boolean", + "x-go-name": "Continue" + }, + "if": { + "$ref": "#/definitions/Rules" + }, + "operator": { + "type": "string", + "x-go-name": "Operator" + }, + "unless": { + "$ref": "#/definitions/Rules" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Ruletype": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Secret": { + "type": "object", + "title": "Secret is the library representation of a secret.", + "properties": { + "engine": { + "type": "string", + "x-go-name": "Engine" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "SecretSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Stage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "needs": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Needs" + }, + "steps": { + "$ref": "#/definitions/ContainerSlice" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "StageSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/Stage" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "StepSecret": { + "type": "object", + "properties": { + "source": { + "type": "string", + "x-go-name": "Source" + }, + "target": { + "type": "string", + "x-go-name": "Target" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "StepSecretSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/StepSecret" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Ulimit": { + "type": "object", + "properties": { + "hard": { + "type": "integer", + "format": "int64", + "x-go-name": "Hard" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "soft": { + "type": "integer", + "format": "int64", + "x-go-name": "Soft" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "UlimitSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/Ulimit" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "Volume": { + "type": "object", + "properties": { + "access_mode": { + "type": "string", + "x-go-name": "AccessMode" + }, + "destination": { + "type": "string", + "x-go-name": "Destination" + }, + "source": { + "type": "string", + "x-go-name": "Source" + } + }, + "x-go-package": "github.com/go-vela/types/pipeline" + }, + "VolumeSlice": { + "type": "array", + "items": { + "$ref": "#/definitions/Volume" + }, + "x-go-package": "github.com/go-vela/types/pipeline" + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file diff --git a/api/build.go b/api/build.go index aa253ef2..1cfa6308 100644 --- a/api/build.go +++ b/api/build.go @@ -14,6 +14,36 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) +// swagger:operation GET /api/v1/executors/{executor}/build build GetBuild +// +// Get the currently running build +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// - in: path +// name: executor +// description: The executor running the build +// required: true +// type: string +// responses: +// '200': +// description: Successfully retrieved the build +// type: json +// schema: +// "$ref": "#/definitions/Build" +// '500': +// description: Unable to retrieve the build +// schema: +// type: string + // GetBuild represents the API handler to capture the // build currently running on an executor. func GetBuild(c *gin.Context) { @@ -31,6 +61,33 @@ func GetBuild(c *gin.Context) { c.JSON(http.StatusOK, build) } +// swagger:operation DELETE /api/v1/executors/{executor}/build/kill build KillBuild +// +// Kill the currently running build +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// - in: path +// name: executor +// description: The executor running the build +// required: true +// type: string +// responses: +// '200': +// description: Successfully killed the build +// type: json +// '500': +// description: Unable to kill the build +// type: json + // KillBuild represents the API handler to kill a // build currently running on an executor. // diff --git a/api/executor.go b/api/executor.go index cde7ba39..99b6f7d6 100644 --- a/api/executor.go +++ b/api/executor.go @@ -16,6 +16,35 @@ import ( exec "github.com/go-vela/worker/router/middleware/executor" ) +// swagger:operation GET /api/v1/executors/{executor} executor GetExecutor +// +// Get a currently running executor +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// - in: path +// name: executor +// description: The executor to retrieve +// required: true +// type: string +// responses: +// '200': +// description: Successfully retrieved the executor +// type: json +// schema: +// "$ref": "#/definitions/Executor" +// '500': +// description: Unable to retrieve the executor +// type: json + // GetExecutor represents the API handler to capture the // executor currently running on a worker. func GetExecutor(c *gin.Context) { @@ -62,6 +91,30 @@ func GetExecutor(c *gin.Context) { c.JSON(http.StatusOK, executor) } +// swagger:operation GET /api/v1/executors executor GetExecutors +// +// Get all currently running executors +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// responses: +// '200': +// description: Successfully retrieved all running executors +// type: json +// schema: +// "$ref": "#/definitions/Executor" +// '500': +// description: Unable to retrieve all running executors +// type: json + // GetExecutors represents the API handler to capture the // executors currently running on a worker. func GetExecutors(c *gin.Context) { diff --git a/api/health.go b/api/health.go index 028a1096..ab81c6f6 100644 --- a/api/health.go +++ b/api/health.go @@ -10,6 +10,21 @@ import ( "github.com/gin-gonic/gin" ) +// swagger:operation GET /health system Health +// +// Check if the worker API is available +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// responses: +// '200': +// description: Successful 'ping' of Vela worker API +// schema: +// type: string + // Health check the status of the application func Health(c *gin.Context) { c.JSON(http.StatusOK, "ok") diff --git a/api/metrics.go b/api/metrics.go index 61d9ffae..929db62a 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -10,6 +10,21 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" ) +// swagger:operation GET /metrics system Metrics +// +// Retrieve metrics from the worker +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// responses: +// '200': +// description: Successful retrieval of worker metrics +// schema: +// type: string + // Metrics returns a Prometheus handler for serving go metrics func Metrics() http.Handler { return promhttp.Handler() diff --git a/api/pipeline.go b/api/pipeline.go index 1b7e0d6f..fdc80767 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -14,6 +14,35 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) +// swagger:operation GET /api/v1/executors/{executor}/pipeline pipeline GetPipeline +// +// Get a currently running pipeline +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// - in: path +// name: executor +// description: The executor running the pipeline +// required: true +// type: string +// responses: +// '200': +// description: Successfully retrieved the pipeline +// type: json +// schema: +// "$ref": "#/definitions/PipelineBuild" +// '500': +// description: Unable to retrieve the pipeline +// type: json + // GetPipeline represents the API handler to capture the // pipeline currently running on an executor. func GetPipeline(c *gin.Context) { diff --git a/api/repo.go b/api/repo.go index de9b5c29..2d603347 100644 --- a/api/repo.go +++ b/api/repo.go @@ -14,6 +14,35 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) +// swagger:operation GET /api/v1/executors/{executor}/repo repo GetRepo +// +// Get a currently running repo +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// - in: path +// name: executor +// description: The executor running the build +// required: true +// type: string +// responses: +// '200': +// description: Successfully retrieved the repo +// type: json +// schema: +// "$ref": "#/definitions/Repo" +// '500': +// description: Unable to retrieve the repo +// type: json + // GetRepo represents the API handler to capture the // repo currently running on an executor. func GetRepo(c *gin.Context) { diff --git a/api/shutdown.go b/api/shutdown.go index a1a613d6..8f1ff2ff 100644 --- a/api/shutdown.go +++ b/api/shutdown.go @@ -10,6 +10,26 @@ import ( "github.com/gin-gonic/gin" ) +// swagger:operation POST /api/v1/shutdown system Shutdown +// +// Perform a soft shutdown of the worker +// +// --- +// x-success_http_code: '501' +// produces: +// - application/json +// parameters: +// - in: header +// name: Authorization +// description: Vela server token +// required: true +// type: string +// responses: +// '501': +// description: Endpoint is not yet implemented +// schema: +// type: string + // Shutdown represents the API handler to shutdown a // executors currently running on an worker. // diff --git a/go.mod b/go.mod index 263db29e..cfbbce70 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/go-vela/pkg-queue v0.4.3 github.com/go-vela/pkg-runtime v0.4.3 github.com/go-vela/sdk-go v0.4.3 - github.com/go-vela/types v0.4.3 + github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3 github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/gnostic v0.3.1 // indirect github.com/imdario/mergo v0.3.9 // indirect diff --git a/go.sum b/go.sum index 37487871..a0c18bf7 100644 --- a/go.sum +++ b/go.sum @@ -137,6 +137,8 @@ github.com/go-vela/sdk-go v0.4.3 h1:+mfDcwSCLlM2tn1HIq1jOgJnJ2nkoaucWd5wTgfddsM= github.com/go-vela/sdk-go v0.4.3/go.mod h1:rhbY07rm6SaesHzzvS5SvWYDFGbGi4ESnB2frVhENwk= github.com/go-vela/types v0.4.3 h1:AMAbCyaoLCPAlxgae4myCKJQq1xIvc9hy+nCEL6l/+E= github.com/go-vela/types v0.4.3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= +github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3 h1:dGM6xwFBd4ZnVi6wwul1dTP3S5w9SF1eklhQoIjlcIg= +github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -243,6 +245,7 @@ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= diff --git a/router/router.go b/router/router.go index b47403fc..5bf0f384 100644 --- a/router/router.go +++ b/router/router.go @@ -2,6 +2,27 @@ // // Use of this source code is governed by the LICENSE file in this repository. +// Package router Vela worker +// +// API for a Vela worker +// +// Version: 0.4.3 +// Schemes: http, https +// BasePath: "" +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// SecurityDefinitions: +// ApiKeyAuth: +// type: apiKey +// in: header +// name: Authorization +// +// swagger:meta package router import ( From bc9aa0101e6c3450f3f11c0a09b9a4e290a3d30c Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 10 Jul 2020 07:20:45 -0500 Subject: [PATCH 105/430] fix(queue): update route flag to be correct flag (#100) --- cmd/vela-worker/run.go | 2 +- docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index a22401e5..40dea424 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -102,7 +102,7 @@ func run(c *cli.Context) error { Driver: c.String("queue.driver"), Config: c.String("queue.config"), Cluster: c.Bool("queue.cluster"), - Routes: c.StringSlice("queue.routes"), + Routes: c.StringSlice("queue.worker.routes"), }, // server configuration Server: &Server{ diff --git a/docker-compose.yml b/docker-compose.yml index 4bb57815..c4fadd03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 - VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker + VELA_QUEUE_WORKER_ROUTES: large,docker,large:docker VELA_RUNTIME_DRIVER: docker VELA_SERVER_ADDR: http://vela:8080 VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh @@ -39,7 +39,7 @@ services: VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis VELA_QUEUE_CONFIG: redis://redis:6379 - VELA_QUEUE_WORKER_ROUTES: larger,docker,large:docker + VELA_QUEUE_WORKER_ROUTES: small,docker,small:docker VELA_RUNTIME_DRIVER: docker VELA_SERVER_ADDR: http://vela:8080 VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh From 40c4ac0c460a3efce032d4c4a9a6762c187947c6 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Tue, 28 Jul 2020 12:31:09 -0500 Subject: [PATCH 106/430] fix: capture executor index before creating routine (#101) --- cmd/vela-worker/operate.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 773dd689..74db765a 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -39,10 +39,15 @@ func (w *Worker) operate() error { // iterate till the configured build limit for i := 0; i < w.Config.Build.Limit; i++ { + // evaluate and capture i at each iteration + // + // https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables + id := i + // log a message indicating the start of an operator thread // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info - logrus.Infof("Thread ID %d listening to queue...", i) + logrus.Infof("Thread ID %d listening to queue...", id) // spawn errgroup routine for operator subprocess // @@ -51,7 +56,7 @@ func (w *Worker) operate() error { // create an infinite loop to poll for builds for { // exec operator subprocess to poll and execute builds - err = w.exec(i) + err = w.exec(id) if err != nil { // log the error received from the executor // From 56030c7b2c6d34eed39a565653f850671e7f136a Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 31 Jul 2020 11:21:57 -0500 Subject: [PATCH 107/430] chore: update operator for new executor function (#102) * chore: update operator for new executor function * fix: go mod tify --- cmd/vela-worker/exec.go | 8 ++++++++ docker-compose.yml | 2 ++ go.mod | 23 +++-------------------- go.sum | 27 +++++++++++++++++++++++---- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 63290c33..0fc43e54 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -127,6 +127,14 @@ func (w *Worker) exec(index int) error { return err } + logger.Info("assembling build") + // assemble the build with the executor + err = _executor.AssembleBuild(ctx) + if err != nil { + logger.Errorf("unable to assemble build: %v", err) + return err + } + logger.Info("executing build") // execute the build with the executor err = _executor.ExecBuild(ctx) diff --git a/docker-compose.yml b/docker-compose.yml index c4fadd03..87ab131c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,8 @@ services: - "/var/run/docker.sock:/var/run/docker.sock" worker_2: + build: + context: . container_name: worker_2 image: worker:local networks: diff --git a/go.mod b/go.mod index cfbbce70..3b531493 100644 --- a/go.mod +++ b/go.mod @@ -5,36 +5,19 @@ go 1.13 require ( github.com/alicebob/miniredis/v2 v2.13.0 // indirect github.com/coreos/go-semver v0.3.0 - github.com/evanphx/json-patch v4.5.0+incompatible // indirect github.com/gin-gonic/gin v1.6.3 - github.com/go-playground/validator/v10 v10.3.0 // indirect github.com/go-redis/redis v6.15.8+incompatible // indirect - github.com/go-vela/pkg-executor v0.4.3 + github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99 github.com/go-vela/pkg-queue v0.4.3 - github.com/go-vela/pkg-runtime v0.4.3 + github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e github.com/go-vela/sdk-go v0.4.3 - github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3 - github.com/google/gofuzz v1.1.0 // indirect - github.com/googleapis/gnostic v0.3.1 // indirect - github.com/imdario/mergo v0.3.9 // indirect + github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f github.com/joho/godotenv v1.3.0 - github.com/kr/pretty v0.2.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 github.com/urfave/cli/v2 v2.2.0 github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e // indirect - golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect - golang.org/x/text v0.3.3 // indirect - golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect - google.golang.org/appengine v1.6.6 // indirect google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 // indirect - google.golang.org/grpc v1.30.0 // indirect - google.golang.org/protobuf v1.25.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 - k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index a0c18bf7..d6fc3154 100644 --- a/go.sum +++ b/go.sum @@ -15,15 +15,20 @@ github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABb github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -125,20 +130,25 @@ github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJ github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.4.3/go.mod h1:icFuaC+TsCdZBLajFW3qGtpL9nEc0WDAu3vvBSnY8ds= +github.com/go-vela/compiler v0.4.4-0.20200720153325-9655e65766b1 h1:G5jAxA90rJuHnZDD7xpxwkCIbeR+WKYjuIExWOgy6Xg= +github.com/go-vela/compiler v0.4.4-0.20200720153325-9655e65766b1/go.mod h1:N/SQ374MNpRcEBZo2aR/PCtATWf14bTK+xdXTi0fwU0= github.com/go-vela/mock v0.4.3 h1:Ts60thJEd8lkrC7ulvSxoT8p0sL+/38DtwiAB0XI1y8= github.com/go-vela/mock v0.4.3/go.mod h1:0jefMm79gmAiHt2vlYwHrZX3TUeHK8ktQzGgM2Tvi9M= -github.com/go-vela/pkg-executor v0.4.3 h1:hdcbfx5Ermy21dwgKGZieyjZHjiG9h8X6MpCS+DD1aI= -github.com/go-vela/pkg-executor v0.4.3/go.mod h1:MOaXHpre7chBHSAfK2jx9dvtgSe/hq7gqV9jxsM9K4A= +github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99 h1:hJUxi8W+86/WlWAuHOxsw3IcHFAlAJ1hzc54I021GGk= +github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99/go.mod h1:blSMRD6W3A1TDlLS28xu6ZrBSiTrT1ogirhoNVyN2Xk= github.com/go-vela/pkg-queue v0.4.3 h1:GsyL/OG0Dket7V2hovebHFAwLqYvqycTIpwFJMSz1PQ= github.com/go-vela/pkg-queue v0.4.3/go.mod h1:FC1cSRFEK2vpOaZlQ8kUVDLFczMAwwid6r6EqJ6tB7w= github.com/go-vela/pkg-runtime v0.4.3 h1:BcBTNv41A0PSDIKlxHSzRuCLuNUSZPl3LYRSxKrN9GY= github.com/go-vela/pkg-runtime v0.4.3/go.mod h1:YuQmn2Tal43HjNfPT07rcmsVJrnNP29R8J5hCVh+YPg= +github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e h1:Uzkwk/Q2muKGJ1KCIkcH2TFDHmTdb3yKOe3p/9UVE9A= +github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e/go.mod h1:r0krckZKqt8L8I5cVLAc0o9H37SFfXIJJkeWmxgZ/SM= github.com/go-vela/sdk-go v0.4.3 h1:+mfDcwSCLlM2tn1HIq1jOgJnJ2nkoaucWd5wTgfddsM= github.com/go-vela/sdk-go v0.4.3/go.mod h1:rhbY07rm6SaesHzzvS5SvWYDFGbGi4ESnB2frVhENwk= github.com/go-vela/types v0.4.3 h1:AMAbCyaoLCPAlxgae4myCKJQq1xIvc9hy+nCEL6l/+E= github.com/go-vela/types v0.4.3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= -github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3 h1:dGM6xwFBd4ZnVi6wwul1dTP3S5w9SF1eklhQoIjlcIg= -github.com/go-vela/types v0.4.4-0.20200701160310-e2e65c6d26d3/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= +github.com/go-vela/types v0.4.4-0.20200720135309-f00b29c3308f/go.mod h1:4gKeR30R3RUTi3piFZr5BQkj0MeVr0GF76Ohe7nFMto= +github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f h1:vGjc6XVDxoalcEQlaQ/JTWvH6MRtOjFIlvcvrtXVSEY= +github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f/go.mod h1:4gKeR30R3RUTi3piFZr5BQkj0MeVr0GF76Ohe7nFMto= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -177,7 +187,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -198,6 +210,7 @@ github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1a github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -205,6 +218,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -257,8 +272,10 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -276,6 +293,7 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -471,6 +489,7 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200701001935-0939c5918c31/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 h1:4BC1C1i30F3MZeiIO6y6IIo4DxrtOwITK87bQl3lhFA= google.golang.org/genproto v0.0.0-20200702021140-07506425bd67/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From 2b243918e76efdfba0ab62d12e66ddb708b3dbce Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 31 Jul 2020 11:38:42 -0500 Subject: [PATCH 108/430] chore: update go mod for v0.5.0-rc1 (#103) --- go.mod | 14 ++--- go.sum | 97 ++++++-------------------------- router/middleware/header_test.go | 8 +-- version/version.go | 4 +- 4 files changed, 28 insertions(+), 95 deletions(-) diff --git a/go.mod b/go.mod index 3b531493..d7313f6b 100644 --- a/go.mod +++ b/go.mod @@ -3,21 +3,17 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/alicebob/miniredis/v2 v2.13.0 // indirect github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-redis/redis v6.15.8+incompatible // indirect - github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99 - github.com/go-vela/pkg-queue v0.4.3 - github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e - github.com/go-vela/sdk-go v0.4.3 - github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f + github.com/go-vela/pkg-executor v0.5.0-rc1 + github.com/go-vela/pkg-queue v0.5.0-rc1 + github.com/go-vela/pkg-runtime v0.5.0-rc1 + github.com/go-vela/sdk-go v0.5.0-rc1 + github.com/go-vela/types v0.5.0-rc1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 github.com/urfave/cli/v2 v2.2.0 - github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e // indirect golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index d6fc3154..41e51506 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,6 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.11.4 h1:GsuyeunTx7EllZBU3/6Ji3dhMQZDpC9rLf1luJ+6M5M= -github.com/alicebob/miniredis/v2 v2.11.4/go.mod h1:VL3UDEfAH59bSa7MuHMuFToxkqyHh69s/WUbYlOAuyg= github.com/alicebob/miniredis/v2 v2.13.0 h1:QPosMaxm+r6Qs+YcCtL2Z2a2RSdC9VfXJLpd80l8ICU= github.com/alicebob/miniredis/v2 v2.13.0/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -97,8 +95,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -112,43 +108,31 @@ github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nA github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= -github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.4.3/go.mod h1:icFuaC+TsCdZBLajFW3qGtpL9nEc0WDAu3vvBSnY8ds= -github.com/go-vela/compiler v0.4.4-0.20200720153325-9655e65766b1 h1:G5jAxA90rJuHnZDD7xpxwkCIbeR+WKYjuIExWOgy6Xg= -github.com/go-vela/compiler v0.4.4-0.20200720153325-9655e65766b1/go.mod h1:N/SQ374MNpRcEBZo2aR/PCtATWf14bTK+xdXTi0fwU0= -github.com/go-vela/mock v0.4.3 h1:Ts60thJEd8lkrC7ulvSxoT8p0sL+/38DtwiAB0XI1y8= -github.com/go-vela/mock v0.4.3/go.mod h1:0jefMm79gmAiHt2vlYwHrZX3TUeHK8ktQzGgM2Tvi9M= -github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99 h1:hJUxi8W+86/WlWAuHOxsw3IcHFAlAJ1hzc54I021GGk= -github.com/go-vela/pkg-executor v0.4.4-0.20200720202642-c6ea13b7dd99/go.mod h1:blSMRD6W3A1TDlLS28xu6ZrBSiTrT1ogirhoNVyN2Xk= -github.com/go-vela/pkg-queue v0.4.3 h1:GsyL/OG0Dket7V2hovebHFAwLqYvqycTIpwFJMSz1PQ= -github.com/go-vela/pkg-queue v0.4.3/go.mod h1:FC1cSRFEK2vpOaZlQ8kUVDLFczMAwwid6r6EqJ6tB7w= -github.com/go-vela/pkg-runtime v0.4.3 h1:BcBTNv41A0PSDIKlxHSzRuCLuNUSZPl3LYRSxKrN9GY= -github.com/go-vela/pkg-runtime v0.4.3/go.mod h1:YuQmn2Tal43HjNfPT07rcmsVJrnNP29R8J5hCVh+YPg= -github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e h1:Uzkwk/Q2muKGJ1KCIkcH2TFDHmTdb3yKOe3p/9UVE9A= -github.com/go-vela/pkg-runtime v0.4.4-0.20200729200936-9c8fde257f3e/go.mod h1:r0krckZKqt8L8I5cVLAc0o9H37SFfXIJJkeWmxgZ/SM= -github.com/go-vela/sdk-go v0.4.3 h1:+mfDcwSCLlM2tn1HIq1jOgJnJ2nkoaucWd5wTgfddsM= -github.com/go-vela/sdk-go v0.4.3/go.mod h1:rhbY07rm6SaesHzzvS5SvWYDFGbGi4ESnB2frVhENwk= -github.com/go-vela/types v0.4.3 h1:AMAbCyaoLCPAlxgae4myCKJQq1xIvc9hy+nCEL6l/+E= -github.com/go-vela/types v0.4.3/go.mod h1:ig7fC+MKGsgAlKqovkFsUQlbZtLDLhl/djiedHmsL5s= -github.com/go-vela/types v0.4.4-0.20200720135309-f00b29c3308f/go.mod h1:4gKeR30R3RUTi3piFZr5BQkj0MeVr0GF76Ohe7nFMto= -github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f h1:vGjc6XVDxoalcEQlaQ/JTWvH6MRtOjFIlvcvrtXVSEY= -github.com/go-vela/types v0.4.4-0.20200722113135-2251403bba7f/go.mod h1:4gKeR30R3RUTi3piFZr5BQkj0MeVr0GF76Ohe7nFMto= +github.com/go-vela/compiler v0.5.0-rc1 h1:/NZrlAkJmE58VMLQyb4xCTG1Q0frEvWbZT4Er28QTRU= +github.com/go-vela/compiler v0.5.0-rc1/go.mod h1:vGA0cNBgAB+/vsUj6y5q7E+TAP6TI1+hFygePqcDuIU= +github.com/go-vela/mock v0.5.0-rc1 h1:4dG4MDtcRuzBegznvEST+22/2Ij8vSMQw7nEDiwJOjk= +github.com/go-vela/mock v0.5.0-rc1/go.mod h1:Zq9yCy8g1u5lmC6dBUzj5EFp3cmZx5O/ydHFxWmil1E= +github.com/go-vela/pkg-executor v0.5.0-rc1 h1:pCLcFhD3ODOw29m+Rsz4e62h4dOuqgnmIGDS2fj4CsQ= +github.com/go-vela/pkg-executor v0.5.0-rc1/go.mod h1:hLQtGe647nqIImcZN4n5OaF5TplgP7n3V0eWGyP5FKw= +github.com/go-vela/pkg-queue v0.5.0-rc1 h1:7q7SaCvpK6daFqwYxFe+qHHhtMj84c3RjyucqDkGo5s= +github.com/go-vela/pkg-queue v0.5.0-rc1/go.mod h1:X8rp1/XXtEwzEsI7u+B4hrDgQLFa95AoBbQjHr7lx6g= +github.com/go-vela/pkg-runtime v0.5.0-rc1 h1:+xQ18bW/a3X2jkA6VfRBscn0cOKpBlWnBlf5Mqv/kYo= +github.com/go-vela/pkg-runtime v0.5.0-rc1/go.mod h1:M+4ilay3XMMUgEL86flgGRT08/ul8ojbYn3m0jbowA8= +github.com/go-vela/sdk-go v0.5.0-rc1 h1:v8GtUtL08y6Gx81bY2oYskaMSqyEcJNYqvR5xn7tdZA= +github.com/go-vela/sdk-go v0.5.0-rc1/go.mod h1:BKyGRqJZGPEzRQL5aSVGxZLRF2CSI3QcfeW8wUwRlks= +github.com/go-vela/types v0.5.0-rc1 h1:klHH5hYGb6JU+01gJxCgSe6d6DxxeU3FSpd9VjeLXNM= +github.com/go-vela/types v0.5.0-rc1/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -217,20 +201,15 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -242,8 +221,6 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -254,20 +231,12 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -292,7 +261,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= @@ -302,8 +270,6 @@ github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -342,8 +308,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= -github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -379,8 +343,6 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -401,15 +363,11 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -433,14 +391,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -477,8 +429,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= @@ -486,9 +436,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f h1:naitw5DILWPQvG0oG04mR9jF8fmKpRdW3E3zzKA4D0Y= -google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200701001935-0939c5918c31/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 h1:4BC1C1i30F3MZeiIO6y6IIo4DxrtOwITK87bQl3lhFA= google.golang.org/genproto v0.0.0-20200702021140-07506425bd67/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -497,8 +446,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -521,16 +468,10 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8CTwkU4pnOs= -gopkg.in/go-playground/validator.v9 v9.30.2/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/square/go-jose.v2 v2.4.1 h1:H0TmLt7/KmzlrDOpa1F+zr0Tk90PbJYBfsVUmRLrf9Y= -gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= @@ -540,8 +481,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= @@ -568,8 +507,6 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= -k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 h1:7Nu2dTj82c6IaWvL7hImJzcXoTPz1MsSCH7r+0m6rfo= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 1e7c7c89..92e0a72d 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.4.3" + wantVersion := "0.5.0" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.3" + wantVersion := "0.5.0" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.4.3" + wantVersion := "0.5.0" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.4.3" + wantVersion := "0.5.0" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index 597a2731..fe6511ee 100644 --- a/version/version.go +++ b/version/version.go @@ -10,9 +10,9 @@ var ( // VersionMajor is for an API incompatible changes VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor int64 = 4 + VersionMinor int64 = 5 // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 = 3 + VersionPatch int64 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From b454fadd2d3a6d348fbc6a909a94cc9cb0329699 Mon Sep 17 00:00:00 2001 From: Neal Date: Tue, 4 Aug 2020 09:47:07 -0500 Subject: [PATCH 109/430] chore: update go packages for v0.5.0-rc2 (#104) --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index d7313f6b..35418843 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.0-rc1 + github.com/go-vela/pkg-executor v0.5.0-rc2 github.com/go-vela/pkg-queue v0.5.0-rc1 github.com/go-vela/pkg-runtime v0.5.0-rc1 github.com/go-vela/sdk-go v0.5.0-rc1 - github.com/go-vela/types v0.5.0-rc1 + github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 41e51506..108e9365 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/go-vela/compiler v0.5.0-rc1 h1:/NZrlAkJmE58VMLQyb4xCTG1Q0frEvWbZT4Er2 github.com/go-vela/compiler v0.5.0-rc1/go.mod h1:vGA0cNBgAB+/vsUj6y5q7E+TAP6TI1+hFygePqcDuIU= github.com/go-vela/mock v0.5.0-rc1 h1:4dG4MDtcRuzBegznvEST+22/2Ij8vSMQw7nEDiwJOjk= github.com/go-vela/mock v0.5.0-rc1/go.mod h1:Zq9yCy8g1u5lmC6dBUzj5EFp3cmZx5O/ydHFxWmil1E= -github.com/go-vela/pkg-executor v0.5.0-rc1 h1:pCLcFhD3ODOw29m+Rsz4e62h4dOuqgnmIGDS2fj4CsQ= -github.com/go-vela/pkg-executor v0.5.0-rc1/go.mod h1:hLQtGe647nqIImcZN4n5OaF5TplgP7n3V0eWGyP5FKw= +github.com/go-vela/pkg-executor v0.5.0-rc2 h1:fB935EuZYD2nBMAJjL0OOnRVCTOUCY2d7JID+EdJcfg= +github.com/go-vela/pkg-executor v0.5.0-rc2/go.mod h1:1T3RoK0E8YQ9hpypLDuCexXYD3QZiKo1XvKEtgdHmnc= github.com/go-vela/pkg-queue v0.5.0-rc1 h1:7q7SaCvpK6daFqwYxFe+qHHhtMj84c3RjyucqDkGo5s= github.com/go-vela/pkg-queue v0.5.0-rc1/go.mod h1:X8rp1/XXtEwzEsI7u+B4hrDgQLFa95AoBbQjHr7lx6g= github.com/go-vela/pkg-runtime v0.5.0-rc1 h1:+xQ18bW/a3X2jkA6VfRBscn0cOKpBlWnBlf5Mqv/kYo= @@ -133,6 +133,8 @@ github.com/go-vela/sdk-go v0.5.0-rc1 h1:v8GtUtL08y6Gx81bY2oYskaMSqyEcJNYqvR5xn7t github.com/go-vela/sdk-go v0.5.0-rc1/go.mod h1:BKyGRqJZGPEzRQL5aSVGxZLRF2CSI3QcfeW8wUwRlks= github.com/go-vela/types v0.5.0-rc1 h1:klHH5hYGb6JU+01gJxCgSe6d6DxxeU3FSpd9VjeLXNM= github.com/go-vela/types v0.5.0-rc1/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= +github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d h1:UslLlfg9F7YcP5QSSRbgT3uq5P5p+GYuVPwZSpvzTjg= +github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 6d1d90a4102d6bac8a84faf775382e5482219a69 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 7 Aug 2020 12:14:10 -0500 Subject: [PATCH 110/430] chore: update go-vela dependencies for host volumes (#105) * chore: update go-vela dependencies for host volumes * feature: set runtime volumes via flag --- cmd/vela-worker/run.go | 1 + go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 40dea424..964fdf6e 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -96,6 +96,7 @@ func run(c *cli.Context) error { Driver: c.String("runtime.driver"), Config: c.String("runtime.config"), Namespace: c.String("runtime.namespace"), + Volumes: c.StringSlice("runtime.volumes"), }, // queue configuration Queue: &queue.Setup{ diff --git a/go.mod b/go.mod index 35418843..fc0d33c2 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.0-rc2 + github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad github.com/go-vela/pkg-queue v0.5.0-rc1 - github.com/go-vela/pkg-runtime v0.5.0-rc1 + github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 github.com/go-vela/sdk-go v0.5.0-rc1 github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d github.com/joho/godotenv v1.3.0 diff --git a/go.sum b/go.sum index 108e9365..39e62740 100644 --- a/go.sum +++ b/go.sum @@ -123,12 +123,12 @@ github.com/go-vela/compiler v0.5.0-rc1 h1:/NZrlAkJmE58VMLQyb4xCTG1Q0frEvWbZT4Er2 github.com/go-vela/compiler v0.5.0-rc1/go.mod h1:vGA0cNBgAB+/vsUj6y5q7E+TAP6TI1+hFygePqcDuIU= github.com/go-vela/mock v0.5.0-rc1 h1:4dG4MDtcRuzBegznvEST+22/2Ij8vSMQw7nEDiwJOjk= github.com/go-vela/mock v0.5.0-rc1/go.mod h1:Zq9yCy8g1u5lmC6dBUzj5EFp3cmZx5O/ydHFxWmil1E= -github.com/go-vela/pkg-executor v0.5.0-rc2 h1:fB935EuZYD2nBMAJjL0OOnRVCTOUCY2d7JID+EdJcfg= -github.com/go-vela/pkg-executor v0.5.0-rc2/go.mod h1:1T3RoK0E8YQ9hpypLDuCexXYD3QZiKo1XvKEtgdHmnc= +github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad h1:JNafqFW6Um+4eq6n7Pc9lyyLYVUGCjSU3fJbGMF0vVo= +github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad/go.mod h1:L/+ULMru26Xe0thpExk2cLjwWpDbyMPhysJ6DLt6OuE= github.com/go-vela/pkg-queue v0.5.0-rc1 h1:7q7SaCvpK6daFqwYxFe+qHHhtMj84c3RjyucqDkGo5s= github.com/go-vela/pkg-queue v0.5.0-rc1/go.mod h1:X8rp1/XXtEwzEsI7u+B4hrDgQLFa95AoBbQjHr7lx6g= -github.com/go-vela/pkg-runtime v0.5.0-rc1 h1:+xQ18bW/a3X2jkA6VfRBscn0cOKpBlWnBlf5Mqv/kYo= -github.com/go-vela/pkg-runtime v0.5.0-rc1/go.mod h1:M+4ilay3XMMUgEL86flgGRT08/ul8ojbYn3m0jbowA8= +github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 h1:OFm0Ez4m8qaYjA2J8IZd77XrQRa2sN8TeKWjjc0nY7g= +github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396/go.mod h1:M+4ilay3XMMUgEL86flgGRT08/ul8ojbYn3m0jbowA8= github.com/go-vela/sdk-go v0.5.0-rc1 h1:v8GtUtL08y6Gx81bY2oYskaMSqyEcJNYqvR5xn7tdZA= github.com/go-vela/sdk-go v0.5.0-rc1/go.mod h1:BKyGRqJZGPEzRQL5aSVGxZLRF2CSI3QcfeW8wUwRlks= github.com/go-vela/types v0.5.0-rc1 h1:klHH5hYGb6JU+01gJxCgSe6d6DxxeU3FSpd9VjeLXNM= From b9f0375659f51f7de7ec76bef8bbb353b1038d8a Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 10 Aug 2020 07:54:54 -0500 Subject: [PATCH 111/430] chore: update go-vela/pkg-executor for build status (#106) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fc0d33c2..09092661 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad + github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158 github.com/go-vela/pkg-queue v0.5.0-rc1 github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 github.com/go-vela/sdk-go v0.5.0-rc1 diff --git a/go.sum b/go.sum index 39e62740..5d4530d8 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/go-vela/compiler v0.5.0-rc1 h1:/NZrlAkJmE58VMLQyb4xCTG1Q0frEvWbZT4Er2 github.com/go-vela/compiler v0.5.0-rc1/go.mod h1:vGA0cNBgAB+/vsUj6y5q7E+TAP6TI1+hFygePqcDuIU= github.com/go-vela/mock v0.5.0-rc1 h1:4dG4MDtcRuzBegznvEST+22/2Ij8vSMQw7nEDiwJOjk= github.com/go-vela/mock v0.5.0-rc1/go.mod h1:Zq9yCy8g1u5lmC6dBUzj5EFp3cmZx5O/ydHFxWmil1E= -github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad h1:JNafqFW6Um+4eq6n7Pc9lyyLYVUGCjSU3fJbGMF0vVo= -github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200806134745-5f693c71b3ad/go.mod h1:L/+ULMru26Xe0thpExk2cLjwWpDbyMPhysJ6DLt6OuE= +github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158 h1:Vv9tuZhze50+84w/HO1PRJn94RuH256YDHxr/6g/7Dg= +github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158/go.mod h1:L/+ULMru26Xe0thpExk2cLjwWpDbyMPhysJ6DLt6OuE= github.com/go-vela/pkg-queue v0.5.0-rc1 h1:7q7SaCvpK6daFqwYxFe+qHHhtMj84c3RjyucqDkGo5s= github.com/go-vela/pkg-queue v0.5.0-rc1/go.mod h1:X8rp1/XXtEwzEsI7u+B4hrDgQLFa95AoBbQjHr7lx6g= github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 h1:OFm0Ez4m8qaYjA2J8IZd77XrQRa2sN8TeKWjjc0nY7g= From 63e46d590eee576cb7cc0df88f9d4055dbd5801a Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Wed, 12 Aug 2020 12:10:43 -0500 Subject: [PATCH 112/430] chore: bump dependencies (#107) --- go.mod | 10 +++++----- go.sum | 56 +++++++++++++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 09092661..6ee4752e 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158 - github.com/go-vela/pkg-queue v0.5.0-rc1 - github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 - github.com/go-vela/sdk-go v0.5.0-rc1 - github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d + github.com/go-vela/pkg-executor v0.5.0 + github.com/go-vela/pkg-queue v0.5.0 + github.com/go-vela/pkg-runtime v0.5.0 + github.com/go-vela/sdk-go v0.5.0 + github.com/go-vela/types v0.5.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 5d4530d8..23cc036b 100644 --- a/go.sum +++ b/go.sum @@ -119,22 +119,20 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.5.0-rc1 h1:/NZrlAkJmE58VMLQyb4xCTG1Q0frEvWbZT4Er28QTRU= -github.com/go-vela/compiler v0.5.0-rc1/go.mod h1:vGA0cNBgAB+/vsUj6y5q7E+TAP6TI1+hFygePqcDuIU= -github.com/go-vela/mock v0.5.0-rc1 h1:4dG4MDtcRuzBegznvEST+22/2Ij8vSMQw7nEDiwJOjk= -github.com/go-vela/mock v0.5.0-rc1/go.mod h1:Zq9yCy8g1u5lmC6dBUzj5EFp3cmZx5O/ydHFxWmil1E= -github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158 h1:Vv9tuZhze50+84w/HO1PRJn94RuH256YDHxr/6g/7Dg= -github.com/go-vela/pkg-executor v0.5.0-rc2.0.20200807195057-93843a53a158/go.mod h1:L/+ULMru26Xe0thpExk2cLjwWpDbyMPhysJ6DLt6OuE= -github.com/go-vela/pkg-queue v0.5.0-rc1 h1:7q7SaCvpK6daFqwYxFe+qHHhtMj84c3RjyucqDkGo5s= -github.com/go-vela/pkg-queue v0.5.0-rc1/go.mod h1:X8rp1/XXtEwzEsI7u+B4hrDgQLFa95AoBbQjHr7lx6g= -github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396 h1:OFm0Ez4m8qaYjA2J8IZd77XrQRa2sN8TeKWjjc0nY7g= -github.com/go-vela/pkg-runtime v0.5.0-rc1.0.20200805191211-be84584fb396/go.mod h1:M+4ilay3XMMUgEL86flgGRT08/ul8ojbYn3m0jbowA8= -github.com/go-vela/sdk-go v0.5.0-rc1 h1:v8GtUtL08y6Gx81bY2oYskaMSqyEcJNYqvR5xn7tdZA= -github.com/go-vela/sdk-go v0.5.0-rc1/go.mod h1:BKyGRqJZGPEzRQL5aSVGxZLRF2CSI3QcfeW8wUwRlks= -github.com/go-vela/types v0.5.0-rc1 h1:klHH5hYGb6JU+01gJxCgSe6d6DxxeU3FSpd9VjeLXNM= -github.com/go-vela/types v0.5.0-rc1/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= -github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d h1:UslLlfg9F7YcP5QSSRbgT3uq5P5p+GYuVPwZSpvzTjg= -github.com/go-vela/types v0.5.0-rc1.0.20200803141719-70581652958d/go.mod h1:qh+elSsJ5TrUItJw+HoEHfOUWs0lqkJuABuSTgp7fZQ= +github.com/go-vela/compiler v0.5.0 h1:Gbi84v+Z4X9RskhalXAzsqmuAmbLpYxyShtSqvY8zrw= +github.com/go-vela/compiler v0.5.0/go.mod h1:TJq4UwuW+I1RpcGqP3lkwCtch9KlGIzX32KJDgtKOkU= +github.com/go-vela/mock v0.5.0 h1:JkLW5BilpLEQNfSiVAa/xtoZfFg2LG2P/3fPZxYoWDk= +github.com/go-vela/mock v0.5.0/go.mod h1:8vbEQhRmEhe/p3RF3PrhIhnFFJUbSJrtLTnlY8yB+fY= +github.com/go-vela/pkg-executor v0.5.0 h1:YDIvHDyFYwP/j399DtgEkbE3S/Gye4ZBqIls/m/mnt4= +github.com/go-vela/pkg-executor v0.5.0/go.mod h1:bkZqGHYNnPEzKpT6FUp1BVty4zaDNjv/ggG3fsjodxo= +github.com/go-vela/pkg-queue v0.5.0 h1:gWOYEFGdqr0GMv/zrd3+otNU7un7xnXntyGZ3nxntl4= +github.com/go-vela/pkg-queue v0.5.0/go.mod h1:T4eE71HrC7sZ1ZmvWvJJ80iEu9VGp/ZdGVXq4rzy0Hw= +github.com/go-vela/pkg-runtime v0.5.0 h1:AKOKrNWxeGI0xb1xziyrTboK4J52OV6gDQjBJwm53C0= +github.com/go-vela/pkg-runtime v0.5.0/go.mod h1:YJ16RHGFmfd9xyq9Z3BpomOVQvxfsXwqUVPnrJbPhqw= +github.com/go-vela/sdk-go v0.5.0 h1:RieSkHu0CvdvWsR96HLz56DIqjxtehevr7Ui8dkgdq4= +github.com/go-vela/sdk-go v0.5.0/go.mod h1:pfsTNUBE1xXO4/sdEx4cIl8rw49agL4ptCzhgOj2O/M= +github.com/go-vela/types v0.5.0 h1:f89RiP21e+5QuLeugyhOXIOF+oEPJLndX7lkE5tNOjQ= +github.com/go-vela/types v0.5.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -206,8 +204,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -235,7 +233,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -347,6 +345,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -365,8 +365,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -399,8 +399,8 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns= +golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -439,17 +439,15 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200701001935-0939c5918c31/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200702021140-07506425bd67 h1:4BC1C1i30F3MZeiIO6y6IIo4DxrtOwITK87bQl3lhFA= -google.golang.org/genproto v0.0.0-20200702021140-07506425bd67/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200808173500-a06252235341 h1:Kceb+1TNS2X7Cj/A+IUTljNerF/4wOFjlFJ0RGHYKKE= +google.golang.org/genproto v0.0.0-20200808173500-a06252235341/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 3d41be5dd2bcf7b4fafcbc2a4b1b64a6895517ff Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Tue, 18 Aug 2020 11:15:58 -0500 Subject: [PATCH 113/430] refactor: rename KillBuild to CancelBuild (#108) * rename /kill to /cancel * Change executor.KillBuild to Cancel * go mod tidy * refactor: change remaining references to kill to cancel * update api-spec version to match release * fix: resolve typos --- ...ker-v0.4.3.json => vela-worker-v0.5.0.json} | 10 +++++----- api/build.go | 18 +++++++++--------- go.mod | 2 +- go.sum | 4 ++-- router/build.go | 6 +++--- router/build_test.go | 6 +++--- router/executor.go | 2 +- router/executor_test.go | 6 +++--- router/router_test.go | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) rename api-spec/{vela-worker-v0.4.3.json => vela-worker-v0.5.0.json} (98%) diff --git a/api-spec/vela-worker-v0.4.3.json b/api-spec/vela-worker-v0.5.0.json similarity index 98% rename from api-spec/vela-worker-v0.4.3.json rename to api-spec/vela-worker-v0.5.0.json index 727efc02..f1ca5d3a 100644 --- a/api-spec/vela-worker-v0.4.3.json +++ b/api-spec/vela-worker-v0.5.0.json @@ -132,16 +132,16 @@ "x-success_http_code": "200" } }, - "/api/v1/executors/{executor}/build/kill": { + "/api/v1/executors/{executor}/build/cancel": { "delete": { - "description": "Kill the currently running build", + "description": "Cancel the currently running build", "produces": [ "application/json" ], "tags": [ "build" ], - "operationId": "KillBuild", + "operationId": "CancelBuild", "parameters": [ { "type": "string", @@ -160,10 +160,10 @@ ], "responses": { "200": { - "description": "Successfully killed the build" + "description": "Successfully cancelled the build" }, "500": { - "description": "Unable to kill the build" + "description": "Unable to cancel the build" } }, "x-success_http_code": "200" diff --git a/api/build.go b/api/build.go index 1cfa6308..fd0aac58 100644 --- a/api/build.go +++ b/api/build.go @@ -61,9 +61,9 @@ func GetBuild(c *gin.Context) { c.JSON(http.StatusOK, build) } -// swagger:operation DELETE /api/v1/executors/{executor}/build/kill build KillBuild +// swagger:operation DELETE /api/v1/executors/{executor}/build/cancel build CancelBuild // -// Kill the currently running build +// Cancel the currently running build // // --- // x-success_http_code: '200' @@ -82,18 +82,18 @@ func GetBuild(c *gin.Context) { // type: string // responses: // '200': -// description: Successfully killed the build +// description: Successfully canceled the build // type: json // '500': -// description: Unable to kill the build +// description: Unable to cancel the build // type: json -// KillBuild represents the API handler to kill a +// CancelBuild represents the API handler to cancel a // build currently running on an executor. // // This function performs a hard cancellation of a build on worker. // Any build running during this time will immediately be stopped. -func KillBuild(c *gin.Context) { +func CancelBuild(c *gin.Context) { e := executor.Retrieve(c) repo, err := e.GetRepo() @@ -105,14 +105,14 @@ func KillBuild(c *gin.Context) { return } - build, err := e.KillBuild() + build, err := e.CancelBuild() if err != nil { - msg := fmt.Errorf("unable to kill build: %w", err).Error() + msg := fmt.Errorf("unable to cancel build: %w", err).Error() c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) return } - c.JSON(http.StatusOK, fmt.Sprintf("killing build %s/%d", repo.GetFullName(), build.GetNumber())) + c.JSON(http.StatusOK, fmt.Sprintf("canceled build %s/%d", repo.GetFullName(), build.GetNumber())) } diff --git a/go.mod b/go.mod index 6ee4752e..d553e0c8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.0 + github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02 github.com/go-vela/pkg-queue v0.5.0 github.com/go-vela/pkg-runtime v0.5.0 github.com/go-vela/sdk-go v0.5.0 diff --git a/go.sum b/go.sum index 23cc036b..d11623d0 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/go-vela/compiler v0.5.0 h1:Gbi84v+Z4X9RskhalXAzsqmuAmbLpYxyShtSqvY8zr github.com/go-vela/compiler v0.5.0/go.mod h1:TJq4UwuW+I1RpcGqP3lkwCtch9KlGIzX32KJDgtKOkU= github.com/go-vela/mock v0.5.0 h1:JkLW5BilpLEQNfSiVAa/xtoZfFg2LG2P/3fPZxYoWDk= github.com/go-vela/mock v0.5.0/go.mod h1:8vbEQhRmEhe/p3RF3PrhIhnFFJUbSJrtLTnlY8yB+fY= -github.com/go-vela/pkg-executor v0.5.0 h1:YDIvHDyFYwP/j399DtgEkbE3S/Gye4ZBqIls/m/mnt4= -github.com/go-vela/pkg-executor v0.5.0/go.mod h1:bkZqGHYNnPEzKpT6FUp1BVty4zaDNjv/ggG3fsjodxo= +github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02 h1:ScI4CfO1ooeeUVRmGlYQZs6NQqaOGA3DUF1Ih9qI3+k= +github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02/go.mod h1:bkZqGHYNnPEzKpT6FUp1BVty4zaDNjv/ggG3fsjodxo= github.com/go-vela/pkg-queue v0.5.0 h1:gWOYEFGdqr0GMv/zrd3+otNU7un7xnXntyGZ3nxntl4= github.com/go-vela/pkg-queue v0.5.0/go.mod h1:T4eE71HrC7sZ1ZmvWvJJ80iEu9VGp/ZdGVXq4rzy0Hw= github.com/go-vela/pkg-runtime v0.5.0 h1:AKOKrNWxeGI0xb1xziyrTboK4J52OV6gDQjBJwm53C0= diff --git a/router/build.go b/router/build.go index 2d2597e1..893a556d 100644 --- a/router/build.go +++ b/router/build.go @@ -15,7 +15,7 @@ import ( // build related requests. // // GET /api/v1/executors/:executor/build -// DELETE /api/v1/executors/:executor/build/kill +// DELETE /api/v1/executors/:executor/build/cancel func BuildHandlers(base *gin.RouterGroup) { // add a collection of endpoints for handling build related requests // @@ -27,9 +27,9 @@ func BuildHandlers(base *gin.RouterGroup) { // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET build.GET("", api.GetBuild) - // add an endpoint for killing the build + // add an endpoint for canceling the build // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.DELETE - build.DELETE("/kill", api.KillBuild) + build.DELETE("/cancel", api.CancelBuild) } } diff --git a/router/build_test.go b/router/build_test.go index bff2da71..2a51631c 100644 --- a/router/build_test.go +++ b/router/build_test.go @@ -27,9 +27,9 @@ func TestRouter_BuildHandlers(t *testing.T) { }, { Method: "DELETE", - Path: "/build/kill", - Handler: "github.com/go-vela/worker/api.KillBuild", - HandlerFunc: api.KillBuild, + Path: "/build/cancel", + Handler: "github.com/go-vela/worker/api.CancelBuild", + HandlerFunc: api.CancelBuild, }, } diff --git a/router/executor.go b/router/executor.go index 6c8bdd5e..929da547 100644 --- a/router/executor.go +++ b/router/executor.go @@ -17,7 +17,7 @@ import ( // GET /api/v1/executors // GET /api/v1/executors/:executor // GET /api/v1/executors/:executor/build -// DELETE /api/v1/executors/:executor/build/kill +// DELETE /api/v1/executors/:executor/build/cancel // GET /api/v1/executors/:executor/pipeline // GET /api/v1/executors/:executor/repo func ExecutorHandlers(base *gin.RouterGroup) { diff --git a/router/executor_test.go b/router/executor_test.go index 609ae5d8..8cf6f728 100644 --- a/router/executor_test.go +++ b/router/executor_test.go @@ -39,9 +39,9 @@ func TestRouter_ExecutorHandlers(t *testing.T) { }, { Method: "DELETE", - Path: "/executors/:executor/build/kill", - Handler: "github.com/go-vela/worker/api.KillBuild", - HandlerFunc: api.KillBuild, + Path: "/executors/:executor/build/cancel", + Handler: "github.com/go-vela/worker/api.CancelBuild", + HandlerFunc: api.CancelBuild, }, { Method: "GET", diff --git a/router/router_test.go b/router/router_test.go index d2e0e802..bd117362 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -55,9 +55,9 @@ func TestRouter_Load(t *testing.T) { }, { Method: "DELETE", - Path: "/api/v1/executors/:executor/build/kill", - Handler: "github.com/go-vela/worker/api.KillBuild", - HandlerFunc: api.KillBuild, + Path: "/api/v1/executors/:executor/build/cancel", + Handler: "github.com/go-vela/worker/api.CancelBuild", + HandlerFunc: api.CancelBuild, }, { Method: "GET", From e5c405ec4555987ade9ba9f0627b35fee92cbc2d Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 18 Aug 2020 14:40:29 -0500 Subject: [PATCH 114/430] chore: update go-vela dependencies (#109) --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index d553e0c8..308f6c68 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02 + github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6 github.com/go-vela/pkg-queue v0.5.0 github.com/go-vela/pkg-runtime v0.5.0 github.com/go-vela/sdk-go v0.5.0 - github.com/go-vela/types v0.5.0 + github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index d11623d0..b1bef877 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/go-vela/compiler v0.5.0 h1:Gbi84v+Z4X9RskhalXAzsqmuAmbLpYxyShtSqvY8zr github.com/go-vela/compiler v0.5.0/go.mod h1:TJq4UwuW+I1RpcGqP3lkwCtch9KlGIzX32KJDgtKOkU= github.com/go-vela/mock v0.5.0 h1:JkLW5BilpLEQNfSiVAa/xtoZfFg2LG2P/3fPZxYoWDk= github.com/go-vela/mock v0.5.0/go.mod h1:8vbEQhRmEhe/p3RF3PrhIhnFFJUbSJrtLTnlY8yB+fY= -github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02 h1:ScI4CfO1ooeeUVRmGlYQZs6NQqaOGA3DUF1Ih9qI3+k= -github.com/go-vela/pkg-executor v0.5.1-0.20200813204943-965506d5df02/go.mod h1:bkZqGHYNnPEzKpT6FUp1BVty4zaDNjv/ggG3fsjodxo= +github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6 h1:w4YyLiBejijoF1SMenIyxU155nj77jUDB/xmowd8KUE= +github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6/go.mod h1:/63b6vyG2rLy4diM5JNXFEalNGo2VkAo8Vh5biNagJ8= github.com/go-vela/pkg-queue v0.5.0 h1:gWOYEFGdqr0GMv/zrd3+otNU7un7xnXntyGZ3nxntl4= github.com/go-vela/pkg-queue v0.5.0/go.mod h1:T4eE71HrC7sZ1ZmvWvJJ80iEu9VGp/ZdGVXq4rzy0Hw= github.com/go-vela/pkg-runtime v0.5.0 h1:AKOKrNWxeGI0xb1xziyrTboK4J52OV6gDQjBJwm53C0= @@ -133,6 +133,8 @@ github.com/go-vela/sdk-go v0.5.0 h1:RieSkHu0CvdvWsR96HLz56DIqjxtehevr7Ui8dkgdq4= github.com/go-vela/sdk-go v0.5.0/go.mod h1:pfsTNUBE1xXO4/sdEx4cIl8rw49agL4ptCzhgOj2O/M= github.com/go-vela/types v0.5.0 h1:f89RiP21e+5QuLeugyhOXIOF+oEPJLndX7lkE5tNOjQ= github.com/go-vela/types v0.5.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621 h1:j46VLiQy8so5433dAyxLJAZUSpXwhr/fizBFigmG/Fg= +github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 5619c161ed425849da13bf2fe6f86ada7534fb13 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Thu, 20 Aug 2020 09:31:17 -0500 Subject: [PATCH 115/430] chore: set hostname in docker-compose (#110) --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 87ab131c..fe672327 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: context: . container_name: worker_1 image: worker:local + hostname: http://worker_1 networks: - vela environment: @@ -33,6 +34,7 @@ services: context: . container_name: worker_2 image: worker:local + hostname: http://worker_2 networks: - vela environment: From 2553370bd717c09fd708377dbdf55559d9dd74a4 Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 20 Aug 2020 11:20:06 -0500 Subject: [PATCH 116/430] chore: update deps for release (#111) * chore: update deps for release * fix: add periods --- go.mod | 10 +++++----- go.sum | 30 ++++++++++++++---------------- router/middleware/header_test.go | 8 ++++---- version/version.go | 8 ++++---- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index 308f6c68..566ebf37 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6 - github.com/go-vela/pkg-queue v0.5.0 - github.com/go-vela/pkg-runtime v0.5.0 - github.com/go-vela/sdk-go v0.5.0 - github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621 + github.com/go-vela/pkg-executor v0.5.1 + github.com/go-vela/pkg-queue v0.5.1 + github.com/go-vela/pkg-runtime v0.5.1 + github.com/go-vela/sdk-go v0.5.1 + github.com/go-vela/types v0.5.1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index b1bef877..28382521 100644 --- a/go.sum +++ b/go.sum @@ -119,22 +119,20 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.5.0 h1:Gbi84v+Z4X9RskhalXAzsqmuAmbLpYxyShtSqvY8zrw= -github.com/go-vela/compiler v0.5.0/go.mod h1:TJq4UwuW+I1RpcGqP3lkwCtch9KlGIzX32KJDgtKOkU= -github.com/go-vela/mock v0.5.0 h1:JkLW5BilpLEQNfSiVAa/xtoZfFg2LG2P/3fPZxYoWDk= -github.com/go-vela/mock v0.5.0/go.mod h1:8vbEQhRmEhe/p3RF3PrhIhnFFJUbSJrtLTnlY8yB+fY= -github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6 h1:w4YyLiBejijoF1SMenIyxU155nj77jUDB/xmowd8KUE= -github.com/go-vela/pkg-executor v0.5.1-0.20200818165225-c3ca5fcb7da6/go.mod h1:/63b6vyG2rLy4diM5JNXFEalNGo2VkAo8Vh5biNagJ8= -github.com/go-vela/pkg-queue v0.5.0 h1:gWOYEFGdqr0GMv/zrd3+otNU7un7xnXntyGZ3nxntl4= -github.com/go-vela/pkg-queue v0.5.0/go.mod h1:T4eE71HrC7sZ1ZmvWvJJ80iEu9VGp/ZdGVXq4rzy0Hw= -github.com/go-vela/pkg-runtime v0.5.0 h1:AKOKrNWxeGI0xb1xziyrTboK4J52OV6gDQjBJwm53C0= -github.com/go-vela/pkg-runtime v0.5.0/go.mod h1:YJ16RHGFmfd9xyq9Z3BpomOVQvxfsXwqUVPnrJbPhqw= -github.com/go-vela/sdk-go v0.5.0 h1:RieSkHu0CvdvWsR96HLz56DIqjxtehevr7Ui8dkgdq4= -github.com/go-vela/sdk-go v0.5.0/go.mod h1:pfsTNUBE1xXO4/sdEx4cIl8rw49agL4ptCzhgOj2O/M= -github.com/go-vela/types v0.5.0 h1:f89RiP21e+5QuLeugyhOXIOF+oEPJLndX7lkE5tNOjQ= -github.com/go-vela/types v0.5.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= -github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621 h1:j46VLiQy8so5433dAyxLJAZUSpXwhr/fizBFigmG/Fg= -github.com/go-vela/types v0.5.1-0.20200818133658-9908dd053621/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/compiler v0.5.1 h1:5H6oH4wisqnTEBTo3EizYsfMAqlWF0xgM1r8LM4ZVfc= +github.com/go-vela/compiler v0.5.1/go.mod h1:y5EDX+5NFs3AHqzIe/ShdX/fh6nraJVqwxv9x3sW8ho= +github.com/go-vela/mock v0.5.1 h1:IuPva8WUTupMyYhey3FXGnLIgBCizyGR/Gku9ZF/fRk= +github.com/go-vela/mock v0.5.1/go.mod h1:2bYQM8929oqjE+6fXEpfUgYuqYgL+YHF2ICx5jbZ22Y= +github.com/go-vela/pkg-executor v0.5.1 h1:VAqalQDw06POCdKoQMGSMZuCBAvHLrSDJ5ZLVLMtjBg= +github.com/go-vela/pkg-executor v0.5.1/go.mod h1:HXj38qJRI2d3X0/N2A7L/NS5eqiPUODUmN85kH2hzPw= +github.com/go-vela/pkg-queue v0.5.1 h1:YH5rhQtmUDwQxKguxRVznghDl7Gv20n8r/R22e4nRvM= +github.com/go-vela/pkg-queue v0.5.1/go.mod h1:flzHA4/XgUVLPTt7XRgooyzjxQsKZ08M3gDwSlVrmOk= +github.com/go-vela/pkg-runtime v0.5.1 h1:awU1vhp7pKX6PXDfAEeuC1y2CGG5wU9FSdwKVClBD6Y= +github.com/go-vela/pkg-runtime v0.5.1/go.mod h1:uDB8SZfHhhlS0Ix1cmpHGiyqyD5izfb++E0uzcy8fI0= +github.com/go-vela/sdk-go v0.5.1 h1:6TSXAmXGRXbtEnZYzXVtaR5VilBiUvpe09P8HWSMbi4= +github.com/go-vela/sdk-go v0.5.1/go.mod h1:D4WuPy8MA3ltg/3udQVX5LDnLc4AJwF5d7OgtD1jCpU= +github.com/go-vela/types v0.5.1 h1:ZIOg+m+awjw2GN507MwUXINAR43+B/w2pSQT9EEm/UM= +github.com/go-vela/types v0.5.1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 92e0a72d..d1cbae31 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.5.1" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.5.1" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.5.1" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.0" + wantVersion := "0.5.1" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index fe6511ee..d997baf2 100644 --- a/version/version.go +++ b/version/version.go @@ -7,12 +7,12 @@ package version import "github.com/coreos/go-semver/semver" var ( - // VersionMajor is for an API incompatible changes + // VersionMajor is for an API incompatible changes. VersionMajor int64 - // VersionMinor is for functionality in a backwards-compatible manner + // VersionMinor is for functionality in a backwards-compatible manner. VersionMinor int64 = 5 - // VersionPatch is for backwards-compatible bug fixes - VersionPatch int64 + // VersionPatch is for backwards-compatible bug fixes. + VersionPatch int64 = 1 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From ae691aba0fc2c7972c014e695edce61e3c5e0937 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 24 Aug 2020 19:05:27 -0500 Subject: [PATCH 117/430] chore: update dependencies for v0.5.2 (#112) --- go.mod | 10 +++++----- go.sum | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 566ebf37..85059977 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.1 - github.com/go-vela/pkg-queue v0.5.1 - github.com/go-vela/pkg-runtime v0.5.1 - github.com/go-vela/sdk-go v0.5.1 - github.com/go-vela/types v0.5.1 + github.com/go-vela/pkg-executor v0.5.2 + github.com/go-vela/pkg-queue v0.5.2 + github.com/go-vela/pkg-runtime v0.5.2 + github.com/go-vela/sdk-go v0.5.2 + github.com/go-vela/types v0.5.2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 28382521..18e62a6f 100644 --- a/go.sum +++ b/go.sum @@ -121,18 +121,20 @@ github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.5.1 h1:5H6oH4wisqnTEBTo3EizYsfMAqlWF0xgM1r8LM4ZVfc= github.com/go-vela/compiler v0.5.1/go.mod h1:y5EDX+5NFs3AHqzIe/ShdX/fh6nraJVqwxv9x3sW8ho= -github.com/go-vela/mock v0.5.1 h1:IuPva8WUTupMyYhey3FXGnLIgBCizyGR/Gku9ZF/fRk= -github.com/go-vela/mock v0.5.1/go.mod h1:2bYQM8929oqjE+6fXEpfUgYuqYgL+YHF2ICx5jbZ22Y= -github.com/go-vela/pkg-executor v0.5.1 h1:VAqalQDw06POCdKoQMGSMZuCBAvHLrSDJ5ZLVLMtjBg= -github.com/go-vela/pkg-executor v0.5.1/go.mod h1:HXj38qJRI2d3X0/N2A7L/NS5eqiPUODUmN85kH2hzPw= -github.com/go-vela/pkg-queue v0.5.1 h1:YH5rhQtmUDwQxKguxRVznghDl7Gv20n8r/R22e4nRvM= -github.com/go-vela/pkg-queue v0.5.1/go.mod h1:flzHA4/XgUVLPTt7XRgooyzjxQsKZ08M3gDwSlVrmOk= -github.com/go-vela/pkg-runtime v0.5.1 h1:awU1vhp7pKX6PXDfAEeuC1y2CGG5wU9FSdwKVClBD6Y= -github.com/go-vela/pkg-runtime v0.5.1/go.mod h1:uDB8SZfHhhlS0Ix1cmpHGiyqyD5izfb++E0uzcy8fI0= -github.com/go-vela/sdk-go v0.5.1 h1:6TSXAmXGRXbtEnZYzXVtaR5VilBiUvpe09P8HWSMbi4= -github.com/go-vela/sdk-go v0.5.1/go.mod h1:D4WuPy8MA3ltg/3udQVX5LDnLc4AJwF5d7OgtD1jCpU= +github.com/go-vela/mock v0.5.2 h1:216z1HeAfCyAcmJZp8dcYI7Mh4foK/QWmnE67cscj6g= +github.com/go-vela/mock v0.5.2/go.mod h1:Hu0ZMXt73NKg/rqEvAwkExnHSYBEUSouf1+u761XjL4= +github.com/go-vela/pkg-executor v0.5.2 h1:hS35dgCGLSogWeCJgjk743oFSLJ7IFt7tZ4ba5WGSfM= +github.com/go-vela/pkg-executor v0.5.2/go.mod h1:NrLrF6wM7307AwLPltHe8aaj35PkLsxfZU+6lLDMG/8= +github.com/go-vela/pkg-queue v0.5.2 h1:mwrd7oEJfjsknXCO35AR0VnjyEXOqaXt9R0xnhPLwI4= +github.com/go-vela/pkg-queue v0.5.2/go.mod h1:/8B1BLeu2zyxZVvqSEU2zHYzRjppxji4+ZUaRrruoYM= +github.com/go-vela/pkg-runtime v0.5.2 h1:bgioFKqx2ZfqNEcGLn/UnlGsaWEixkoNacz68+8cqe0= +github.com/go-vela/pkg-runtime v0.5.2/go.mod h1:0290TExVsx5yWGbsCNi44TSdpfk1yaz8HeZHYx3gZfk= +github.com/go-vela/sdk-go v0.5.2 h1:c3Rtxvv/CfjDW1YzUue4dEdz+YnSacIMC3xT7df7o7I= +github.com/go-vela/sdk-go v0.5.2/go.mod h1:3xxwXLTGiZomtuwLrz2UqBzlOWc3gpUUndm6wwwQR/g= github.com/go-vela/types v0.5.1 h1:ZIOg+m+awjw2GN507MwUXINAR43+B/w2pSQT9EEm/UM= github.com/go-vela/types v0.5.1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/types v0.5.2 h1:bsHUDUw5OdW+7kyu/kN1si/cN/rw6ai3rEQtJD9XcQs= +github.com/go-vela/types v0.5.2/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 4cf386f28145a3f20aa2586f0651cfaca709904d Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Fri, 4 Sep 2020 07:40:03 -0500 Subject: [PATCH 118/430] feat: allow server to run with TLS (#113) * feat: allow server to run with TLS * feat: allow server to run with TLS --- cmd/vela-worker/flags.go | 10 ++++++++++ cmd/vela-worker/run.go | 5 +++++ cmd/vela-worker/server.go | 9 ++++++++- cmd/vela-worker/worker.go | 23 +++++++++++++++-------- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 6cfa8e87..bcc73b52 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -77,6 +77,16 @@ func flags() []cli.Flag { Name: "server.secret", Usage: "secret used for server <-> worker communication", }, + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_CERT", "VELA_SERVER_CERT", "SERVER_CERT"}, + Name: "server.cert", + Usage: "optional TLS certificate for https", + }, + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_CERT_KEY", "VELA_SERVER_CERT_KEY", "SERVER_CERT_KEY"}, + Name: "server.cert-key", + Usage: "optional TLS certificate key", + }, } // Executor Flags diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 964fdf6e..822cb200 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -110,6 +110,11 @@ func run(c *cli.Context) error { Address: c.String("server.addr"), Secret: c.String("server.secret"), }, + // Certificate configuration + Certificate: &Certificate{ + Cert: c.String("server.cert"), + Key: c.String("server.cert-key"), + }, }, Executors: make(map[int]executor.Engine), } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 78dbbe3a..cc5f06d1 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -36,7 +36,14 @@ func (w *Worker) server() error { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Tracef logrus.Tracef("serving traffic on %s", w.Config.API.Port) - // start serving traffic on the provided worker port + // start serving traffic with TLS on the provided worker port + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.RunTLS + if len(w.Config.Certificate.Cert) > 0 { + return _server.RunTLS(w.Config.API.Port, w.Config.Certificate.Cert, w.Config.Certificate.Key) + } + + // if no certs are provided, run without TLS // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run return _server.Run(w.Config.API.Port) diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index d10f9dbb..d4da8bbf 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -37,16 +37,23 @@ type ( Secret string } + // Certificate represents the optional cert and key to enable TLS + Certificate struct { + Cert string + Key string + } + // Config represents the worker configuration. Config struct { - API *API - Build *Build - Executor *executor.Setup - Hostname string - Logger *Logger - Queue *queue.Setup - Runtime *runtime.Setup - Server *Server + API *API + Build *Build + Executor *executor.Setup + Hostname string + Logger *Logger + Queue *queue.Setup + Runtime *runtime.Setup + Server *Server + Certificate *Certificate } // Worker represents all configuration and From 6b461db990fdc113fc335fe08cb65a564d3e1683 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 22 Sep 2020 13:32:45 -0500 Subject: [PATCH 119/430] chore: update vela deps for pull policies (#114) --- go.mod | 8 ++++---- go.sum | 26 ++++++++++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 85059977..39d0e569 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.2 + github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03 github.com/go-vela/pkg-queue v0.5.2 - github.com/go-vela/pkg-runtime v0.5.2 - github.com/go-vela/sdk-go v0.5.2 - github.com/go-vela/types v0.5.2 + github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533 + github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a + github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 18e62a6f..57a62ff7 100644 --- a/go.sum +++ b/go.sum @@ -119,22 +119,26 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.5.1 h1:5H6oH4wisqnTEBTo3EizYsfMAqlWF0xgM1r8LM4ZVfc= -github.com/go-vela/compiler v0.5.1/go.mod h1:y5EDX+5NFs3AHqzIe/ShdX/fh6nraJVqwxv9x3sW8ho= +github.com/go-vela/compiler v0.5.2-0.20200918133711-83a4bb35e614 h1:lE8y8/eD3Gx31Ch77ejouHzHTqVGM2Z4bqgA5uxT980= +github.com/go-vela/compiler v0.5.2-0.20200918133711-83a4bb35e614/go.mod h1:jTbvwSWSCUGmPkJlKoLjypBfxHb+uyW6UjfaqTEdr8U= github.com/go-vela/mock v0.5.2 h1:216z1HeAfCyAcmJZp8dcYI7Mh4foK/QWmnE67cscj6g= github.com/go-vela/mock v0.5.2/go.mod h1:Hu0ZMXt73NKg/rqEvAwkExnHSYBEUSouf1+u761XjL4= -github.com/go-vela/pkg-executor v0.5.2 h1:hS35dgCGLSogWeCJgjk743oFSLJ7IFt7tZ4ba5WGSfM= -github.com/go-vela/pkg-executor v0.5.2/go.mod h1:NrLrF6wM7307AwLPltHe8aaj35PkLsxfZU+6lLDMG/8= +github.com/go-vela/mock v0.5.3-0.20200917144558-68fea9631030 h1:3bor9TG5dSktOGcRYMId5bssn+FZHAMXmrYPM0vCJXw= +github.com/go-vela/mock v0.5.3-0.20200917144558-68fea9631030/go.mod h1:5C60piS4T523++JUsVZg5x3p8XIQQZigcjPcpzI6uxA= +github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03 h1:ad4ZWL4F5tspKr9SDesUtp/1JUxtHuOcPsqkYj2MwIQ= +github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03/go.mod h1:sL5kLlGQSUORdS5dYM/013yfQR9pwVc6GlBun2a8UBI= github.com/go-vela/pkg-queue v0.5.2 h1:mwrd7oEJfjsknXCO35AR0VnjyEXOqaXt9R0xnhPLwI4= github.com/go-vela/pkg-queue v0.5.2/go.mod h1:/8B1BLeu2zyxZVvqSEU2zHYzRjppxji4+ZUaRrruoYM= -github.com/go-vela/pkg-runtime v0.5.2 h1:bgioFKqx2ZfqNEcGLn/UnlGsaWEixkoNacz68+8cqe0= -github.com/go-vela/pkg-runtime v0.5.2/go.mod h1:0290TExVsx5yWGbsCNi44TSdpfk1yaz8HeZHYx3gZfk= +github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533 h1:zMfCU/86mqUEqR4bloawIQHyCPCwJY5AbSxqv6snouM= +github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533/go.mod h1:W+TFcRGyB5CvzHXNZ8Ed70Rc8n1lEOEGxlKONZBR6u0= github.com/go-vela/sdk-go v0.5.2 h1:c3Rtxvv/CfjDW1YzUue4dEdz+YnSacIMC3xT7df7o7I= github.com/go-vela/sdk-go v0.5.2/go.mod h1:3xxwXLTGiZomtuwLrz2UqBzlOWc3gpUUndm6wwwQR/g= -github.com/go-vela/types v0.5.1 h1:ZIOg+m+awjw2GN507MwUXINAR43+B/w2pSQT9EEm/UM= -github.com/go-vela/types v0.5.1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a h1:QsG+YbiCwOAsko/AOW6cJuHNBtANCHav8fV/yFG72/U= +github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a/go.mod h1:WB8PNhn9BqZGlEOrINkIvyckxSkr238KhMXmCqtgZac= github.com/go-vela/types v0.5.2 h1:bsHUDUw5OdW+7kyu/kN1si/cN/rw6ai3rEQtJD9XcQs= github.com/go-vela/types v0.5.2/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1 h1:rPqRAWikGpmYak86FjbecT5oecn647HljJbBs76mJ6w= +github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -199,6 +203,12 @@ github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= +github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= 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= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= From c1697fe4f62967a867edfe1ed3dc52679fe4bb3f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 22 Sep 2020 14:32:57 -0500 Subject: [PATCH 120/430] release: updates for v0.6.0-rc1 (#115) * release: updates for v0.6.0-rc1 * test: fix header version tests --- go.mod | 10 ++++----- go.sum | 35 +++++++++++++------------------- router/middleware/header_test.go | 8 ++++---- version/version.go | 4 ++-- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index 39d0e569..6d120f38 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03 - github.com/go-vela/pkg-queue v0.5.2 - github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533 - github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a - github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1 + github.com/go-vela/pkg-executor v0.6.0-rc1 + github.com/go-vela/pkg-queue v0.6.0-rc1 + github.com/go-vela/pkg-runtime v0.6.0-rc1 + github.com/go-vela/sdk-go v0.6.0-rc1 + github.com/go-vela/types v0.6.0-rc1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 57a62ff7..344d9f5a 100644 --- a/go.sum +++ b/go.sum @@ -119,26 +119,20 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.5.2-0.20200918133711-83a4bb35e614 h1:lE8y8/eD3Gx31Ch77ejouHzHTqVGM2Z4bqgA5uxT980= -github.com/go-vela/compiler v0.5.2-0.20200918133711-83a4bb35e614/go.mod h1:jTbvwSWSCUGmPkJlKoLjypBfxHb+uyW6UjfaqTEdr8U= -github.com/go-vela/mock v0.5.2 h1:216z1HeAfCyAcmJZp8dcYI7Mh4foK/QWmnE67cscj6g= -github.com/go-vela/mock v0.5.2/go.mod h1:Hu0ZMXt73NKg/rqEvAwkExnHSYBEUSouf1+u761XjL4= -github.com/go-vela/mock v0.5.3-0.20200917144558-68fea9631030 h1:3bor9TG5dSktOGcRYMId5bssn+FZHAMXmrYPM0vCJXw= -github.com/go-vela/mock v0.5.3-0.20200917144558-68fea9631030/go.mod h1:5C60piS4T523++JUsVZg5x3p8XIQQZigcjPcpzI6uxA= -github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03 h1:ad4ZWL4F5tspKr9SDesUtp/1JUxtHuOcPsqkYj2MwIQ= -github.com/go-vela/pkg-executor v0.5.3-0.20200922165509-f21d78b7ba03/go.mod h1:sL5kLlGQSUORdS5dYM/013yfQR9pwVc6GlBun2a8UBI= -github.com/go-vela/pkg-queue v0.5.2 h1:mwrd7oEJfjsknXCO35AR0VnjyEXOqaXt9R0xnhPLwI4= -github.com/go-vela/pkg-queue v0.5.2/go.mod h1:/8B1BLeu2zyxZVvqSEU2zHYzRjppxji4+ZUaRrruoYM= -github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533 h1:zMfCU/86mqUEqR4bloawIQHyCPCwJY5AbSxqv6snouM= -github.com/go-vela/pkg-runtime v0.5.3-0.20200922163421-d7a35f9cc533/go.mod h1:W+TFcRGyB5CvzHXNZ8Ed70Rc8n1lEOEGxlKONZBR6u0= -github.com/go-vela/sdk-go v0.5.2 h1:c3Rtxvv/CfjDW1YzUue4dEdz+YnSacIMC3xT7df7o7I= -github.com/go-vela/sdk-go v0.5.2/go.mod h1:3xxwXLTGiZomtuwLrz2UqBzlOWc3gpUUndm6wwwQR/g= -github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a h1:QsG+YbiCwOAsko/AOW6cJuHNBtANCHav8fV/yFG72/U= -github.com/go-vela/sdk-go v0.5.3-0.20200917170216-ccf8288be03a/go.mod h1:WB8PNhn9BqZGlEOrINkIvyckxSkr238KhMXmCqtgZac= -github.com/go-vela/types v0.5.2 h1:bsHUDUw5OdW+7kyu/kN1si/cN/rw6ai3rEQtJD9XcQs= -github.com/go-vela/types v0.5.2/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= -github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1 h1:rPqRAWikGpmYak86FjbecT5oecn647HljJbBs76mJ6w= -github.com/go-vela/types v0.5.3-0.20200915182859-26f35b0bc7f1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/compiler v0.6.0-rc1 h1:MgjofP4VO+8YFloK1GQBq5PoKCLQDegWBEB6zeEnyrU= +github.com/go-vela/compiler v0.6.0-rc1/go.mod h1:q+06ngm8r84Z03TUHmMkhHY7CZHlax8uPjSZf5l/Bl8= +github.com/go-vela/mock v0.6.0-rc1 h1:hB2NEEpaF65plE97AJXn4NY2OW7xnd5cvuSAAuzJ/ts= +github.com/go-vela/mock v0.6.0-rc1/go.mod h1:6k2CK115mHb8gaGSJXvL6lcfanuz77FL9T5D9Afc1sU= +github.com/go-vela/pkg-executor v0.6.0-rc1 h1:+2fkna9hydugMHufDjN/FsY+bNxUzKUv992f0wk4mjM= +github.com/go-vela/pkg-executor v0.6.0-rc1/go.mod h1:vW2zHQnzcq03Ul9hZ1SmLbzcqNOC9H/u9YgPzULnlt0= +github.com/go-vela/pkg-queue v0.6.0-rc1 h1:4+uqWQAt0MGoKp3Hos61XholqD4wj6Ui338RGiglcU0= +github.com/go-vela/pkg-queue v0.6.0-rc1/go.mod h1:+HEN2Sorq9E2pIT85Lq8wOjQyKEpxm25948KmfwegBc= +github.com/go-vela/pkg-runtime v0.6.0-rc1 h1:ebmRYsJzAMYkN2WfBTnRWmJfQ60sfDwkk5hjYiHbfTU= +github.com/go-vela/pkg-runtime v0.6.0-rc1/go.mod h1:xnRoucOQVR929DUr8OHeXPoqIgefFOPuM8jed4UVRI4= +github.com/go-vela/sdk-go v0.6.0-rc1 h1:eReCh4EcD7Gx8bteOemupQredcv/IGq6JdUp0TfHDNs= +github.com/go-vela/sdk-go v0.6.0-rc1/go.mod h1:aA3hHdSp6X81QuhlUmTNHi1DGf/KxBR3URfbWxDHIGM= +github.com/go-vela/types v0.6.0-rc1 h1:/ZSdzpaVvDr7nbltSdzpU7OyWooDDbiHVhDyjLMQtf4= +github.com/go-vela/types v0.6.0-rc1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -273,7 +267,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index d1cbae31..ed8493ac 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -256,7 +256,7 @@ func TestMiddleware_Secure_TLS(t *testing.T) { func TestMiddleware_RequestVersion(t *testing.T) { // setup types - wantVersion := "0.5.1" + wantVersion := "0.6.0" // setup context gin.SetMode(gin.DebugMode) @@ -287,7 +287,7 @@ func TestMiddleware_RequestVersion(t *testing.T) { func TestMiddleware_RequestVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.1" + wantVersion := "0.6.0" // setup context gin.SetMode(gin.TestMode) @@ -318,7 +318,7 @@ func TestMiddleware_RequestVersion_Prod(t *testing.T) { func TestMiddleware_ResponseVersion(t *testing.T) { // setup types - wantVersion := "0.5.1" + wantVersion := "0.6.0" // setup context gin.SetMode(gin.DebugMode) @@ -349,7 +349,7 @@ func TestMiddleware_ResponseVersion(t *testing.T) { func TestMiddleware_ResponseVersion_Prod(t *testing.T) { // setup types - wantVersion := "0.5.1" + wantVersion := "0.6.0" // setup context gin.SetMode(gin.TestMode) diff --git a/version/version.go b/version/version.go index d997baf2..e4228153 100644 --- a/version/version.go +++ b/version/version.go @@ -10,9 +10,9 @@ var ( // VersionMajor is for an API incompatible changes. VersionMajor int64 // VersionMinor is for functionality in a backwards-compatible manner. - VersionMinor int64 = 5 + VersionMinor int64 = 6 // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 = 1 + VersionPatch int64 // VersionDev indicates build metadata. Releases will be empty string. VersionDev string ) From 90e86ace3372b3e1ad9ea1870d490ea9e9edffc5 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Mon, 28 Sep 2020 08:43:56 -0500 Subject: [PATCH 121/430] fix: revert PR 113 (#116) * fix: revert PR 113 * fix: revert PR 113 --- cmd/vela-worker/flags.go | 10 ---------- cmd/vela-worker/run.go | 5 ----- cmd/vela-worker/server.go | 9 +-------- cmd/vela-worker/worker.go | 23 ++++++++--------------- 4 files changed, 9 insertions(+), 38 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index bcc73b52..6cfa8e87 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -77,16 +77,6 @@ func flags() []cli.Flag { Name: "server.secret", Usage: "secret used for server <-> worker communication", }, - &cli.StringFlag{ - EnvVars: []string{"WORKER_SERVER_CERT", "VELA_SERVER_CERT", "SERVER_CERT"}, - Name: "server.cert", - Usage: "optional TLS certificate for https", - }, - &cli.StringFlag{ - EnvVars: []string{"WORKER_SERVER_CERT_KEY", "VELA_SERVER_CERT_KEY", "SERVER_CERT_KEY"}, - Name: "server.cert-key", - Usage: "optional TLS certificate key", - }, } // Executor Flags diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 822cb200..964fdf6e 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -110,11 +110,6 @@ func run(c *cli.Context) error { Address: c.String("server.addr"), Secret: c.String("server.secret"), }, - // Certificate configuration - Certificate: &Certificate{ - Cert: c.String("server.cert"), - Key: c.String("server.cert-key"), - }, }, Executors: make(map[int]executor.Engine), } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index cc5f06d1..3652046e 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -36,14 +36,7 @@ func (w *Worker) server() error { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Tracef logrus.Tracef("serving traffic on %s", w.Config.API.Port) - // start serving traffic with TLS on the provided worker port - // - // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.RunTLS - if len(w.Config.Certificate.Cert) > 0 { - return _server.RunTLS(w.Config.API.Port, w.Config.Certificate.Cert, w.Config.Certificate.Key) - } - - // if no certs are provided, run without TLS + // // start serving traffic on the provided worker port // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run return _server.Run(w.Config.API.Port) diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index d4da8bbf..d10f9dbb 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -37,23 +37,16 @@ type ( Secret string } - // Certificate represents the optional cert and key to enable TLS - Certificate struct { - Cert string - Key string - } - // Config represents the worker configuration. Config struct { - API *API - Build *Build - Executor *executor.Setup - Hostname string - Logger *Logger - Queue *queue.Setup - Runtime *runtime.Setup - Server *Server - Certificate *Certificate + API *API + Build *Build + Executor *executor.Setup + Hostname string + Logger *Logger + Queue *queue.Setup + Runtime *runtime.Setup + Server *Server } // Worker represents all configuration and From c686e8c68fd5773e28f7d81e31283145fd1aeeac Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 28 Sep 2020 11:42:15 -0500 Subject: [PATCH 122/430] release: updates for v0.6.0-rc2 (#117) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 6d120f38..e19f6bf2 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.6.0-rc1 - github.com/go-vela/pkg-queue v0.6.0-rc1 - github.com/go-vela/pkg-runtime v0.6.0-rc1 - github.com/go-vela/sdk-go v0.6.0-rc1 - github.com/go-vela/types v0.6.0-rc1 + github.com/go-vela/pkg-executor v0.6.0-rc2 + github.com/go-vela/pkg-queue v0.6.0-rc2 + github.com/go-vela/pkg-runtime v0.6.0-rc2 + github.com/go-vela/sdk-go v0.6.0-rc2 + github.com/go-vela/types v0.6.0-rc2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 344d9f5a..015e9e32 100644 --- a/go.sum +++ b/go.sum @@ -119,20 +119,20 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.6.0-rc1 h1:MgjofP4VO+8YFloK1GQBq5PoKCLQDegWBEB6zeEnyrU= -github.com/go-vela/compiler v0.6.0-rc1/go.mod h1:q+06ngm8r84Z03TUHmMkhHY7CZHlax8uPjSZf5l/Bl8= -github.com/go-vela/mock v0.6.0-rc1 h1:hB2NEEpaF65plE97AJXn4NY2OW7xnd5cvuSAAuzJ/ts= -github.com/go-vela/mock v0.6.0-rc1/go.mod h1:6k2CK115mHb8gaGSJXvL6lcfanuz77FL9T5D9Afc1sU= -github.com/go-vela/pkg-executor v0.6.0-rc1 h1:+2fkna9hydugMHufDjN/FsY+bNxUzKUv992f0wk4mjM= -github.com/go-vela/pkg-executor v0.6.0-rc1/go.mod h1:vW2zHQnzcq03Ul9hZ1SmLbzcqNOC9H/u9YgPzULnlt0= -github.com/go-vela/pkg-queue v0.6.0-rc1 h1:4+uqWQAt0MGoKp3Hos61XholqD4wj6Ui338RGiglcU0= -github.com/go-vela/pkg-queue v0.6.0-rc1/go.mod h1:+HEN2Sorq9E2pIT85Lq8wOjQyKEpxm25948KmfwegBc= -github.com/go-vela/pkg-runtime v0.6.0-rc1 h1:ebmRYsJzAMYkN2WfBTnRWmJfQ60sfDwkk5hjYiHbfTU= -github.com/go-vela/pkg-runtime v0.6.0-rc1/go.mod h1:xnRoucOQVR929DUr8OHeXPoqIgefFOPuM8jed4UVRI4= -github.com/go-vela/sdk-go v0.6.0-rc1 h1:eReCh4EcD7Gx8bteOemupQredcv/IGq6JdUp0TfHDNs= -github.com/go-vela/sdk-go v0.6.0-rc1/go.mod h1:aA3hHdSp6X81QuhlUmTNHi1DGf/KxBR3URfbWxDHIGM= -github.com/go-vela/types v0.6.0-rc1 h1:/ZSdzpaVvDr7nbltSdzpU7OyWooDDbiHVhDyjLMQtf4= -github.com/go-vela/types v0.6.0-rc1/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/compiler v0.6.0-rc2 h1:l/Gn8k3iAlMtScDi8j70RjNWOH4oo36sA+mc1CsYTzE= +github.com/go-vela/compiler v0.6.0-rc2/go.mod h1:m6M4amIf01yF5gBjuRFj8rugNOyutjo39bTbaM6m/xA= +github.com/go-vela/mock v0.6.0-rc2 h1:oySYmHJFEn7aOFycwNNmwu88MestXSmBcDK+FZrBV7E= +github.com/go-vela/mock v0.6.0-rc2/go.mod h1:wh/PsOE/cHxxHHleVaa0ijKRfkHjoLpz1lff8dmMSgY= +github.com/go-vela/pkg-executor v0.6.0-rc2 h1:+xEN2BYmDWvszKL/GRr7H0ph/vkFjNhNUHYf0F27uX8= +github.com/go-vela/pkg-executor v0.6.0-rc2/go.mod h1:XpNw4o3WzjaBMt5jsmXUb8MV9Pnj0LeXeCUI5YPNlgw= +github.com/go-vela/pkg-queue v0.6.0-rc2 h1:yXNBpm7+ERbcwUL9gGVxjfu81NmL0+2UIjFTZwDKcRA= +github.com/go-vela/pkg-queue v0.6.0-rc2/go.mod h1:bYKC+OP8pW8bUCFiygl9oLaGbKHBgLfVhkUb2YlCzMA= +github.com/go-vela/pkg-runtime v0.6.0-rc2 h1:XfHa+VN9IveW9an2t8Gw2YOwohoyQM6KktSxZib1Wy8= +github.com/go-vela/pkg-runtime v0.6.0-rc2/go.mod h1:RBWvCSbqsrDhLK1162lJ2HS3XqlQ1X5wUHsOAPyQLiA= +github.com/go-vela/sdk-go v0.6.0-rc2 h1:e+4ELUS090Fe2IExopQHdLDsNGwa8NJVtUvewyL6F38= +github.com/go-vela/sdk-go v0.6.0-rc2/go.mod h1:GEKBpryXBFDixLQFZYbeUJP4H+7/tbxmgAYln9U+XOI= +github.com/go-vela/types v0.6.0-rc2 h1:u8lBGH7Ieab8b9k6dyO701s1/IOvqm0Sb36VIoaaw5o= +github.com/go-vela/types v0.6.0-rc2/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From a2a531227765b3505cbf9d0942e07725736fd015 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Tue, 29 Sep 2020 13:53:44 -0500 Subject: [PATCH 123/430] release: updates for v0.6.0 (#118) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index e19f6bf2..58266b9a 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/coreos/go-semver v0.3.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.6.0-rc2 - github.com/go-vela/pkg-queue v0.6.0-rc2 - github.com/go-vela/pkg-runtime v0.6.0-rc2 - github.com/go-vela/sdk-go v0.6.0-rc2 - github.com/go-vela/types v0.6.0-rc2 + github.com/go-vela/pkg-executor v0.6.0 + github.com/go-vela/pkg-queue v0.6.0 + github.com/go-vela/pkg-runtime v0.6.0 + github.com/go-vela/sdk-go v0.6.0 + github.com/go-vela/types v0.6.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 015e9e32..fd1f27db 100644 --- a/go.sum +++ b/go.sum @@ -119,20 +119,20 @@ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GO github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.6.0-rc2 h1:l/Gn8k3iAlMtScDi8j70RjNWOH4oo36sA+mc1CsYTzE= -github.com/go-vela/compiler v0.6.0-rc2/go.mod h1:m6M4amIf01yF5gBjuRFj8rugNOyutjo39bTbaM6m/xA= -github.com/go-vela/mock v0.6.0-rc2 h1:oySYmHJFEn7aOFycwNNmwu88MestXSmBcDK+FZrBV7E= -github.com/go-vela/mock v0.6.0-rc2/go.mod h1:wh/PsOE/cHxxHHleVaa0ijKRfkHjoLpz1lff8dmMSgY= -github.com/go-vela/pkg-executor v0.6.0-rc2 h1:+xEN2BYmDWvszKL/GRr7H0ph/vkFjNhNUHYf0F27uX8= -github.com/go-vela/pkg-executor v0.6.0-rc2/go.mod h1:XpNw4o3WzjaBMt5jsmXUb8MV9Pnj0LeXeCUI5YPNlgw= -github.com/go-vela/pkg-queue v0.6.0-rc2 h1:yXNBpm7+ERbcwUL9gGVxjfu81NmL0+2UIjFTZwDKcRA= -github.com/go-vela/pkg-queue v0.6.0-rc2/go.mod h1:bYKC+OP8pW8bUCFiygl9oLaGbKHBgLfVhkUb2YlCzMA= -github.com/go-vela/pkg-runtime v0.6.0-rc2 h1:XfHa+VN9IveW9an2t8Gw2YOwohoyQM6KktSxZib1Wy8= -github.com/go-vela/pkg-runtime v0.6.0-rc2/go.mod h1:RBWvCSbqsrDhLK1162lJ2HS3XqlQ1X5wUHsOAPyQLiA= -github.com/go-vela/sdk-go v0.6.0-rc2 h1:e+4ELUS090Fe2IExopQHdLDsNGwa8NJVtUvewyL6F38= -github.com/go-vela/sdk-go v0.6.0-rc2/go.mod h1:GEKBpryXBFDixLQFZYbeUJP4H+7/tbxmgAYln9U+XOI= -github.com/go-vela/types v0.6.0-rc2 h1:u8lBGH7Ieab8b9k6dyO701s1/IOvqm0Sb36VIoaaw5o= -github.com/go-vela/types v0.6.0-rc2/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/compiler v0.6.0 h1:Z0kaz3nfCxAFBnbzuT2qoj5JjlbGckCmpjVr16PtDJM= +github.com/go-vela/compiler v0.6.0/go.mod h1:chxdAtFcUfJFaewZ5kupqIEjuH+zbK0MDNVc5+Yx4Bg= +github.com/go-vela/mock v0.6.0 h1:1ZS/UsCcCoOY/Y2Zmf6MxkNNQyeis4vbakoxzKNJxCE= +github.com/go-vela/mock v0.6.0/go.mod h1:ql7Db2MSvHhlzp8D6Kx1oi1KwHgm8VK2zrv55QPP4S4= +github.com/go-vela/pkg-executor v0.6.0 h1:lf04Z3/Ud89sn+mFSMAtwCpVF7AlUw64d5lO8jKxkTc= +github.com/go-vela/pkg-executor v0.6.0/go.mod h1:xjQwKhGY2fX8s/Av/xLIB+trk1d8PJyEabiFz8eQE9g= +github.com/go-vela/pkg-queue v0.6.0 h1:8lOntes/6iSzKnXvO2zyvZI2iPwEnA4/7YD0UIIOJE4= +github.com/go-vela/pkg-queue v0.6.0/go.mod h1:hhTidV8kpbL88TDE7UTv1j2ZqnUYD2Q8jhrGE/RFNfg= +github.com/go-vela/pkg-runtime v0.6.0 h1:pPW8nNAJAZzUp0EnETD7zyjDnj3ppd0EB07igcb84xk= +github.com/go-vela/pkg-runtime v0.6.0/go.mod h1:gwXKAgFQuQwpshjcwii7LnFWPXzBfTZcj1CJ5wkqGvE= +github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= +github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= +github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= +github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 90cdf3feeef2152abf51e736be67630fe9b09c77 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 19 Oct 2020 12:45:22 -0500 Subject: [PATCH 124/430] feat: use new version pkg (#119) --- .github/workflows/prerelease.yml | 10 ++- .github/workflows/publish.yml | 5 +- Makefile | 45 ++++++++++- api/version.go | 34 +++++++++ cmd/vela-worker/main.go | 2 +- go.mod | 4 +- go.sum | 2 + router/middleware/header.go | 14 ++-- router/middleware/header_test.go | 124 ------------------------------- router/router.go | 5 ++ router/router_test.go | 6 ++ version/version.go | 59 +++++++++++---- 12 files changed, 149 insertions(+), 161 deletions(-) create mode 100644 api/version.go diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index aa9b519f..dcb3f233 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -17,15 +17,17 @@ jobs: - name: clone uses: actions/checkout@v2 + - name: setup + run: | + # setup git tag in Actions environment + echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: build env: GOOS: linux CGO_ENABLED: '0' run: | - go build -a \ - -ldflags '-s -w -extldflags "-static"' \ - -o release/vela-worker \ - github.com/go-vela/worker/cmd/vela-worker + make build-static-ci - name: publish uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f68b857..21dff1d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,10 +21,7 @@ jobs: GOOS: linux CGO_ENABLED: '0' run: | - go build -a \ - -ldflags '-s -w -extldflags "-static"' \ - -o release/vela-worker \ - github.com/go-vela/worker/cmd/vela-worker + make build-static-ci - name: publish uses: elgohr/Publish-Docker-Github-Action@master diff --git a/Makefile b/Makefile index 4e9505b0..9d673a47 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,30 @@ # # Use of this source code is governed by the LICENSE file in this repository. +# capture the current date we build the application from +BUILD_DATE = $(shell date +%Y-%m-%dT%H:%M:%SZ) + +# check if a git commit sha is already set +ifndef GITHUB_SHA + # capture the current git commit sha we build the application from + GITHUB_SHA = $(shell git rev-parse HEAD) +endif + +# check if a git tag is already set +ifndef GITHUB_TAG + # capture the current git tag we build the application from + GITHUB_TAG = $(shell git describe --tag --abbrev=0) +endif + +# check if a go version is already set +ifndef GOLANG_VERSION + # capture the current go version we build the application from + GOLANG_VERSION = $(shell go version | awk '{ print $$3 }') +endif + +# create a list of linker flags for building the golang application +LD_FLAGS = -X github.com/go-vela/worker/version.Commit=${GITHUB_SHA} -X github.com/go-vela/worker/version.Date=${BUILD_DATE} -X github.com/go-vela/worker/version.Go=${GOLANG_VERSION} -X github.com/go-vela/worker/version.Tag=${GITHUB_TAG} + # The `clean` target is intended to clean the workspace # and prepare the local changes for submission. # @@ -78,7 +102,7 @@ fix: test: @echo @echo "### Testing Go Code" - @go test -race ./... + @go test ./... # The `test-cover` target is intended to run # the tests for the Go source code and then @@ -89,7 +113,7 @@ test: test-cover: @echo @echo "### Creating test coverage report" - @go test -race -covermode=atomic -coverprofile=coverage.out ./... + @go test -covermode=atomic -coverprofile=coverage.out ./... @echo @echo "### Opening test coverage report" @go tool cover -html=coverage.out @@ -104,6 +128,7 @@ build: @echo "### Building release/vela-worker binary" GOOS=linux CGO_ENABLED=0 \ go build -a \ + -ldflags '${LD_FLAGS}' \ -o release/vela-worker \ github.com/go-vela/worker/cmd/vela-worker @@ -117,7 +142,21 @@ build-static: @echo "### Building static release/vela-worker binary" GOOS=linux CGO_ENABLED=0 \ go build -a \ - -ldflags '-s -w -extldflags "-static"' \ + -ldflags '-s -w -extldflags "-static" ${LD_FLAGS}' \ + -o release/vela-worker \ + github.com/go-vela/worker/cmd/vela-worker + +# The `build-static-ci` target is intended to compile +# the Go source code into a statically linked binary +# when used within a CI environment. +# +# Usage: `make build-static-ci` +.PHONY: build-static-ci +build-static-ci: + @echo + @echo "### Building CI static release/vela-worker binary" + @go build -a \ + -ldflags '-s -w -extldflags "-static" ${LD_FLAGS}' \ -o release/vela-worker \ github.com/go-vela/worker/cmd/vela-worker diff --git a/api/version.go b/api/version.go new file mode 100644 index 00000000..046ae1ff --- /dev/null +++ b/api/version.go @@ -0,0 +1,34 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/worker/version" +) + +// swagger:operation GET /version router Version +// +// Get the version of the Vela API +// +// --- +// x-success_http_code: '200' +// produces: +// - application/json +// parameters: +// responses: +// '200': +// description: Successfully retrieved the Vela API version +// schema: +// type: string + +// Version represents the API handler to +// report the version information for Vela. +func Version(c *gin.Context) { + c.JSON(http.StatusOK, version.New()) +} diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 79b2a838..33ae9781 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -53,7 +53,7 @@ func main() { app.Compiled = time.Now() app.Action = run - app.Version = version.Version.String() + app.Version = version.New().Semantic() // Worker Flags diff --git a/go.mod b/go.mod index 58266b9a..0a906ac9 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/coreos/go-semver v0.3.0 + github.com/Masterminds/semver v1.5.0 github.com/gin-gonic/gin v1.6.3 github.com/go-vela/pkg-executor v0.6.0 github.com/go-vela/pkg-queue v0.6.0 github.com/go-vela/pkg-runtime v0.6.0 github.com/go-vela/sdk-go v0.6.0 - github.com/go-vela/types v0.6.0 + github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index fd1f27db..61e258e0 100644 --- a/go.sum +++ b/go.sum @@ -133,6 +133,8 @@ github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= +github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 h1:ck0Ylos/ExUCluEqQgVxKrTZ21nsup0VZT31sWqTU4Y= +github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538/go.mod h1:6r6mWIPrTANBpHwAFAIii64VKtzlAzVagbm/wX5bHHk= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= diff --git a/router/middleware/header.go b/router/middleware/header.go index 20dad7d2..7d89108b 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -57,13 +57,12 @@ func Secure(c *gin.Context) { // information into the request so it will be logged. This is // intended for debugging and troubleshooting. func RequestVersion(c *gin.Context) { - apiVersion := version.Version + v := version.New() if gin.Mode() == "debug" { - c.Request.Header.Set("X-Vela-Version", apiVersion.String()) + c.Request.Header.Set("X-Vela-Version", v.Semantic()) } else { // in prod we don't want the build number metadata - apiVersion.Metadata = "" - c.Request.Header.Set("X-Vela-Version", apiVersion.String()) + c.Request.Header.Set("X-Vela-Version", v.Semantic()) } } @@ -71,12 +70,11 @@ func RequestVersion(c *gin.Context) { // information into the response so it will be logged. This is // intended for debugging and troubleshooting. func ResponseVersion(c *gin.Context) { - apiVersion := version.Version + v := version.New() if gin.Mode() == "debug" { - c.Header("X-Vela-Version", apiVersion.String()) + c.Header("X-Vela-Version", v.Semantic()) } else { // in prod we don't want the build number metadata - apiVersion.Metadata = "" - c.Header("X-Vela-Version", apiVersion.String()) + c.Header("X-Vela-Version", v.Semantic()) } } diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index ed8493ac..632594b6 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -253,127 +253,3 @@ func TestMiddleware_Secure_TLS(t *testing.T) { t.Errorf("Secure Strict-Transport-Security is %v, want %v", gotSecurity, wantSecurity) } } - -func TestMiddleware_RequestVersion(t *testing.T) { - // setup types - wantVersion := "0.6.0" - - // setup context - gin.SetMode(gin.DebugMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) - - // setup mock server - engine.Use(RequestVersion) - engine.GET("/health", func(c *gin.Context) { - c.Status(http.StatusOK) - }) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - gotVersion := context.Request.Header.Get("X-Vela-Version") - - if resp.Code != http.StatusOK { - t.Errorf("RequestVersion returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(gotVersion, wantVersion) { - t.Errorf("RequestVersion X-Vela-Version is %v, want %v", gotVersion, wantVersion) - } -} - -func TestMiddleware_RequestVersion_Prod(t *testing.T) { - // setup types - wantVersion := "0.6.0" - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) - - // setup mock server - engine.Use(RequestVersion) - engine.GET("/health", func(c *gin.Context) { - c.Status(http.StatusOK) - }) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - gotVersion := context.Request.Header.Get("X-Vela-Version") - - if resp.Code != http.StatusOK { - t.Errorf("RequestVersion returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(gotVersion, wantVersion) { - t.Errorf("RequestVersion X-Vela-Version is %v, want %v", gotVersion, wantVersion) - } -} - -func TestMiddleware_ResponseVersion(t *testing.T) { - // setup types - wantVersion := "0.6.0" - - // setup context - gin.SetMode(gin.DebugMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) - - // setup mock server - engine.Use(ResponseVersion) - engine.GET("/health", func(c *gin.Context) { - c.Status(http.StatusOK) - }) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - gotVersion := context.Writer.Header().Get("X-Vela-Version") - - if resp.Code != http.StatusOK { - t.Errorf("ResponseVersion returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(gotVersion, wantVersion) { - t.Errorf("ResponseVersion X-Vela-Version is %v, want %v", gotVersion, wantVersion) - } -} - -func TestMiddleware_ResponseVersion_Prod(t *testing.T) { - // setup types - wantVersion := "0.6.0" - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) - - // setup mock server - engine.Use(ResponseVersion) - engine.GET("/health", func(c *gin.Context) { - c.Status(http.StatusOK) - }) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - gotVersion := context.Writer.Header().Get("X-Vela-Version") - - if resp.Code != http.StatusOK { - t.Errorf("ResponseVersion returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(gotVersion, wantVersion) { - t.Errorf("ResponseVersion X-Vela-Version is %v, want %v", gotVersion, wantVersion) - } -} diff --git a/router/router.go b/router/router.go index 5bf0f384..08370b82 100644 --- a/router/router.go +++ b/router/router.go @@ -86,6 +86,11 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET r.GET("/metrics", gin.WrapH(api.Metrics())) + // add an endpoint for reporting version information for the worker + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.GET + r.GET("/version", api.Version) + // add a collection of endpoints for handling API related requests // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group diff --git a/router/router_test.go b/router/router_test.go index bd117362..2a23e586 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -29,6 +29,12 @@ func TestRouter_Load(t *testing.T) { Handler: "github.com/go-vela/worker/api.Metrics", HandlerFunc: gin.WrapH(api.Metrics()), }, + { + Method: "GET", + Path: "/version", + Handler: "github.com/go-vela/worker/api.Version", + HandlerFunc: api.Version, + }, { Method: "POST", Path: "/api/v1/shutdown", diff --git a/version/version.go b/version/version.go index e4228153..6f09e1c4 100644 --- a/version/version.go +++ b/version/version.go @@ -4,23 +4,52 @@ package version -import "github.com/coreos/go-semver/semver" +import ( + "fmt" + "runtime" + + "github.com/Masterminds/semver" + + "github.com/go-vela/types/version" +) var ( - // VersionMajor is for an API incompatible changes. - VersionMajor int64 - // VersionMinor is for functionality in a backwards-compatible manner. - VersionMinor int64 = 6 - // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 - // VersionDev indicates build metadata. Releases will be empty string. - VersionDev string + // Arch represents the architecture information for the package. + Arch = runtime.GOARCH + // Commit represents the git commit information for the package. + Commit string + // Compiler represents the compiler information for the package. + Compiler = runtime.Compiler + // Date represents the build date information for the package. + Date string + // Go represents the golang version information for the package. + Go string + // OS represents the operating system information for the package. + OS = runtime.GOOS + // Tag represents the git tag information for the package. + Tag string ) -// Version is the specification version that the package types support. -var Version = semver.Version{ - Major: VersionMajor, - Minor: VersionMinor, - Patch: VersionPatch, - Metadata: VersionDev, +// New creates a new version object for Vela that is used throughout the application. +func New() *version.Version { + v, err := semver.NewVersion(Tag) + if err != nil { + fmt.Println(fmt.Errorf("unable to parse semantic version for %s: %v", Tag, err)) + } + + return &version.Version{ + Canonical: Tag, + Major: v.Major(), + Minor: v.Minor(), + Patch: v.Patch(), + PreRelease: v.Prerelease(), + Metadata: version.Metadata{ + Architecture: Arch, + BuildDate: Date, + Compiler: Compiler, + GitCommit: Commit, + GoVersion: Go, + OperatingSystem: OS, + }, + } } From 463ce5838e00ddf39b50d22f3e42a9476c21b652 Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Tue, 20 Oct 2020 09:42:36 -0500 Subject: [PATCH 125/430] chore(docker): publish alpine images (#120) --- .github/workflows/prerelease.yml | 10 ++++++++++ .github/workflows/publish.yml | 10 ++++++++++ Dockerfile-alpine | 15 +++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Dockerfile-alpine diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index dcb3f233..d08e2f58 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -37,3 +37,13 @@ jobs: tag_names: true username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: publish-alpine + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela-worker + cache: true + tags: "${{ env.GITHUB_TAG }}-alpine" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile-alpine diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 21dff1d6..20a0c211 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,3 +30,13 @@ jobs: cache: true username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: publish-alpine + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: target/vela-worker + cache: true + tags: "latest-alpine" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile-alpine diff --git a/Dockerfile-alpine b/Dockerfile-alpine new file mode 100644 index 00000000..978bc84d --- /dev/null +++ b/Dockerfile-alpine @@ -0,0 +1,15 @@ +# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# +# Use of this source code is governed by the LICENSE file in this repository. + +FROM alpine + +RUN apk add --update --no-cache ca-certificates + +EXPOSE 8080 + +ENV GODEBUG=netdns=go + +ADD release/vela-worker /bin/ + +CMD ["/bin/vela-worker"] From 781ffc67f8518b41f73456006c2a4cf3c64231ec Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 21 Oct 2020 08:51:26 -0500 Subject: [PATCH 126/430] fix: add fetch depth for tag history (#121) --- .github/workflows/prerelease.yml | 3 +++ .github/workflows/publish.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index d08e2f58..e0a7c28d 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -16,6 +16,9 @@ jobs: steps: - name: clone uses: actions/checkout@v2 + with: + # ensures we fetch tag history for the repository + fetch-depth: 0 - name: setup run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 20a0c211..7b20a1e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,6 +15,9 @@ jobs: steps: - name: clone uses: actions/checkout@v2 + with: + # ensures we fetch tag history for the repository + fetch-depth: 0 - name: build env: From 05fc12dc62fd484c4df47902a3b7a802b91119f0 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 29 Oct 2020 16:29:44 -0500 Subject: [PATCH 127/430] docs: update info for local development (#122) * docs: update info for local development * refactor: update strings to ' for consistency * chore: add secrets.env to gitignore * fix: typo in app name * docs: fix spelling mistakes * feat: add example secrets.env file * chore: reference secrets.env for ui service * refactor: update opening web ui page --- .github/CONTRIBUTING.md | 83 +++++----------- .github/DOCS.md | 34 ------- .github/README.md | 2 +- .github/SUPPORT.md | 2 +- .gitignore | 6 ++ DOCS.md | 204 ++++++++++++++++++++++++++++++++++++++++ cmd/vela-worker/main.go | 6 +- docker-compose.yml | 142 +++++++++++++++++++++++----- secrets.env.example | 48 ++++++++++ 9 files changed, 400 insertions(+), 127 deletions(-) delete mode 100644 .github/DOCS.md create mode 100644 DOCS.md create mode 100644 secrets.env.example diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 907b8320..b06d8f08 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,8 @@ # Contributing -We'd love to accept your contributions to this project! There are just a few guidelines you need to follow. +We'd love to accept your contributions to this project! + +There are just a few guidelines you need to follow. ## Bugs @@ -21,11 +23,7 @@ We are always open to new PRs! You can follow the below guide for learning how y ### Prerequisites * [Review the commit guide we follow](https://chris.beams.io/posts/git-commit/#seven-rules) - ensure your commits follow our standards -* [Docker](https://docs.docker.com/install/) - building block for local development -* [Docker Compose](https://docs.docker.com/compose/install/) - start up local development -* [Golang](https://golang.org/dl/) - for source code and [dependency management](https://github.com/golang/go/wiki/Modules) -* _optional but recommended_ [Make](https://www.gnu.org/software/make/) - start up local development -* _optional but recommended_ [go-vela/server](https://github.com/go-vela/server) - start up local development +* [Review the local development docs](../DOCS.md) - ensures you have the Vela application stack running locally ### Setup @@ -34,103 +32,64 @@ We are always open to new PRs! You can follow the below guide for learning how y * Clone this repository to your workstation: ```bash -# Clone the project +# clone the project git clone git@github.com:go-vela/worker.git $HOME/go-vela/worker ``` * Navigate to the repository code: ```bash -# Change into the project directory +# change into the cloned project directory cd $HOME/go-vela/worker ``` * Point the original code at your fork: ```bash -# Add a remote branch pointing to your fork +# add a remote branch pointing to your fork git remote add fork https://github.com/your_fork/worker ``` -### Running Locally +### Development -**If you haven't already, please see the [Vela server documentation](https://github.com/go-vela/server/blob/master/.github/DOCS.md) to create the services necessary for executing builds locally.** +**Please review the [local development documentation](../DOCS.md) for more information.** * Navigate to the repository code: ```bash -# Change into the project directory +# change into the cloned project directory cd $HOME/go-vela/worker ``` -* Build the repository code: - -```bash -# Build the code with `make` -make build - -# Build the code with `go` -GOOS=linux CGO_ENABLED=0 go build -o release/vela-worker github.com/go-vela/worker/cmd/server -``` +* Write your code and tests to implement the changes you desire. + * Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules) -* Run the repository code: +* Run the repository code (ensures your changes perform as you desire): ```bash -# Run the code with `make` +# execute the `up` target with `make` make up - -# Run the code with `docker-compose` -docker-compose -f docker-compose.yml up -d --build ``` -* For rebuilding the repository code: +* Test the repository code (ensures your changes don't break existing functionality): ```bash -# Rebuild the code with `make` -make rebuild - -# Rebuild the code with `docker-compose` -docker-compose -f docker-compose.yml build +# execute the `test` target with `make` +make test ``` -### Development - -**Please see our [local development documentation](DOCS.md) for more information.** - -* Navigate to the repository code: +* Clean the repository code (ensures your code meets the project standards): ```bash -# Change into the project directory -cd $HOME/go-vela/worker -``` - -* Write your code and [test locally](#running-locally) - - Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules) - -* Write tests for your changes and ensure they pass: - -```bash -# Test the code with `go` -go test ./... -``` - -* Ensure your code meets the project standards: - -```bash -# Clean the code with `make` +# execute the `clean` target with `make` make clean - -# Clean the code with `go` -go mod tidy -go fmt ./... -go vet ./... ``` * Push to your fork: ```bash -# Push your code up to your fork +# push your code up to your fork git push fork master ``` -* Open a pull request. Thank you for your contribution! +* Open a pull request. Thank you for your contribution! \ No newline at end of file diff --git a/.github/DOCS.md b/.github/DOCS.md deleted file mode 100644 index e32ca904..00000000 --- a/.github/DOCS.md +++ /dev/null @@ -1,34 +0,0 @@ -# Documentation - -For installation and usage, please [visit our docs](https://go-vela.github.io/docs). - -**If you haven't already, please see the [Vela server documentation](https://github.com/go-vela/server/blob/master/.github/DOCS.md) to create the services necessary for executing builds locally.** - -## Services - -If you followed [the instructions from the contributing guide](CONTRIBUTING.md/#getting-started), you should have 2 services running as Docker containers on your machine: - -* worker_1 -* worker_2 - -### Worker - -The `worker_1` and `worker_2` services are running the exact same code. The [docker-compose](../docker-compose.yml) file is already setup to connect will the other services (`redis` and `postgres`) as well as the Vela server service you can create from the [getting started section](CONTRIBUTING.md/#getting-started). - -### Vault - -The `vault` service hosts the Vault store used for integration with one of Vela's secret engine implementations. - -## API - -Coming soon! - -## CLI - -Coming soon! - -## Executing Builds - -In order to execute builds on your local machine, you'll also need to create a Vela server to push the workloads to the `redis` queue. - -To create the server, you can follow the [documentation](https://github.com/go-vela/server/blob/master/.github/DOCS.md) found in the [go-vela/server](https://github.com/go-vela/server) repository. diff --git a/.github/README.md b/.github/README.md index a5d5d0c9..059a19df 100644 --- a/.github/README.md +++ b/.github/README.md @@ -17,7 +17,7 @@ Vela uses a syntax similar to [Docker Compose](https://docs.docker.com/compose/) For installation and usage, please [visit our user docs](https://go-vela.github.io/docs). -For local development, please [visit our repo docs](DOCS.md). +For local development, please [visit our repo docs](../DOCS.md). ## Contributing diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index c5db8342..89dff2bf 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -16,7 +16,7 @@ Please see our [documentation](https://go-vela.github.io/docs) site for more inf ## Local Development -Please see our [local development documentation](DOCS.md) for more information. +Please see our [local development documentation](../DOCS.md) for more information. ## Questions diff --git a/.gitignore b/.gitignore index 8bc8c224..b8ac6f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,9 @@ release/ *.ipr *.iws *.xml + +# Secrets environment file +secrets.env + +# Files to be excluded. +.DS_Store diff --git a/DOCS.md b/DOCS.md new file mode 100644 index 00000000..4237b947 --- /dev/null +++ b/DOCS.md @@ -0,0 +1,204 @@ +# Documentation + +This document intends to provide information on how to get the Vela application running locally. + +For more information, please see our [installation docs](https://go-vela.github.io/docs/install/). + +## Prerequisites + +This section covers the dependencies required to get the Vela application running locally. + +* [Docker](https://docs.docker.com/install/) - building block for local development +* [Docker Compose](https://docs.docker.com/compose/install/) - start up local development +* [Github OAuth Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) - building block for local development +* [Golang](https://golang.org/dl/) - for source code and [dependency management](https://github.com/golang/go/wiki/Modules) +* [Make](https://www.gnu.org/software/make/) - start up local development + +## Setup + +**NOTE: Please review the [prerequisites section](#prerequisites) before moving forward.** + +This section covers the configuration required to get the Vela application running locally. + +* Clone this repository to your workstation: + +```bash +# clone the project +git clone git@github.com:go-vela/worker.git $HOME/go-vela/worker +``` + +* Navigate to the repository code: + +```bash +# change into the cloned project directory +cd $HOME/go-vela/worker +``` + +* If using GitHub Enterprise (default: `https://github.com/`), add the Web URL to a local `secrets.env` file: + +```bash +# add Github Enterprise Web URL to local secrets file for `docker-compose` +echo "VELA_SOURCE_URL=" >> secrets.env +``` + +* Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: + * `Application name` = `Vela - local` (name of the OAuth application shouldn't matter) + * `Homepage URL` = `http://localhost:8080` (base URL of the server) + * `Authorization callback URL` = `http://localhost:8888/account/authenticate` (authenticate endpoint of the base URL of the UI) + +* Add OAuth client secrets to a local `secrets.env` file: + +```bash +# add Github Client ID to local secrets file for `docker-compose` +echo "VELA_SOURCE_CLIENT=" >> secrets.env + +# add Github Client Secret to local secrets file for `docker-compose` +echo "VELA_SOURCE_SECRET=" >> secrets.env +``` + +## Start + +**NOTE: Please review the [setup section](#setup) before moving forward.** + +This section covers the commands required to get the Vela application running locally. + +* Navigate to the repository code: + +```bash +# change into the cloned project directory +cd $HOME/go-vela/worker +``` + +* Run the repository code: + +```bash +# execute the `up` target with `make` +make up +``` + +* Navigate to the web UI: + +```bash +# opens a browser window to the page http://localhost:8888 +open http://localhost:8888 +``` + +## Repo + +**NOTE: Please review the [start section](#start) before moving forward.** + +In order to run a build in Vela, you'll need to add a repo to the locally running system. + +
click to reveal content +

+ +1. Navigate to the `Source Repositories` page @ http://localhost:8888/account/source-repos + * For convenience, you can reference our documentation to [learn how to enable a repo](https://go-vela.github.io/docs/usage/getting-started/enable_repo/). + +2. Click the blue drop down arrow on the left side next to the org that contains the repo you want to enable. + +3. Find the repo you want to enable in the drop down list and click the blue `Enable` button on the right side. + * You should received a `success` message telling you `/ enabled.` + +4. Click the blue `View` button to navigate directly to the repo. + * You should be redirected to http://localhost:8888// + +

+
+ +## Pipeline + +**NOTE: Please review the [repo section](#repo) before moving forward.** + +In order to run a build in Vela, you'll need to add a pipeline to the repo that has been added to the locally running system. + +
click to reveal content +

+ +1. Create a Vela [pipeline](https://go-vela.github.io/docs/concepts/pipeline/) to define a workflow for Vela to run. + * For conveinence, you can reference our documentation to use [one of our sample pipelines](https://go-vela.github.io/docs/usage/samples/). + +2. Add the pipeline to the repo that was enabled above. + +

+
+ +## Build + +**NOTE: Please review the [pipeline section](#pipeline) before moving forward.** + +In order to run a build in Vela, you'll need to capture a valid webhook payload to mock sending it to the locally running system. + +
click to reveal content +

+ +1. Review GitHub's [documentation on webhooks](https://developer.github.com/webhooks/) + +2. Find the [recent delivery](https://developer.github.com/webhooks/testing/#listing-recent-deliveries) for the pipeline that was added to your repo. + +3. Create a request locally for http://localhost:8080/webhook and replicate all parts from the recent delivery. + * You should use whatever tool feels most comfortable and natural to you (`curl`, `Postman`, `Insomnia` etc.). + * You should replicate all the request headers and the request body from the recent delivery. + +4. Send the request and navigate directly to the repo (http://localhost:8888//) to watch the build run live. + +

+
+ +## Services + +This section covers the different services in the stack when the Vela application is running locally. + +
click to reveal content +

+ +### Server + +The `server` Docker compose service hosts the Vela server and API. + +This component is used for processing web requests and managing resources in the database and publishing builds to the FIFO queue. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/server/). + +### Worker + +The `worker` Docker compose service hosts the Vela build daemon. + +This component is used for pulling builds from the FIFO queue and executing them based off their configuration. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/worker/). + +### UI + +The `ui` Docker compose service hosts the Vela UI. + +This component is used for providing a user-friendly interface for triggering actions in the Vela system. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/ui/). + +### Redis + +The `redis` Docker compose service hosts the Redis database. + +This component is used for publishing builds to a FIFO queue. + +For more information, please review [the official documentation](https://redis.io/). + +### Postgres + +The `postgres` Docker compose service hosts the Postgresql database. + +This component is used for storing data at rest. + +For more information, please review [the official documentation](https://www.postgresql.org/). + +### Vault + +The `vault` Docker compose service hosts the HashiCorp Vault instance. + +This component is used for storing sensitive data like secrets. + +For more information, please review [the official documentation](https://www.vaultproject.io/). + +

+
\ No newline at end of file diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 33ae9781..9e9ed123 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -39,8 +39,8 @@ func main() { // Worker Information app.Name = "vela-worker" - app.HelpName = "vela-executor" - app.Usage = "Vela executor package for integrating with different executors" + app.HelpName = "vela-worker" + app.Usage = "Vela build daemon designed for executing pipelines" app.Copyright = "Copyright (c) 2020 Target Brands, Inc. All rights reserved." app.Authors = []*cli.Author{ { @@ -51,8 +51,8 @@ func main() { // Worker Metadata - app.Compiled = time.Now() app.Action = run + app.Compiled = time.Now() app.Version = version.New().Semantic() // Worker Flags diff --git a/docker-compose.yml b/docker-compose.yml index fe672327..6b346e09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,18 @@ version: '3' services: - worker_1: + # The `worker` compose service hosts the Vela build daemon. + # + # This component is used for pulling builds from the FIFO + # queue and executing them based off their configuration. + # + # https://go-vela.github.io/docs/concepts/infrastructure/worker/ + worker: build: context: . - container_name: worker_1 + dockerfile: Dockerfile + container_name: worker image: worker:local - hostname: http://worker_1 networks: - vela environment: @@ -18,42 +24,126 @@ services: VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis - VELA_QUEUE_CONFIG: redis://redis:6379 - VELA_QUEUE_WORKER_ROUTES: large,docker,large:docker + VELA_QUEUE_CONFIG: 'redis://redis:6379' + VELA_QUEUE_WORKER_ROUTES: 'docker,local,docker:local' VELA_RUNTIME_DRIVER: docker - VELA_SERVER_ADDR: http://vela:8080 - VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh + VELA_SERVER_ADDR: 'http://server:8080' + VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' restart: always ports: - "8081:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock" + depends_on: + - server - worker_2: - build: - context: . - container_name: worker_2 - image: worker:local - hostname: http://worker_2 + # The `server` compose service hosts the Vela server and API. + # + # This component is used for processing web requests and + # managing resources in the database and publishing + # builds to the FIFO queue. + # + # https://go-vela.github.io/docs/concepts/infrastructure/server/ + server: + container_name: server + image: target/vela-server:latest networks: - vela environment: - VELA_BUILD_LIMIT: 1 - VELA_BUILD_TIMEOUT: 30m + VELA_ADDR: 'http://localhost:8080' + VELA_WEBUI_ADDR: 'http://ui:80' + VELA_DATABASE_DRIVER: postgres + VELA_DATABASE_CONFIG: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' VELA_LOG_LEVEL: trace VELA_QUEUE_DRIVER: redis - VELA_QUEUE_CONFIG: redis://redis:6379 - VELA_QUEUE_WORKER_ROUTES: small,docker,small:docker - VELA_RUNTIME_DRIVER: docker - VELA_SERVER_ADDR: http://vela:8080 - VELA_SERVER_SECRET: zB7mrKDTZqNeNTD8z47yG4DHywspAh + VELA_QUEUE_CONFIG: 'redis://redis:6379' + VELA_QUEUE_WORKER_ROUTES: 'docker,local,docker:local' + VELA_PORT: ':8080' + VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' + VELA_SOURCE_DRIVER: github + VELA_SECRET_VAULT: 'true' + VELA_SECRET_VAULT_ADDR: 'http://vault:8200' + VELA_SECRET_VAULT_TOKEN: vela + VELA_DISABLE_WEBHOOK_VALIDATION: 'true' + env_file: + - secrets.env restart: always ports: - - "8082:8080" - volumes: - - "/var/run/docker.sock:/var/run/docker.sock" + - '8080:8080' + depends_on: + - postgres + - redis + - vault + + # The `ui` compose service hosts the Vela UI. + # + # This component is used for providing a user-friendly + # interface for triggering actions in the Vela system. + # + # https://go-vela.github.io/docs/concepts/infrastructure/ui/ + ui: + container_name: ui + image: target/vela-ui:latest + networks: + - vela + environment: + VELA_API: 'http://localhost:8080' + env_file: + - secrets.env + restart: always + ports: + - '8888:80' + depends_on: + - server + + # The `redis` compose service hosts the Redis database. + # + # This component is used for publishing builds to a FIFO queue. + # + # https://redis.io/ + redis: + container_name: redis + image: redis:5-alpine + networks: + - vela + ports: + - '6379:6379' + + # The `postgres` compose service hosts the Postgresql database. + # + # This component is used for storing data at rest. + # + # https://www.postgresql.org/ + postgres: + container_name: postgres + image: postgres:12-alpine + networks: + - vela + environment: + POSTGRES_DB: vela + POSTGRES_PASSWORD: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' + POSTGRES_USER: vela + ports: + - '5432:5432' + + # The `vault` compose service hosts the HashiCorp Vault instance. + # + # This component is used for storing sensitive data like secrets. + # + # https://www.vaultproject.io/ + vault: + image: vault:latest + container_name: vault + command: server -dev + networks: + - vela + environment: + VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200 + VAULT_DEV_ROOT_TOKEN_ID: vela + ports: + - '8200:8200' + cap_add: + - IPC_LOCK networks: - vela: - external: - name: server_vela + vela: \ No newline at end of file diff --git a/secrets.env.example b/secrets.env.example new file mode 100644 index 00000000..1649879d --- /dev/null +++ b/secrets.env.example @@ -0,0 +1,48 @@ +################## +# __ __ ___ # +# | | | || | # +# | | | || | # +# | |_| || | # +# | || | # +# | || | # +# |_______||___| # +# # +################## + +# These are used by the ui service +# defined in the docker compose stack + +# customize the location where you want users to provide feedack +# +# default: https://github.com/go-vela/ui/issues/new +# VELA_FEEDBACK_URL= + +# customize the location where users can review documentation +# +# default: https://go-vela.github.io/docs +# VELA_DOCS_URL= + +############################################################ +# _______ _______ ______ __ __ _______ ______ # +# | || || _ | | | | || || _ | # +# | _____|| ___|| | || | |_| || ___|| | || # +# | |_____ | |___ | |_||_ | || |___ | |_||_ # +# |_____ || ___|| __ || || ___|| __ | # +# _____| || |___ | | | | | | | |___ | | | | # +# |_______||_______||___| |_| |___| |_______||___| |_| # +# # +############################################################ + +# These are used by the server service +# defined in the docker compose stack + +# github web url (only required if using GitHub Enterprise) +# +# default: https://github.com/ +# VELA_SOURCE_URL= + +# github client id from oauth application +VELA_SOURCE_CLIENT= + +# github client secret from oauth application +VELA_SOURCE_SECRET= From a864818dd8c5a3322cc701a8f71f68a2c3e8abc6 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Mon, 16 Nov 2020 11:08:47 -0600 Subject: [PATCH 128/430] feat: phone home to server on time interval (#124) --- cmd/vela-worker/flags.go | 7 +++++ cmd/vela-worker/operate.go | 32 +++++++++++++++++++++++ cmd/vela-worker/register.go | 51 +++++++++++++++++++++++++++++++++++++ cmd/vela-worker/run.go | 2 ++ cmd/vela-worker/worker.go | 1 + docker-compose.yml | 2 ++ go.mod | 4 +-- go.sum | 26 +++++++++++++++++++ 8 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 cmd/vela-worker/register.go diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 6cfa8e87..f22833e0 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -26,6 +26,13 @@ func flags() []cli.Flag { Usage: "set hostname for the worker", }, + &cli.DurationFlag{ + EnvVars: []string{"WORKER_CHECK_IN", "VELA_CHECK_IN", "CHECK_IN"}, + Name: "checkIn", + Usage: "time to wait in between checking in with the server", + Value: 15 * time.Minute, + }, + // API Flags &cli.StringFlag{ diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 74db765a..747c03c5 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -5,7 +5,10 @@ package main import ( + "time" + "github.com/go-vela/pkg-queue/queue" + "github.com/go-vela/types/library" "github.com/sirupsen/logrus" @@ -23,6 +26,35 @@ func (w *Worker) operate() error { if err != nil { return err } + // Define the database representation of the worker + // and register itself in the database + registryWorker := new(library.Worker) + registryWorker.SetHostname(w.Config.Hostname) + registryWorker.SetAddress(w.Config.Server.Address) + registryWorker.SetRoutes(w.Config.Queue.Routes) + registryWorker.SetActive(true) + registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + err = w.register(registryWorker) + if err != nil { + logrus.Error(err) + } + + // spawn goroutine for phoning home + go func() { + for { + // sleep for the configured time + time.Sleep(w.Config.CheckIn) + + // set checking time to now and call the server + registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + _, _, err := w.VelaClient.Worker.Update(registryWorker.GetHostname(), registryWorker) + + // if unable to update the worker, log the error but allow the worker to continue running + if err != nil { + logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) + } + } + }() // setup the queue // diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go new file mode 100644 index 00000000..d1f11153 --- /dev/null +++ b/cmd/vela-worker/register.go @@ -0,0 +1,51 @@ +// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package main + +import ( + "fmt" + "net/http" + + "github.com/go-vela/types/library" + "github.com/sirupsen/logrus" +) + +// register is a helper function to register +// the worker in the database, updating the item +// if the worker already exists +func (w *Worker) register(config *library.Worker) error { + // check to see if the worker already exists in the database + _, resp, err := w.VelaClient.Worker.Get(config.GetHostname()) + if err != nil { + // check to see if the response was nil + if resp == nil { + return fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) + } + // check to see if the worker was not found and if we need to add it + if resp.StatusCode == http.StatusNotFound { + logrus.Infof("registering worker %s with the server", config.GetHostname()) + _, _, err := w.VelaClient.Worker.Add(config) + if err != nil { + // log the error instead of returning so the operation doesn't block worker deployment + return fmt.Errorf("unable to register worker %s with the server: %v", config.GetHostname(), err) + } + + // successfully added the worker so return nil + return nil + } + + return fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) + } + + // the worker exists in the db, update it with the new config + logrus.Infof("worker %s previously registered with server, updating information", config.GetHostname()) + _, _, err = w.VelaClient.Worker.Update(config.GetHostname(), config) + if err != nil { + // log the error instead of returning so the operation doesn't block worker deployment + return fmt.Errorf("unable to update worker %s on the server: %v", config.GetHostname(), err) + } + + return nil +} diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 964fdf6e..25bf3569 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -80,6 +80,8 @@ func run(c *cli.Context) error { Limit: c.Int("build.limit"), Timeout: c.Duration("build.timeout"), }, + // build configuration + CheckIn: c.Duration("checkIn"), // executor configuration Executor: &executor.Setup{ Driver: c.String("executor.driver"), diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index d10f9dbb..60567438 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -41,6 +41,7 @@ type ( Config struct { API *API Build *Build + CheckIn time.Duration Executor *executor.Setup Hostname string Logger *Logger diff --git a/docker-compose.yml b/docker-compose.yml index 6b346e09..f662de06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,8 @@ services: VELA_RUNTIME_DRIVER: docker VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' + WORKER_HOSTNAME: worker + WORKER_CHECK_IN: 1m restart: always ports: - "8081:8080" diff --git a/go.mod b/go.mod index 0a906ac9..d99f8c56 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,11 @@ require ( github.com/go-vela/pkg-executor v0.6.0 github.com/go-vela/pkg-queue v0.6.0 github.com/go-vela/pkg-runtime v0.6.0 - github.com/go-vela/sdk-go v0.6.0 + github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 - github.com/sirupsen/logrus v1.6.0 + github.com/sirupsen/logrus v1.7.0 github.com/urfave/cli/v2 v2.2.0 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 diff --git a/go.sum b/go.sum index 61e258e0..8d059dd0 100644 --- a/go.sum +++ b/go.sum @@ -116,6 +116,8 @@ github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1 github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.0 h1:72qIR/m8ybvL8L5TIyfgrigqkrw7kVYAvjEvpT85l70= +github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -123,6 +125,8 @@ github.com/go-vela/compiler v0.6.0 h1:Z0kaz3nfCxAFBnbzuT2qoj5JjlbGckCmpjVr16PtDJ github.com/go-vela/compiler v0.6.0/go.mod h1:chxdAtFcUfJFaewZ5kupqIEjuH+zbK0MDNVc5+Yx4Bg= github.com/go-vela/mock v0.6.0 h1:1ZS/UsCcCoOY/Y2Zmf6MxkNNQyeis4vbakoxzKNJxCE= github.com/go-vela/mock v0.6.0/go.mod h1:ql7Db2MSvHhlzp8D6Kx1oi1KwHgm8VK2zrv55QPP4S4= +github.com/go-vela/mock v0.6.1-0.20201016123844-ce8b022539be h1:q/YVXnsLvSUfIwObvb/waPrMqFX00tRwi73sKkat9nM= +github.com/go-vela/mock v0.6.1-0.20201016123844-ce8b022539be/go.mod h1:8+LjyuYsei05/9LpFa2Praj2+92FWMyeOu4GAukB7Xg= github.com/go-vela/pkg-executor v0.6.0 h1:lf04Z3/Ud89sn+mFSMAtwCpVF7AlUw64d5lO8jKxkTc= github.com/go-vela/pkg-executor v0.6.0/go.mod h1:xjQwKhGY2fX8s/Av/xLIB+trk1d8PJyEabiFz8eQE9g= github.com/go-vela/pkg-queue v0.6.0 h1:8lOntes/6iSzKnXvO2zyvZI2iPwEnA4/7YD0UIIOJE4= @@ -131,6 +135,8 @@ github.com/go-vela/pkg-runtime v0.6.0 h1:pPW8nNAJAZzUp0EnETD7zyjDnj3ppd0EB07igcb github.com/go-vela/pkg-runtime v0.6.0/go.mod h1:gwXKAgFQuQwpshjcwii7LnFWPXzBfTZcj1CJ5wkqGvE= github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= +github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/jeKS9gtMkQDtLztBeR3ix/9+VR3Kvuo= +github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d/go.mod h1:fCz6PRrYDIqQptei8I9v2epRfnUhYVX8vAdnT/3v3Vk= github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 h1:ck0Ylos/ExUCluEqQgVxKrTZ21nsup0VZT31sWqTU4Y= @@ -188,6 +194,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= @@ -317,6 +325,8 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -334,8 +344,12 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= +github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= +github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= @@ -354,6 +368,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -374,6 +390,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -401,6 +419,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -408,6 +427,9 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a h1:bhXnJ7fn2SiL+C8iOWPfNBJKDTjUByftpPW7b9CX94U= +golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -448,6 +470,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200808173500-a06252235341 h1:Kceb+1TNS2X7Cj/A+IUTljNerF/4wOFjlFJ0RGHYKKE= google.golang.org/genproto v0.0.0-20200808173500-a06252235341/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8 h1:SvhzmDbMVK7pK0Fe7KMt2mHoIXxBZNfHQPRqfJFBbnY= +google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= @@ -455,6 +479,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= +google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From ee8de2240923bf50d984ffcd3b20d205a1a53a4c Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 17 Nov 2020 14:12:41 -0600 Subject: [PATCH 129/430] refactor: secrets.env -> .env for consistency (#126) --- secrets.env.example => .env.example | 5 +++++ .gitignore | 4 ++++ DOCS.md | 16 ++++++++-------- docker-compose.yml | 6 ++---- 4 files changed, 19 insertions(+), 12 deletions(-) rename secrets.env.example => .env.example (89%) diff --git a/secrets.env.example b/.env.example similarity index 89% rename from secrets.env.example rename to .env.example index 1649879d..61252c32 100644 --- a/secrets.env.example +++ b/.env.example @@ -22,6 +22,11 @@ # default: https://go-vela.github.io/docs # VELA_DOCS_URL= +# customize the location for the Vela server address +# +# Should match the "VELA_ADDR" value in docker-compose.yml when running locally. +VELA_API=http://localhost:8080 + ############################################################ # _______ _______ ______ __ __ _______ ______ # # | || || _ | | | | || || _ | # diff --git a/.gitignore b/.gitignore index b8ac6f8a..f2e68bdc 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,9 @@ release/ # Secrets environment file secrets.env +# Dotenv environment file +.env +.env.test + # Files to be excluded. .DS_Store diff --git a/DOCS.md b/DOCS.md index 4237b947..ea2b465d 100644 --- a/DOCS.md +++ b/DOCS.md @@ -34,11 +34,11 @@ git clone git@github.com:go-vela/worker.git $HOME/go-vela/worker cd $HOME/go-vela/worker ``` -* If using GitHub Enterprise (default: `https://github.com/`), add the Web URL to a local `secrets.env` file: +* If using GitHub Enterprise (default: `https://github.com/`), add the Web URL to a local `.env` file: ```bash -# add Github Enterprise Web URL to local secrets file for `docker-compose` -echo "VELA_SOURCE_URL=" >> secrets.env +# add Github Enterprise Web URL to local `.env` file for `docker-compose` +echo "VELA_SOURCE_URL=" >> .env ``` * Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: @@ -46,14 +46,14 @@ echo "VELA_SOURCE_URL=" >> secrets.env * `Homepage URL` = `http://localhost:8080` (base URL of the server) * `Authorization callback URL` = `http://localhost:8888/account/authenticate` (authenticate endpoint of the base URL of the UI) -* Add OAuth client secrets to a local `secrets.env` file: +* Add OAuth client secrets to a local `.env` file: ```bash -# add Github Client ID to local secrets file for `docker-compose` -echo "VELA_SOURCE_CLIENT=" >> secrets.env +# add Github Client ID to local `.env` file for `docker-compose` +echo "VELA_SOURCE_CLIENT=" >> .env -# add Github Client Secret to local secrets file for `docker-compose` -echo "VELA_SOURCE_SECRET=" >> secrets.env +# add Github Client Secret to local `.env` file for `docker-compose` +echo "VELA_SOURCE_SECRET=" >> .env ``` ## Start diff --git a/docker-compose.yml b/docker-compose.yml index f662de06..db14deb1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,7 +68,7 @@ services: VELA_SECRET_VAULT_TOKEN: vela VELA_DISABLE_WEBHOOK_VALIDATION: 'true' env_file: - - secrets.env + - .env restart: always ports: - '8080:8080' @@ -88,10 +88,8 @@ services: image: target/vela-ui:latest networks: - vela - environment: - VELA_API: 'http://localhost:8080' env_file: - - secrets.env + - .env restart: always ports: - '8888:80' From e4a23aab7be12e881c510065f9801a0ad9c957d4 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 19 Nov 2020 07:38:36 -0600 Subject: [PATCH 130/430] fix: update go-vela/pkg-executor dep for truncated logs (#125) --- go.mod | 6 +- go.sum | 273 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 261 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index d99f8c56..19c765da 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,15 @@ go 1.13 require ( github.com/Masterminds/semver v1.5.0 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.6.0 + github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 github.com/go-vela/pkg-queue v0.6.0 - github.com/go-vela/pkg-runtime v0.6.0 + github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0 github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.7.0 github.com/urfave/cli/v2 v2.2.0 - golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 + golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index 8d059dd0..8d591d8b 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,36 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +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/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +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= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -13,6 +43,7 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= 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/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= @@ -55,6 +86,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY= +github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= @@ -70,6 +103,8 @@ github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BU github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 h1:w3NnFcKR5241cfmQU5ZZAsf0xcpId6mWOupTvJlUX2U= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible h1:SiUATuP//KecDjpOK2tvZJgeScYAklvyjfK8JZlU6fo= +github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= @@ -86,10 +121,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -97,6 +134,9 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -125,14 +165,15 @@ github.com/go-vela/compiler v0.6.0 h1:Z0kaz3nfCxAFBnbzuT2qoj5JjlbGckCmpjVr16PtDJ github.com/go-vela/compiler v0.6.0/go.mod h1:chxdAtFcUfJFaewZ5kupqIEjuH+zbK0MDNVc5+Yx4Bg= github.com/go-vela/mock v0.6.0 h1:1ZS/UsCcCoOY/Y2Zmf6MxkNNQyeis4vbakoxzKNJxCE= github.com/go-vela/mock v0.6.0/go.mod h1:ql7Db2MSvHhlzp8D6Kx1oi1KwHgm8VK2zrv55QPP4S4= -github.com/go-vela/mock v0.6.1-0.20201016123844-ce8b022539be h1:q/YVXnsLvSUfIwObvb/waPrMqFX00tRwi73sKkat9nM= github.com/go-vela/mock v0.6.1-0.20201016123844-ce8b022539be/go.mod h1:8+LjyuYsei05/9LpFa2Praj2+92FWMyeOu4GAukB7Xg= -github.com/go-vela/pkg-executor v0.6.0 h1:lf04Z3/Ud89sn+mFSMAtwCpVF7AlUw64d5lO8jKxkTc= -github.com/go-vela/pkg-executor v0.6.0/go.mod h1:xjQwKhGY2fX8s/Av/xLIB+trk1d8PJyEabiFz8eQE9g= +github.com/go-vela/mock v0.6.1-0.20201110215452-4708b0548219 h1:0DEVkg6c78JsfGt+JtTttKA+udzvEOrZOwPlaHW3ZnY= +github.com/go-vela/mock v0.6.1-0.20201110215452-4708b0548219/go.mod h1:8+LjyuYsei05/9LpFa2Praj2+92FWMyeOu4GAukB7Xg= +github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 h1:vZimq/5EWUBWXQd4fWh60cfM6OvTnT2FGwAu3uRDMUo= +github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33/go.mod h1:qtEVr7qO+EpkybVv/ZnR9IAV3GJ+IgMjCnFEvpWEz4k= github.com/go-vela/pkg-queue v0.6.0 h1:8lOntes/6iSzKnXvO2zyvZI2iPwEnA4/7YD0UIIOJE4= github.com/go-vela/pkg-queue v0.6.0/go.mod h1:hhTidV8kpbL88TDE7UTv1j2ZqnUYD2Q8jhrGE/RFNfg= -github.com/go-vela/pkg-runtime v0.6.0 h1:pPW8nNAJAZzUp0EnETD7zyjDnj3ppd0EB07igcb84xk= -github.com/go-vela/pkg-runtime v0.6.0/go.mod h1:gwXKAgFQuQwpshjcwii7LnFWPXzBfTZcj1CJ5wkqGvE= +github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0 h1:2/+ArGyca6INrEMQuKQZMe3KxvNNjzyF/fMxrSvAIrM= +github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0/go.mod h1:fk1yFX7YTyO/8nhZ9jGG2t9d8R9GbTuz1C8OAUlzBqg= github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/jeKS9gtMkQDtLztBeR3ix/9+VR3Kvuo= @@ -149,8 +190,16 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +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/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -158,6 +207,8 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -177,8 +228,12 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= @@ -188,15 +243,24 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 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= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= @@ -219,6 +283,7 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -232,6 +297,7 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -315,6 +381,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +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/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -352,6 +419,9 @@ github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5c github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +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/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= @@ -359,11 +429,18 @@ github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBU github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e h1:oIpIX9VKxSCFrfjsKpluGbNPBGq9iNnT9crH781j9wY= github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= 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= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= @@ -371,10 +448,35 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +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/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -384,19 +486,40 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -404,8 +527,11 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 h1:Bx6FllMpG4NWDOfhMBz1VR2QYNp/SAOHPIAsaVmxfPo= +golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -415,22 +541,45 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a h1:bhXnJ7fn2SiL+C8iOWPfNBJKDTjUByftpPW7b9CX94U= golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb h1:HS9IzC4UFbpMBLQUDSQcU+ViVT1vdFCQVjdPVpTlZrs= +golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -450,33 +599,119 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 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-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= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +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-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= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200808173500-a06252235341 h1:Kceb+1TNS2X7Cj/A+IUTljNerF/4wOFjlFJ0RGHYKKE= google.golang.org/genproto v0.0.0-20200808173500-a06252235341/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8 h1:SvhzmDbMVK7pK0Fe7KMt2mHoIXxBZNfHQPRqfJFBbnY= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= +google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= @@ -499,6 +734,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -520,11 +756,15 @@ gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.17.3 h1:XAm3PZp3wnEdzekNkcmj/9Y1zdmQYJ1I4GKSBBZ8aG0= k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= k8s.io/apimachinery v0.17.3 h1:f+uZV6rm4/tHE7xXgLyToprg6xWairaClGVkm2t8omg= @@ -540,8 +780,11 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 h1:7Nu2dTj82c6IaWvL7hImJzcXoTPz1MsSCH7r+0m6rfo= -k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7 h1:XQ0OMFdRDkDIu0b1zqEKSZdWUD7I4bZ4d4nqr8CLKbQ= +k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= From e0e620e852cae4cc5d36e777a2d37116d288ed0f Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Tue, 24 Nov 2020 09:44:26 -0600 Subject: [PATCH 131/430] feat: add option to run with TLS (#127) --- cmd/vela-worker/flags.go | 10 ++++++++++ cmd/vela-worker/run.go | 5 +++++ cmd/vela-worker/server.go | 18 +++++++++++++++++- cmd/vela-worker/worker.go | 25 ++++++++++++++++--------- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index f22833e0..63d057d2 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -84,6 +84,16 @@ func flags() []cli.Flag { Name: "server.secret", Usage: "secret used for server <-> worker communication", }, + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_CERT", "VELA_SERVER_CERT", "SERVER_CERT"}, + Name: "server.cert", + Usage: "optional TLS certificate for https", + }, + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_CERT_KEY", "VELA_SERVER_CERT_KEY", "SERVER_CERT_KEY"}, + Name: "server.cert-key", + Usage: "optional TLS certificate key", + }, } // Executor Flags diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 25bf3569..e42200bc 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -112,6 +112,11 @@ func run(c *cli.Context) error { Address: c.String("server.addr"), Secret: c.String("server.secret"), }, + // Certificate configuration + Certificate: &Certificate{ + Cert: c.String("server.cert"), + Key: c.String("server.cert-key"), + }, }, Executors: make(map[int]executor.Engine), } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 3652046e..e395a0a2 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -5,6 +5,7 @@ package main import ( + "os" "time" "github.com/go-vela/worker/router" @@ -36,8 +37,23 @@ func (w *Worker) server() error { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Tracef logrus.Tracef("serving traffic on %s", w.Config.API.Port) - // // start serving traffic on the provided worker port + // if provided, start serving traffic with TLS on the provided worker port // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.RunTLS + if len(w.Config.Certificate.Cert) > 0 { + // validate cert files exists at the provided paths + _, err := os.Stat(w.Config.Certificate.Cert) + if err != nil { + logrus.Fatalf("Expecting certificate file at %s, got %v", w.Config.Certificate.Cert, err) + } + _, err = os.Stat(w.Config.Certificate.Key) + if err != nil { + logrus.Fatalf("Expecting certificate key at %s, got %v", w.Config.Certificate.Key, err) + } + return _server.RunTLS(w.Config.API.Port, w.Config.Certificate.Cert, w.Config.Certificate.Key) + } + + // if no certs are provided, run without TLS // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run return _server.Run(w.Config.API.Port) } diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 60567438..41fffcde 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -37,17 +37,24 @@ type ( Secret string } + // Certificate represents the optional cert and key to enable TLS + Certificate struct { + Cert string + Key string + } + // Config represents the worker configuration. Config struct { - API *API - Build *Build - CheckIn time.Duration - Executor *executor.Setup - Hostname string - Logger *Logger - Queue *queue.Setup - Runtime *runtime.Setup - Server *Server + API *API + Build *Build + CheckIn time.Duration + Executor *executor.Setup + Hostname string + Logger *Logger + Queue *queue.Setup + Runtime *runtime.Setup + Server *Server + Certificate *Certificate } // Worker represents all configuration and From 7b19232db4fb5e83bf9dce2a887583b344c798dd Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Tue, 8 Dec 2020 19:27:13 -0600 Subject: [PATCH 132/430] feat: add allow list for privileged containers (#128) --- cmd/vela-worker/run.go | 9 +++++---- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index e42200bc..5854e45f 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -95,10 +95,11 @@ func run(c *cli.Context) error { }, // runtime configuration Runtime: &runtime.Setup{ - Driver: c.String("runtime.driver"), - Config: c.String("runtime.config"), - Namespace: c.String("runtime.namespace"), - Volumes: c.StringSlice("runtime.volumes"), + Driver: c.String("runtime.driver"), + Config: c.String("runtime.config"), + Namespace: c.String("runtime.namespace"), + Volumes: c.StringSlice("runtime.volumes"), + PrivilegedImages: c.StringSlice("runtime.allowed-privileged-images"), }, // queue configuration Queue: &queue.Setup{ diff --git a/go.mod b/go.mod index 19c765da..90381e08 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gin-gonic/gin v1.6.3 github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 github.com/go-vela/pkg-queue v0.6.0 - github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0 + github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 github.com/joho/godotenv v1.3.0 diff --git a/go.sum b/go.sum index 8d591d8b..a3d3962f 100644 --- a/go.sum +++ b/go.sum @@ -174,6 +174,8 @@ github.com/go-vela/pkg-queue v0.6.0 h1:8lOntes/6iSzKnXvO2zyvZI2iPwEnA4/7YD0UIIOJ github.com/go-vela/pkg-queue v0.6.0/go.mod h1:hhTidV8kpbL88TDE7UTv1j2ZqnUYD2Q8jhrGE/RFNfg= github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0 h1:2/+ArGyca6INrEMQuKQZMe3KxvNNjzyF/fMxrSvAIrM= github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0/go.mod h1:fk1yFX7YTyO/8nhZ9jGG2t9d8R9GbTuz1C8OAUlzBqg= +github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 h1:RgYGFtBaUKV8bRXEll2ORQjhMTqEQMxsmXm0i9R2V1E= +github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1/go.mod h1:fk1yFX7YTyO/8nhZ9jGG2t9d8R9GbTuz1C8OAUlzBqg= github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/jeKS9gtMkQDtLztBeR3ix/9+VR3Kvuo= From 3fe3021b2246ecb57269e98b9b8685f0e282dfa9 Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Fri, 11 Dec 2020 09:46:38 -0600 Subject: [PATCH 133/430] fix(execute): prevent individual executor process from crashing parent (#123) * fix(execute): prevent individual executor process to crash parent * switch order of err --- cmd/vela-worker/exec.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 0fc43e54..1be5b5e3 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -116,7 +116,7 @@ func (w *Worker) exec(index int) error { err = _executor.CreateBuild(ctx) if err != nil { logger.Errorf("unable to create build: %v", err) - return err + return nil } logger.Info("planning build") @@ -124,7 +124,7 @@ func (w *Worker) exec(index int) error { err = _executor.PlanBuild(ctx) if err != nil { logger.Errorf("unable to plan build: %v", err) - return err + return nil } logger.Info("assembling build") @@ -132,7 +132,7 @@ func (w *Worker) exec(index int) error { err = _executor.AssembleBuild(ctx) if err != nil { logger.Errorf("unable to assemble build: %v", err) - return err + return nil } logger.Info("executing build") @@ -140,7 +140,7 @@ func (w *Worker) exec(index int) error { err = _executor.ExecBuild(ctx) if err != nil { logger.Errorf("unable to execute build: %v", err) - return err + return nil } logger.Info("destroying build") From 2c1946cf3d14eb3214188b65a7b07a72d28f4585 Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Wed, 16 Dec 2020 10:15:11 -0600 Subject: [PATCH 134/430] enhance(workers): track build_limit on server (#129) --- cmd/vela-worker/operate.go | 1 + go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 747c03c5..148746f8 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -34,6 +34,7 @@ func (w *Worker) operate() error { registryWorker.SetRoutes(w.Config.Queue.Routes) registryWorker.SetActive(true) registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + registryWorker.SetBuildLimit(int64(w.Config.Build.Limit)) err = w.register(registryWorker) if err != nil { logrus.Error(err) diff --git a/go.mod b/go.mod index 90381e08..49b8f5cb 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-vela/pkg-queue v0.6.0 github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d - github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 + github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index a3d3962f..3fb5ac0d 100644 --- a/go.sum +++ b/go.sum @@ -182,8 +182,8 @@ github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/je github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d/go.mod h1:fCz6PRrYDIqQptei8I9v2epRfnUhYVX8vAdnT/3v3Vk= github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= -github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538 h1:ck0Ylos/ExUCluEqQgVxKrTZ21nsup0VZT31sWqTU4Y= -github.com/go-vela/types v0.6.1-0.20201019123446-226d0cc72538/go.mod h1:6r6mWIPrTANBpHwAFAIii64VKtzlAzVagbm/wX5bHHk= +github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead h1:oc3Qy8Ux3/nH9QUMmUj1LaRzmAYURK73E31tuwvHq2s= +github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead/go.mod h1:6r6mWIPrTANBpHwAFAIii64VKtzlAzVagbm/wX5bHHk= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From c47e86e07b1e6e9ea479b7e332fb64b8f4b2d72f Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Tue, 29 Dec 2020 15:52:00 -0600 Subject: [PATCH 135/430] fix: add VELA_SECRET_NATIVE_KEY to docker-compose for server (#131) --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index db14deb1..5636b7b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,6 +63,7 @@ services: VELA_PORT: ':8080' VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' VELA_SOURCE_DRIVER: github + VELA_SECRET_NATIVE_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' VELA_SECRET_VAULT: 'true' VELA_SECRET_VAULT_ADDR: 'http://vault:8200' VELA_SECRET_VAULT_TOKEN: vela From b6458b5535a61e941595ee1173149f6c65a9aa0c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Jan 2021 08:53:05 -0600 Subject: [PATCH 136/430] Configure Renovate (#132) * Add renovate.json * chore(renovate): move config to .github folder Co-authored-by: Renovate Bot Co-authored-by: David May --- .github/renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/renovate.json diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..b24babc9 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>go-vela/renovate-config" + ] +} From 9514b912db6fde480adbacae541f834306168ba1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Jan 2021 14:41:11 -0600 Subject: [PATCH 137/430] chore(deps): update golang.org/x/sync commit hash to 09787c9 (#133) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 49b8f5cb..06b1a7a8 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,6 @@ require ( github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.7.0 github.com/urfave/cli/v2 v2.2.0 - golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index 3fb5ac0d..42f32792 100644 --- a/go.sum +++ b/go.sum @@ -534,6 +534,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 h1:Bx6FllMpG4NWDOfhMBz1VR2QYNp/SAOHPIAsaVmxfPo= golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From a05d3dfe4fc95a66f6aaedeffa8864369de9ac8f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Jan 2021 15:58:19 -0600 Subject: [PATCH 138/430] chore(deps): update module urfave/cli/v2 to v2.3.0 (#135) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 06b1a7a8..e13a2ffb 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.7.0 - github.com/urfave/cli/v2 v2.2.0 + github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index 42f32792..398b4405 100644 --- a/go.sum +++ b/go.sum @@ -421,6 +421,8 @@ github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5c github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +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= @@ -751,6 +753,7 @@ gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 9bf8ea8d05209a4e3b09ff66c22eb12108e75ab2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Jan 2021 16:02:17 -0600 Subject: [PATCH 139/430] chore(deps): update module prometheus/client_golang to v1.9.0 (#134) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e13a2ffb..931eccb9 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead github.com/joho/godotenv v1.3.0 - github.com/prometheus/client_golang v1.7.1 + github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a diff --git a/go.sum b/go.sum index 398b4405..20e3dfe0 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,7 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= @@ -61,10 +62,15 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= @@ -72,28 +78,47 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.13.0 h1:QPosMaxm+r6Qs+YcCtL2Z2a2RSdC9VfXJLpd80l8ICU= github.com/alicebob/miniredis/v2 v2.13.0/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY= github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 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/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -113,8 +138,14 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -123,6 +154,9 @@ github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6 github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -139,8 +173,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= @@ -160,6 +196,7 @@ github.com/go-playground/validator/v10 v10.4.0 h1:72qIR/m8ybvL8L5TIyfgrigqkrw7kV github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.6.0 h1:Z0kaz3nfCxAFBnbzuT2qoj5JjlbGckCmpjVr16PtDJM= github.com/go-vela/compiler v0.6.0/go.mod h1:chxdAtFcUfJFaewZ5kupqIEjuH+zbK0MDNVc5+Yx4Bg= @@ -184,8 +221,11 @@ github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead h1:oc3Qy8Ux3/nH9QUMmUj1LaRzmAYURK73E31tuwvHq2s= github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead/go.mod h1:6r6mWIPrTANBpHwAFAIii64VKtzlAzVagbm/wX5bHHk= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -219,6 +259,9 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= @@ -257,6 +300,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -268,31 +312,63 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -300,7 +376,10 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= @@ -318,15 +397,30 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -341,51 +435,100 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 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/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -396,11 +539,20 @@ github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -411,6 +563,7 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= @@ -419,10 +572,14 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= 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/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 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= @@ -432,17 +589,30 @@ github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e h1:oIpIX9VKxSCFrfjsKpluGbNPBGq9iNnT9crH781j9wY= github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 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= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= @@ -485,8 +655,12 @@ golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73r 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -498,6 +672,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -539,11 +714,15 @@ golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -561,6 +740,7 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -577,6 +757,7 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -584,6 +765,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb h1:HS9IzC4UFbpMBLQUDSQcU+ViVT1vdFCQVjdPVpTlZrs= golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -593,12 +776,15 @@ golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -607,6 +793,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= @@ -617,6 +804,8 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -624,6 +813,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -648,6 +838,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IV golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -665,6 +856,7 @@ google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -677,6 +869,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -706,10 +899,15 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -740,17 +938,22 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -765,6 +968,7 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -798,3 +1002,4 @@ sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From f902f151882fcaab58b0a8aa70d265e3efeb5f31 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Fri, 8 Jan 2021 16:13:51 -0600 Subject: [PATCH 140/430] fix: allow admin to define api protocol and set worker address (#130) * feat: allow admin to define api protocol * fix: lint errors * fix: use TrimSuffix over Trim * fix: move comment forr clarity * fix: check that cert and key are provided * enhance: capture worker scheme, hostname, and port in one variable * fix: typo in error message * fix: move hostname check to validate.go * fix: fix error messages to beging with lower case * fix: fix error messages to beging with lower case * fix: nolint * fix: add comment to nolint to explain purpose Co-authored-by: Jordan Brockopp Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> Co-authored-by: Jordan Brockopp --- cmd/vela-worker/exec.go | 5 +++-- cmd/vela-worker/flags.go | 15 +++----------- cmd/vela-worker/operate.go | 5 +++-- cmd/vela-worker/run.go | 21 ++++++++++++------- cmd/vela-worker/server.go | 40 ++++++++++++++++++++++--------------- cmd/vela-worker/validate.go | 21 ++++++++++++++++--- cmd/vela-worker/worker.go | 4 ++-- docker-compose.yml | 2 +- 8 files changed, 68 insertions(+), 45 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 1be5b5e3..7d5cc5d8 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -19,6 +19,7 @@ import ( // exec is a helper function to poll the queue // and execute Vela pipelines for the Worker. +// nolint:funlen // ignore function length due to comments and log messages func (w *Worker) exec(index int) error { var err error @@ -42,7 +43,7 @@ func (w *Worker) exec(index int) error { _executor, err := executor.New(&executor.Setup{ Driver: w.Config.Executor.Driver, Client: w.VelaClient, - Hostname: w.Config.Hostname, + Hostname: w.Config.API.Address.Hostname(), Runtime: w.Runtime, Build: item.Build, Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), @@ -58,7 +59,7 @@ func (w *Worker) exec(index int) error { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields logger := logrus.WithFields(logrus.Fields{ "build": item.Build.GetNumber(), - "host": w.Config.Hostname, + "host": w.Config.API.Address.Hostname(), "repo": item.Repo.GetFullName(), }) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 63d057d2..9cd50577 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -21,9 +21,9 @@ func flags() []cli.Flag { f := []cli.Flag{ &cli.StringFlag{ - EnvVars: []string{"WORKER_HOSTNAME", "VELA_HOSTNAME", "HOSTNAME"}, - Name: "hostname", - Usage: "set hostname for the worker", + EnvVars: []string{"WORKER_ADDR", "VELA_WORKER_ADDR", "VELA_WORKER"}, + Name: "worker.addr", + Usage: "Worker server address as a fully qualified url (://)", }, &cli.DurationFlag{ @@ -33,15 +33,6 @@ func flags() []cli.Flag { Value: 15 * time.Minute, }, - // API Flags - - &cli.StringFlag{ - EnvVars: []string{"WORKER_API_PORT", "VELA_API_PORT", "API_PORT"}, - Name: "api.port", - Usage: "API port for the worker to listen on", - Value: ":8080", - }, - // Build Flags &cli.IntFlag{ diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 148746f8..4562497d 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -26,11 +26,12 @@ func (w *Worker) operate() error { if err != nil { return err } + // Define the database representation of the worker // and register itself in the database registryWorker := new(library.Worker) - registryWorker.SetHostname(w.Config.Hostname) - registryWorker.SetAddress(w.Config.Server.Address) + registryWorker.SetHostname(w.Config.API.Address.Hostname()) + registryWorker.SetAddress(w.Config.API.Address.String()) registryWorker.SetRoutes(w.Config.Queue.Routes) registryWorker.SetActive(true) registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 5854e45f..20648c1b 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -5,6 +5,9 @@ package main import ( + "fmt" + "net/url" + "github.com/gin-gonic/gin" "github.com/go-vela/pkg-executor/executor" @@ -67,13 +70,19 @@ func run(c *cli.Context) error { "registry": "https://hub.docker.com/r/target/vela-worker/", }).Info("Vela Worker") + // parse the workers address, returning any errors. + addr, err := url.Parse(c.String("worker.addr")) + if err != nil { + return fmt.Errorf("unable to parse address: %w", err) + } + // create the worker w := &Worker{ // worker configuration Config: &Config{ // api configuration API: &API{ - Port: c.String("api.port"), + Address: addr, }, // build configuration Build: &Build{ @@ -86,8 +95,6 @@ func run(c *cli.Context) error { Executor: &executor.Setup{ Driver: c.String("executor.driver"), }, - // hostname configuration - Hostname: c.String("hostname"), // logger configuration Logger: &Logger{ Format: c.String("log.format"), @@ -122,13 +129,13 @@ func run(c *cli.Context) error { Executors: make(map[int]executor.Engine), } - // set the worker hostname if no flag was provided - if len(w.Config.Hostname) == 0 { - w.Config.Hostname = hostname + // set the worker address if no flag was provided + if len(w.Config.API.Address.String()) == 0 { + w.Config.API.Address, _ = url.Parse(fmt.Sprintf("http://%s", hostname)) } // validate the worker - err := w.Validate() + err = w.Validate() if err != nil { return err } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index e395a0a2..c80ec211 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -5,7 +5,9 @@ package main import ( + "fmt" "os" + "strings" "time" "github.com/go-vela/worker/router" @@ -35,25 +37,31 @@ func (w *Worker) server() error { // log a message indicating the start of serving traffic // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Tracef - logrus.Tracef("serving traffic on %s", w.Config.API.Port) + logrus.Tracef("serving traffic on %s", w.Config.API.Address.Port()) - // if provided, start serving traffic with TLS on the provided worker port - // - // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.RunTLS - if len(w.Config.Certificate.Cert) > 0 { - // validate cert files exists at the provided paths - _, err := os.Stat(w.Config.Certificate.Cert) - if err != nil { - logrus.Fatalf("Expecting certificate file at %s, got %v", w.Config.Certificate.Cert, err) - } - _, err = os.Stat(w.Config.Certificate.Key) - if err != nil { - logrus.Fatalf("Expecting certificate key at %s, got %v", w.Config.Certificate.Key, err) + // if running with HTTPS, check certs are provided and run with TLS. + if strings.EqualFold(w.Config.API.Address.Scheme, "https") { + if len(w.Config.Certificate.Cert) > 0 && len(w.Config.Certificate.Key) > 0 { + // check that the certificate and key are both populated + _, err := os.Stat(w.Config.Certificate.Cert) + if err != nil { + logrus.Fatalf("expecting certificate file at %s, got %v", w.Config.Certificate.Cert, err) + } + _, err = os.Stat(w.Config.Certificate.Key) + if err != nil { + logrus.Fatalf("expecting certificate key at %s, got %v", w.Config.Certificate.Key, err) + } + } else { + logrus.Fatal("unable to run with TLS: No certificate provided") } - return _server.RunTLS(w.Config.API.Port, w.Config.Certificate.Cert, w.Config.Certificate.Key) + return _server.RunTLS( + fmt.Sprintf(":%s", w.Config.API.Address.Port()), + w.Config.Certificate.Cert, + w.Config.Certificate.Key, + ) } - // if no certs are provided, run without TLS + // else serve over http // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run - return _server.Run(w.Config.API.Port) + return _server.Run(fmt.Sprintf(":%s", w.Config.API.Address.Port())) } diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index c7d192db..c53d24c8 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -6,6 +6,8 @@ package main import ( "fmt" + "net/url" + "strings" "github.com/sirupsen/logrus" ) @@ -17,6 +19,19 @@ func (w *Worker) Validate() error { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Info("validating worker configuration") + // check that hostname was properly populated + if len(w.Config.API.Address.Hostname()) == 0 { + switch strings.ToLower(w.Config.API.Address.Scheme) { + case "http", "https": + retErr := "worker server address invalid: %s" + return fmt.Errorf(retErr, w.Config.API.Address.String()) + default: + // hostname will be empty if a scheme is not provided + retErr := "worker server address invalid, no scheme: %s" + return fmt.Errorf(retErr, w.Config.API.Address.String()) + } + } + // verify a build limit was provided if w.Config.Build.Limit <= 0 { return fmt.Errorf("no worker build limit provided") @@ -27,9 +42,9 @@ func (w *Worker) Validate() error { return fmt.Errorf("no worker build timeout provided") } - // verify a hostname was provided - if len(w.Config.Hostname) == 0 { - return fmt.Errorf("no worker hostname provided") + // verify a worker address was provided + if *w.Config.API.Address == (url.URL{}) { + return fmt.Errorf("no worker address provided") } // verify a server address was provided diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 41fffcde..7f346c06 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -5,6 +5,7 @@ package main import ( + "net/url" "time" "github.com/go-vela/pkg-executor/executor" @@ -16,7 +17,7 @@ import ( type ( // API represents the worker configuration for API information. API struct { - Port string + Address *url.URL } // Build represents the worker configuration for build information. @@ -49,7 +50,6 @@ type ( Build *Build CheckIn time.Duration Executor *executor.Setup - Hostname string Logger *Logger Queue *queue.Setup Runtime *runtime.Setup diff --git a/docker-compose.yml b/docker-compose.yml index 5636b7b2..9d00e73c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: VELA_RUNTIME_DRIVER: docker VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' - WORKER_HOSTNAME: worker + WORKER_ADDR: http://worker:8080 WORKER_CHECK_IN: 1m restart: always ports: From 0ba169f935bf6ad9a506b2310cc9d40e831f67b5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Jan 2021 17:03:39 -0600 Subject: [PATCH 141/430] chore(deps): update module masterminds/semver to v3 (#136) * chore(deps): update module masterminds/semver to v3 * fix(deps): fix the semver upgrade * chore(deps): update module masterminds/semver to v3 Co-authored-by: Renovate Bot Co-authored-by: David May --- go.mod | 4 ++-- go.sum | 15 +++++++++++++-- version/version.go | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 931eccb9..ff9a2cf7 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/go-vela/worker go 1.13 require ( - github.com/Masterminds/semver v1.5.0 + github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 github.com/go-vela/pkg-queue v0.6.0 github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d - github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead + github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index 20e3dfe0..a9cb0e7e 100644 --- a/go.sum +++ b/go.sum @@ -51,6 +51,8 @@ github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RP github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= @@ -155,6 +157,8 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -194,6 +198,8 @@ github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.0 h1:72qIR/m8ybvL8L5TIyfgrigqkrw7kVYAvjEvpT85l70= github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -219,8 +225,10 @@ github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/je github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d/go.mod h1:fCz6PRrYDIqQptei8I9v2epRfnUhYVX8vAdnT/3v3Vk= github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= -github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead h1:oc3Qy8Ux3/nH9QUMmUj1LaRzmAYURK73E31tuwvHq2s= -github.com/go-vela/types v0.6.1-0.20201211155220-43fe2984bead/go.mod h1:6r6mWIPrTANBpHwAFAIii64VKtzlAzVagbm/wX5bHHk= +github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b h1:va3VX89vLy4YnekY3d4ZXif4PXaIV7tchD20N59mBc0= +github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= +github.com/goccy/go-yaml v1.8.4 h1:AOEdR7aQgbgwHznGe3BLkDQVujxCPUpHOZZcQcp8Y3M= +github.com/goccy/go-yaml v1.8.4/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -397,6 +405,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -404,6 +413,8 @@ github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= diff --git a/version/version.go b/version/version.go index 6f09e1c4..6a17cf07 100644 --- a/version/version.go +++ b/version/version.go @@ -8,7 +8,7 @@ import ( "fmt" "runtime" - "github.com/Masterminds/semver" + "github.com/Masterminds/semver/v3" "github.com/go-vela/types/version" ) From e8b2269e0c618c0467d1568bf9d99d33ef285f07 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Mon, 11 Jan 2021 16:27:06 -0600 Subject: [PATCH 142/430] fix: remove nil check from register (#137) --- cmd/vela-worker/register.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index d1f11153..18a12d15 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -19,10 +19,6 @@ func (w *Worker) register(config *library.Worker) error { // check to see if the worker already exists in the database _, resp, err := w.VelaClient.Worker.Get(config.GetHostname()) if err != nil { - // check to see if the response was nil - if resp == nil { - return fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) - } // check to see if the worker was not found and if we need to add it if resp.StatusCode == http.StatusNotFound { logrus.Infof("registering worker %s with the server", config.GetHostname()) From 33e3c7abf2f1048a1062e51c1ff20a9257f578d3 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 13 Jan 2021 20:51:52 +0000 Subject: [PATCH 143/430] chore: upgrade to v0.7.0-rc1 (#138) --- cmd/vela-worker/client.go | 2 +- go.mod | 10 +-- go.sum | 131 +++++++++++++++++++++----------------- 3 files changed, 77 insertions(+), 66 deletions(-) diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 157b4705..025def5c 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -17,7 +17,7 @@ func setupClient(s *Server) (*vela.Client, error) { // create a new Vela client from the server configuration // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#NewClient - vela, err := vela.NewClient(s.Address, nil) + vela, err := vela.NewClient(s.Address, "", nil) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index ff9a2cf7..42b95f9b 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 - github.com/go-vela/pkg-queue v0.6.0 - github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 - github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d - github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b + github.com/go-vela/pkg-executor v0.7.0-rc1 + github.com/go-vela/pkg-queue v0.7.0-rc1 + github.com/go-vela/pkg-runtime v0.7.0-rc1 + github.com/go-vela/sdk-go v0.7.0-rc1 + github.com/go-vela/types v0.7.0-rc1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index a9cb0e7e..2acdbe6e 100644 --- a/go.sum +++ b/go.sum @@ -49,12 +49,10 @@ github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2F github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig/v3 v3.2.0 h1:P1ekkbuU73Ui/wS0nK1HOM37hh4xdfZo485UPf8rc+Y= +github.com/Masterminds/sprig/v3 v3.2.0/go.mod h1:tWhwTbUTndesPNeF0C900vKoq283u6zp4APT9vaF3SI= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -78,8 +76,8 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.13.0 h1:QPosMaxm+r6Qs+YcCtL2Z2a2RSdC9VfXJLpd80l8ICU= -github.com/alicebob/miniredis/v2 v2.13.0/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= +github.com/alicebob/miniredis/v2 v2.14.1 h1:GjlbSeoJ24bzdLRs13HoMEeaRZx9kg5nHoRW7QV/nCs= +github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -109,8 +107,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.3 h1:ijQT13JedHSHrQGWFcGEwzcNKrAGIiZ+jSD5QQG07SY= +github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -125,6 +123,7 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 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= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -194,39 +193,26 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= -github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.0 h1:72qIR/m8ybvL8L5TIyfgrigqkrw7kVYAvjEvpT85l70= -github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= -github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.6.0 h1:Z0kaz3nfCxAFBnbzuT2qoj5JjlbGckCmpjVr16PtDJM= -github.com/go-vela/compiler v0.6.0/go.mod h1:chxdAtFcUfJFaewZ5kupqIEjuH+zbK0MDNVc5+Yx4Bg= -github.com/go-vela/mock v0.6.0 h1:1ZS/UsCcCoOY/Y2Zmf6MxkNNQyeis4vbakoxzKNJxCE= -github.com/go-vela/mock v0.6.0/go.mod h1:ql7Db2MSvHhlzp8D6Kx1oi1KwHgm8VK2zrv55QPP4S4= -github.com/go-vela/mock v0.6.1-0.20201016123844-ce8b022539be/go.mod h1:8+LjyuYsei05/9LpFa2Praj2+92FWMyeOu4GAukB7Xg= -github.com/go-vela/mock v0.6.1-0.20201110215452-4708b0548219 h1:0DEVkg6c78JsfGt+JtTttKA+udzvEOrZOwPlaHW3ZnY= -github.com/go-vela/mock v0.6.1-0.20201110215452-4708b0548219/go.mod h1:8+LjyuYsei05/9LpFa2Praj2+92FWMyeOu4GAukB7Xg= -github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33 h1:vZimq/5EWUBWXQd4fWh60cfM6OvTnT2FGwAu3uRDMUo= -github.com/go-vela/pkg-executor v0.6.1-0.20201113131900-4f44bbe0ef33/go.mod h1:qtEVr7qO+EpkybVv/ZnR9IAV3GJ+IgMjCnFEvpWEz4k= -github.com/go-vela/pkg-queue v0.6.0 h1:8lOntes/6iSzKnXvO2zyvZI2iPwEnA4/7YD0UIIOJE4= -github.com/go-vela/pkg-queue v0.6.0/go.mod h1:hhTidV8kpbL88TDE7UTv1j2ZqnUYD2Q8jhrGE/RFNfg= -github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0 h1:2/+ArGyca6INrEMQuKQZMe3KxvNNjzyF/fMxrSvAIrM= -github.com/go-vela/pkg-runtime v0.6.1-0.20201111181755-32e183648cb0/go.mod h1:fk1yFX7YTyO/8nhZ9jGG2t9d8R9GbTuz1C8OAUlzBqg= -github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1 h1:RgYGFtBaUKV8bRXEll2ORQjhMTqEQMxsmXm0i9R2V1E= -github.com/go-vela/pkg-runtime v0.6.1-0.20201117152311-83cd0f9fc2b1/go.mod h1:fk1yFX7YTyO/8nhZ9jGG2t9d8R9GbTuz1C8OAUlzBqg= -github.com/go-vela/sdk-go v0.6.0 h1:UMO/wvW2nkh+yqFcE4q2T1db7wPY1uN7+WaAV2DJyMY= -github.com/go-vela/sdk-go v0.6.0/go.mod h1:USILVcPdhS2hWbLNjnEXfb+gzQUkrAp51GUbEtIsdTE= -github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d h1:TcI7AMKRCRe/jeKS9gtMkQDtLztBeR3ix/9+VR3Kvuo= -github.com/go-vela/sdk-go v0.6.1-0.20201023131354-0be3cce3f55d/go.mod h1:fCz6PRrYDIqQptei8I9v2epRfnUhYVX8vAdnT/3v3Vk= -github.com/go-vela/types v0.6.0 h1:82/+Y3EGnnr37HeaJ5qhz/PGMvLkJfYvblEw1kFwxb4= -github.com/go-vela/types v0.6.0/go.mod h1:G1Qp0JFtXV+QRNTEWXht+WdllOhjAGapg9vBZKdj6N0= -github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b h1:va3VX89vLy4YnekY3d4ZXif4PXaIV7tchD20N59mBc0= -github.com/go-vela/types v0.6.1-0.20210108224628-20005834775b/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= +github.com/go-vela/compiler v0.7.0-rc1 h1:zXCPEYNqQd4cTOgrz4enTaEAlgkzNQAjSEIOm3yTKmc= +github.com/go-vela/compiler v0.7.0-rc1/go.mod h1:Q48cLfHUcCHknrqagAJSjL+UpD3CKP4zJ/UgcEpAxzY= +github.com/go-vela/mock v0.7.0-rc1 h1:Rhb5XWYNxAlL0Nus9CEwrlWx4xOQTwKImKt0xc4i8Rs= +github.com/go-vela/mock v0.7.0-rc1/go.mod h1:diiACzMDRowQH/ayauz7c7YSRsqOHwaoC8V0rgO3qIs= +github.com/go-vela/pkg-executor v0.7.0-rc1 h1:lDymeGr7rCeOduB7eL2q8Pb/6ndUhJ52DrdPjpsm6Fw= +github.com/go-vela/pkg-executor v0.7.0-rc1/go.mod h1:5SzglmV9+o3rmQt7l6N9m1sKDxzwUB/Wq/1HQuLY+5Q= +github.com/go-vela/pkg-queue v0.7.0-rc1 h1:8VDIGK18Vy3egNFsTB8flpgZp/DHBxTbsPxvV5L7PgY= +github.com/go-vela/pkg-queue v0.7.0-rc1/go.mod h1:8Fp+efmBX8O8tM4vDAa6LXibvh6RrEjAhdZ32egZxCw= +github.com/go-vela/pkg-runtime v0.7.0-rc1 h1:x2i3k1e4Wn42ucJGEGsLbRYMiTlijl82cC3fuKdXWXg= +github.com/go-vela/pkg-runtime v0.7.0-rc1/go.mod h1:74JdqWBthhuTeIvYMfIkhuMb8plsRHdVTjCBoVY8kYQ= +github.com/go-vela/sdk-go v0.7.0-rc1 h1:cPiJH1FMfN9GjA3BGrPs0CE1/D+m8/5141BH+ojARIk= +github.com/go-vela/sdk-go v0.7.0-rc1/go.mod h1:vhXS1robNh5fL6D5Iel+rmcNH1fkbhxcQL65t8AvwD0= +github.com/go-vela/types v0.7.0-rc1 h1:Q16xpyfLD3uc20mDimidjQoSwi7HG7ukfYJs74I/XHY= +github.com/go-vela/types v0.7.0-rc1/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= github.com/goccy/go-yaml v1.8.4 h1:AOEdR7aQgbgwHznGe3BLkDQVujxCPUpHOZZcQcp8Y3M= github.com/goccy/go-yaml v1.8.4/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -271,7 +257,6 @@ github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -285,8 +270,8 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= @@ -296,6 +281,7 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -313,6 +299,8 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.4 h1:0ecGp3skIrHWPNGPJDaBIghfA6Sp7Ruo2Io8eLKzWm0= +github.com/google/uuid v1.1.4/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= @@ -343,8 +331,8 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo= -github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs= +github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -360,6 +348,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= @@ -404,7 +393,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= @@ -455,6 +443,8 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -464,6 +454,9 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -471,6 +464,9 @@ github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= +github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -540,6 +536,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -555,6 +553,8 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -574,6 +574,8 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= @@ -586,8 +588,6 @@ github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvz github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= -github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= 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/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -598,8 +598,8 @@ github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBU github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e h1:oIpIX9VKxSCFrfjsKpluGbNPBGq9iNnT9crH781j9wY= -github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= +github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -609,6 +609,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.starlark.net v0.0.0-20201014215153-dff0ae5b4820 h1:GsJfRMJ3pXl+Pa5CkSQKIA1hNIo1u0M7I2+ff3RCCME= +go.starlark.net v0.0.0-20201014215153-dff0ae5b4820/go.mod h1:f0znQkUKRrkk36XxWbGjMqQM8wGv/xHBVE2qc3B5oFU= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -626,12 +628,13 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -695,6 +698,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= @@ -702,14 +706,18 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210113160501-8b1d76fa0423 h1:/hEknzWkMPCjTo7StMHRrBRa8YBbXuBWfck8680k3RE= +golang.org/x/oauth2 v0.0.0-20210113160501-8b1d76fa0423/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -720,8 +728,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 h1:Bx6FllMpG4NWDOfhMBz1VR2QYNp/SAOHPIAsaVmxfPo= -golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -746,6 +752,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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -766,18 +773,18 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns= -golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb h1:HS9IzC4UFbpMBLQUDSQcU+ViVT1vdFCQVjdPVpTlZrs= -golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061 h1:DQmQoKxQWtyybCtX/3dIuDBcAhFszqq8YiNeS6sNu1c= +golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -787,6 +794,8 @@ golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -904,8 +913,6 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200808173500-a06252235341 h1:Kceb+1TNS2X7Cj/A+IUTljNerF/4wOFjlFJ0RGHYKKE= -google.golang.org/genproto v0.0.0-20200808173500-a06252235341/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= @@ -975,6 +982,10 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= From c422978ffa3443995ccf19a601dc86ea239799e8 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 19 Jan 2021 11:01:11 -0600 Subject: [PATCH 144/430] chore(deps): upgrade go-vela deps on v0.7.0-rc2 (#139) --- go.mod | 10 +++++----- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 42b95f9b..c8e3018e 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.0-rc1 - github.com/go-vela/pkg-queue v0.7.0-rc1 - github.com/go-vela/pkg-runtime v0.7.0-rc1 - github.com/go-vela/sdk-go v0.7.0-rc1 - github.com/go-vela/types v0.7.0-rc1 + github.com/go-vela/pkg-executor v0.7.0-rc2 + github.com/go-vela/pkg-queue v0.7.0-rc2 + github.com/go-vela/pkg-runtime v0.7.0-rc2 + github.com/go-vela/sdk-go v0.7.0-rc2 + github.com/go-vela/types v0.7.0-rc2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index 2acdbe6e..7e4cf7aa 100644 --- a/go.sum +++ b/go.sum @@ -199,20 +199,20 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.0-rc1 h1:zXCPEYNqQd4cTOgrz4enTaEAlgkzNQAjSEIOm3yTKmc= -github.com/go-vela/compiler v0.7.0-rc1/go.mod h1:Q48cLfHUcCHknrqagAJSjL+UpD3CKP4zJ/UgcEpAxzY= -github.com/go-vela/mock v0.7.0-rc1 h1:Rhb5XWYNxAlL0Nus9CEwrlWx4xOQTwKImKt0xc4i8Rs= -github.com/go-vela/mock v0.7.0-rc1/go.mod h1:diiACzMDRowQH/ayauz7c7YSRsqOHwaoC8V0rgO3qIs= -github.com/go-vela/pkg-executor v0.7.0-rc1 h1:lDymeGr7rCeOduB7eL2q8Pb/6ndUhJ52DrdPjpsm6Fw= -github.com/go-vela/pkg-executor v0.7.0-rc1/go.mod h1:5SzglmV9+o3rmQt7l6N9m1sKDxzwUB/Wq/1HQuLY+5Q= -github.com/go-vela/pkg-queue v0.7.0-rc1 h1:8VDIGK18Vy3egNFsTB8flpgZp/DHBxTbsPxvV5L7PgY= -github.com/go-vela/pkg-queue v0.7.0-rc1/go.mod h1:8Fp+efmBX8O8tM4vDAa6LXibvh6RrEjAhdZ32egZxCw= -github.com/go-vela/pkg-runtime v0.7.0-rc1 h1:x2i3k1e4Wn42ucJGEGsLbRYMiTlijl82cC3fuKdXWXg= -github.com/go-vela/pkg-runtime v0.7.0-rc1/go.mod h1:74JdqWBthhuTeIvYMfIkhuMb8plsRHdVTjCBoVY8kYQ= -github.com/go-vela/sdk-go v0.7.0-rc1 h1:cPiJH1FMfN9GjA3BGrPs0CE1/D+m8/5141BH+ojARIk= -github.com/go-vela/sdk-go v0.7.0-rc1/go.mod h1:vhXS1robNh5fL6D5Iel+rmcNH1fkbhxcQL65t8AvwD0= -github.com/go-vela/types v0.7.0-rc1 h1:Q16xpyfLD3uc20mDimidjQoSwi7HG7ukfYJs74I/XHY= -github.com/go-vela/types v0.7.0-rc1/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= +github.com/go-vela/compiler v0.7.0-rc2 h1:oqEzF1rbQYTDepgWX5YWVmoPMHwYCPZFByb4WEm4LUg= +github.com/go-vela/compiler v0.7.0-rc2/go.mod h1:yDLkztd1U/29EPleiBbkNzPWnxxUwvKNGYMTX3pYPQ8= +github.com/go-vela/mock v0.7.0-rc2 h1:n+ugukio7vQrmOZ5D2td+BuGufqrT2HT3gZHO1UPeRc= +github.com/go-vela/mock v0.7.0-rc2/go.mod h1:PzRHohJqr9xLxpe8482/kwL9bHy2YuKtOhzMohxYaYk= +github.com/go-vela/pkg-executor v0.7.0-rc2 h1:Tlv6oMZDKU0CkT1GP3KsI6xmYEGvRGblD9Tz3Y/wdI4= +github.com/go-vela/pkg-executor v0.7.0-rc2/go.mod h1:fZSgpMre5zppQayDBXvHk+OhTc69IVzxEl0PnniVxPk= +github.com/go-vela/pkg-queue v0.7.0-rc2 h1:moOWGXmZXGgLnFEappElfkkrF1hj9yXA7D2B+47VDTA= +github.com/go-vela/pkg-queue v0.7.0-rc2/go.mod h1:UCfvqjVN+88FDApBRPdIQ/lgvpuoBsn8jyvsjwq9CnM= +github.com/go-vela/pkg-runtime v0.7.0-rc2 h1:/t1F4wXsGsk1vEdKH6asadD3IeK6ocjmaytlp1AwGXM= +github.com/go-vela/pkg-runtime v0.7.0-rc2/go.mod h1:gzlGU38GT9SE20p5YpoPl0S1iVmCr6xaIB+kAtUFzo0= +github.com/go-vela/sdk-go v0.7.0-rc2 h1:i6CWvEFWyJqMDAQhqYy2+cRnZS1ENs2Ex3CLOExPhjI= +github.com/go-vela/sdk-go v0.7.0-rc2/go.mod h1:6TqE5wJtpl39XXjfdLPW14q+qerYlam64NvZXt/e58c= +github.com/go-vela/types v0.7.0-rc2 h1:snUSTjd1BW3Kkn9RxfLeufSxbmlomFicmoPBeNNl+ik= +github.com/go-vela/types v0.7.0-rc2/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= github.com/goccy/go-yaml v1.8.4 h1:AOEdR7aQgbgwHznGe3BLkDQVujxCPUpHOZZcQcp8Y3M= github.com/goccy/go-yaml v1.8.4/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -716,8 +716,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210113160501-8b1d76fa0423 h1:/hEknzWkMPCjTo7StMHRrBRa8YBbXuBWfck8680k3RE= -golang.org/x/oauth2 v0.0.0-20210113160501-8b1d76fa0423/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 h1:BaN3BAqnopnKjvl+15DYP6LLrbBHfbfmlFYzmFj/Q9Q= +golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -781,8 +781,8 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061 h1:DQmQoKxQWtyybCtX/3dIuDBcAhFszqq8YiNeS6sNu1c= -golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY= +golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 1b596235fe7a8a2e3955279bcbdd9876855c46c8 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 20 Jan 2021 10:59:24 -0600 Subject: [PATCH 145/430] chore: update copyright year to 2021 (#140) --- .github/README.md | 2 +- Dockerfile | 2 +- Dockerfile-alpine | 2 +- LICENSE | 2 +- Makefile | 2 +- api/build.go | 2 +- api/doc.go | 2 +- api/executor.go | 2 +- api/health.go | 2 +- api/metrics.go | 2 +- api/pipeline.go | 2 +- api/repo.go | 2 +- api/shutdown.go | 2 +- api/version.go | 2 +- cmd/vela-worker/client.go | 2 +- cmd/vela-worker/exec.go | 2 +- cmd/vela-worker/flags.go | 2 +- cmd/vela-worker/main.go | 4 ++-- cmd/vela-worker/operate.go | 2 +- cmd/vela-worker/register.go | 2 +- cmd/vela-worker/run.go | 2 +- cmd/vela-worker/server.go | 2 +- cmd/vela-worker/start.go | 2 +- cmd/vela-worker/validate.go | 2 +- cmd/vela-worker/worker.go | 2 +- docker-compose.yml | 2 +- router/build.go | 2 +- router/build_test.go | 2 +- router/doc.go | 2 +- router/executor.go | 2 +- router/executor_test.go | 2 +- router/middleware/doc.go | 2 +- router/middleware/executor.go | 2 +- router/middleware/executor/executor.go | 2 +- router/middleware/executor/executor_test.go | 2 +- router/middleware/executor_test.go | 2 +- router/middleware/header.go | 2 +- router/middleware/header_test.go | 2 +- router/middleware/logger.go | 2 +- router/middleware/logger_test.go | 2 +- router/middleware/payload.go | 2 +- router/middleware/payload_test.go | 2 +- router/middleware/perm/doc.go | 2 +- router/middleware/perm/perm.go | 2 +- router/middleware/perm/perm_test.go | 2 +- router/middleware/secret.go | 2 +- router/middleware/secret_test.go | 2 +- router/middleware/token/doc.go | 2 +- router/middleware/token/token.go | 2 +- router/middleware/token/token_test.go | 2 +- router/middleware/user/context.go | 2 +- router/middleware/user/context_test.go | 2 +- router/middleware/user/doc.go | 2 +- router/middleware/user/user.go | 2 +- router/middleware/user/user_test.go | 2 +- router/pipeline.go | 2 +- router/pipeline_test.go | 2 +- router/repo.go | 2 +- router/repo_test.go | 2 +- router/router.go | 2 +- router/router_test.go | 2 +- version/version.go | 2 +- 62 files changed, 63 insertions(+), 63 deletions(-) diff --git a/.github/README.md b/.github/README.md index 059a19df..d9b9b5bc 100644 --- a/.github/README.md +++ b/.github/README.md @@ -34,7 +34,7 @@ Please see our [support](SUPPORT.md) documentation for further instructions. ## Copyright and License ``` -Copyright (c) 2020 Target Brands, Inc. +Copyright (c) 2021 Target Brands, Inc. ``` [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/Dockerfile b/Dockerfile index 75e3ab6b..58369f9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# Copyright (c) 2021 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/Dockerfile-alpine b/Dockerfile-alpine index 978bc84d..b74bcc2e 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# Copyright (c) 2021 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/LICENSE b/LICENSE index 1108a527..026db73c 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2020 Target Brands, Inc. + Copyright (c) 2021 Target Brands, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 9d673a47..02443dbf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# Copyright (c) 2021 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/build.go b/api/build.go index fd0aac58..6fa42200 100644 --- a/api/build.go +++ b/api/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/doc.go b/api/doc.go index 48432299..b649d6ab 100644 --- a/api/doc.go +++ b/api/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/executor.go b/api/executor.go index 99b6f7d6..f37b72b1 100644 --- a/api/executor.go +++ b/api/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/health.go b/api/health.go index ab81c6f6..9ad158fb 100644 --- a/api/health.go +++ b/api/health.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/metrics.go b/api/metrics.go index 929db62a..2f62428e 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/pipeline.go b/api/pipeline.go index fdc80767..272caf33 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/repo.go b/api/repo.go index 2d603347..5005a39d 100644 --- a/api/repo.go +++ b/api/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/shutdown.go b/api/shutdown.go index 8f1ff2ff..60c5413a 100644 --- a/api/shutdown.go +++ b/api/shutdown.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/version.go b/api/version.go index 046ae1ff..62f5d990 100644 --- a/api/version.go +++ b/api/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 025def5c..33731cfb 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 7d5cc5d8..55517992 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 9cd50577..ee282f2b 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 9e9ed123..27851caa 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -41,7 +41,7 @@ func main() { app.Name = "vela-worker" app.HelpName = "vela-worker" app.Usage = "Vela build daemon designed for executing pipelines" - app.Copyright = "Copyright (c) 2020 Target Brands, Inc. All rights reserved." + app.Copyright = "Copyright (c) 2021 Target Brands, Inc. All rights reserved." app.Authors = []*cli.Author{ { Name: "Vela Admins", diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 4562497d..001f7c30 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index 18a12d15..cbb0fe5b 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 20648c1b..0356a5c6 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index c80ec211..e9e9947c 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index e38efcab..d34bbaed 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index c53d24c8..36116a16 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 7f346c06..f55a9a5e 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/docker-compose.yml b/docker-compose.yml index 9d00e73c..2a4cb470 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# Copyright (c) 2021 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/build.go b/router/build.go index 893a556d..d04da9d6 100644 --- a/router/build.go +++ b/router/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/build_test.go b/router/build_test.go index 2a51631c..745840a6 100644 --- a/router/build_test.go +++ b/router/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/doc.go b/router/doc.go index 45b5895a..c6912704 100644 --- a/router/doc.go +++ b/router/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/executor.go b/router/executor.go index 929da547..83cb208e 100644 --- a/router/executor.go +++ b/router/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/executor_test.go b/router/executor_test.go index 8cf6f728..4893176c 100644 --- a/router/executor_test.go +++ b/router/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/doc.go b/router/middleware/doc.go index 3f271d2d..1fbfa2c8 100644 --- a/router/middleware/doc.go +++ b/router/middleware/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor.go b/router/middleware/executor.go index e51a458f..e36027c8 100644 --- a/router/middleware/executor.go +++ b/router/middleware/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index d3035572..81ac82bc 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 38df89c1..18298d8d 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor_test.go b/router/middleware/executor_test.go index a5aee7cd..187b2538 100644 --- a/router/middleware/executor_test.go +++ b/router/middleware/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header.go b/router/middleware/header.go index 7d89108b..05ce4065 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index 632594b6..aa0b3ea5 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger.go b/router/middleware/logger.go index e8a38294..7de05d50 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 1a72c3b6..3732566d 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload.go b/router/middleware/payload.go index 2a59b34e..974b0263 100644 --- a/router/middleware/payload.go +++ b/router/middleware/payload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload_test.go b/router/middleware/payload_test.go index b14b37d2..6edb7db1 100644 --- a/router/middleware/payload_test.go +++ b/router/middleware/payload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go index 4af9b1c7..c7845f27 100644 --- a/router/middleware/perm/doc.go +++ b/router/middleware/perm/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index e5cfe354..5c119067 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index 6b67bd1c..64f55951 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/secret.go b/router/middleware/secret.go index f183e181..1fcc5195 100644 --- a/router/middleware/secret.go +++ b/router/middleware/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/secret_test.go b/router/middleware/secret_test.go index 47502a62..9b454d78 100644 --- a/router/middleware/secret_test.go +++ b/router/middleware/secret_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go index 6c5fce8e..c5a89d03 100644 --- a/router/middleware/token/doc.go +++ b/router/middleware/token/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index e4d2c372..465ac143 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token_test.go b/router/middleware/token/token_test.go index 6b84d1b7..41a51298 100644 --- a/router/middleware/token/token_test.go +++ b/router/middleware/token/token_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context.go b/router/middleware/user/context.go index 0863a502..70625cc4 100644 --- a/router/middleware/user/context.go +++ b/router/middleware/user/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go index 478067ad..5e233863 100644 --- a/router/middleware/user/context_test.go +++ b/router/middleware/user/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go index 148543c0..4436d8cb 100644 --- a/router/middleware/user/doc.go +++ b/router/middleware/user/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go index 096f6fe5..a9a30af1 100644 --- a/router/middleware/user/user.go +++ b/router/middleware/user/user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index c2617e65..c2f2837f 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/pipeline.go b/router/pipeline.go index 38854e39..e75c4963 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this pipelinesitory. diff --git a/router/pipeline_test.go b/router/pipeline_test.go index 00dfe97a..a6d73135 100644 --- a/router/pipeline_test.go +++ b/router/pipeline_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/repo.go b/router/repo.go index 61187671..2d18b400 100644 --- a/router/repo.go +++ b/router/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/repo_test.go b/router/repo_test.go index 2873f3dd..c44857ef 100644 --- a/router/repo_test.go +++ b/router/repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/router.go b/router/router.go index 08370b82..26ae94d0 100644 --- a/router/router.go +++ b/router/router.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/router_test.go b/router/router_test.go index 2a23e586..18218111 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/version/version.go b/version/version.go index 6a17cf07..2e84520c 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Target Brands, Inc. All rights reserved. +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. From 6a970138b1ea15f0337663bd3e909729c639b3da Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Fri, 22 Jan 2021 08:40:26 -0600 Subject: [PATCH 146/430] fix: allow workers to retry registering with the server (#142) * fix: allow workers to retry registering with the server * fix: return register.go --- cmd/vela-worker/operate.go | 17 +++++++++-------- cmd/vela-worker/register.go | 37 ++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 001f7c30..232221d6 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -36,25 +36,26 @@ func (w *Worker) operate() error { registryWorker.SetActive(true) registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) registryWorker.SetBuildLimit(int64(w.Config.Build.Limit)) - err = w.register(registryWorker) - if err != nil { - logrus.Error(err) - } // spawn goroutine for phoning home go func() { for { - // sleep for the configured time - time.Sleep(w.Config.CheckIn) - // set checking time to now and call the server registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) - _, _, err := w.VelaClient.Worker.Update(registryWorker.GetHostname(), registryWorker) + + // register or update the worker + err = w.checkIn(registryWorker) + if err != nil { + logrus.Error(err) + } // if unable to update the worker, log the error but allow the worker to continue running if err != nil { logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) } + + // sleep for the configured time + time.Sleep(w.Config.CheckIn) } }() diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index cbb0fe5b..d699f283 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -12,36 +12,39 @@ import ( "github.com/sirupsen/logrus" ) -// register is a helper function to register -// the worker in the database, updating the item -// if the worker already exists -func (w *Worker) register(config *library.Worker) error { +// checkIn is a helper function to to phone home to the server +func (w *Worker) checkIn(config *library.Worker) error { // check to see if the worker already exists in the database + logrus.Infof("retrieving worker %s from the server", config.GetHostname()) _, resp, err := w.VelaClient.Worker.Get(config.GetHostname()) if err != nil { - // check to see if the worker was not found and if we need to add it + // if we receive a 404 the worker needs to be registered if resp.StatusCode == http.StatusNotFound { - logrus.Infof("registering worker %s with the server", config.GetHostname()) - _, _, err := w.VelaClient.Worker.Add(config) - if err != nil { - // log the error instead of returning so the operation doesn't block worker deployment - return fmt.Errorf("unable to register worker %s with the server: %v", config.GetHostname(), err) - } - - // successfully added the worker so return nil - return nil + return w.register(config) } return fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) } - // the worker exists in the db, update it with the new config - logrus.Infof("worker %s previously registered with server, updating information", config.GetHostname()) + // if we were able to GET the worker, update it + logrus.Infof("checking worker %s into the server", config.GetHostname()) _, _, err = w.VelaClient.Worker.Update(config.GetHostname(), config) if err != nil { - // log the error instead of returning so the operation doesn't block worker deployment return fmt.Errorf("unable to update worker %s on the server: %v", config.GetHostname(), err) } return nil } + +// register is a helper function to register the worker with the server +func (w *Worker) register(config *library.Worker) error { + logrus.Infof("worker %s not found, registering it with the server", config.GetHostname()) + _, _, err := w.VelaClient.Worker.Add(config) + if err != nil { + // log the error instead of returning so the operation doesn't block worker deployment + return fmt.Errorf("unable to register worker %s with the server: %v", config.GetHostname(), err) + } + + // successfully added the worker so return nil + return nil +} From 29b49569726522489e3c7cb1bf35320f07dabe8e Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 22 Jan 2021 09:37:32 -0600 Subject: [PATCH 147/430] fix: web UI address for server in docker-compose (#143) Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2a4cb470..e81bf765 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,7 +53,7 @@ services: - vela environment: VELA_ADDR: 'http://localhost:8080' - VELA_WEBUI_ADDR: 'http://ui:80' + VELA_WEBUI_ADDR: 'http://localhost:8888' VELA_DATABASE_DRIVER: postgres VELA_DATABASE_CONFIG: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' VELA_LOG_LEVEL: trace @@ -147,4 +147,4 @@ services: - IPC_LOCK networks: - vela: \ No newline at end of file + vela: From b87b23079df97f50d22e55f6b7e6d7d534668a0a Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 25 Jan 2021 14:36:37 -0600 Subject: [PATCH 148/430] feat: add version information to executor (#144) --- cmd/vela-worker/exec.go | 12 +++++++++--- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 55517992..2ef9582d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -13,6 +13,7 @@ import ( "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/version" "github.com/sirupsen/logrus" ) @@ -23,6 +24,9 @@ import ( func (w *Worker) exec(index int) error { var err error + // setup the version + v := version.New() + // setup the runtime // // https://pkg.go.dev/github.com/go-vela/pkg-runtime/runtime?tab=doc#New @@ -49,6 +53,7 @@ func (w *Worker) exec(index int) error { Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), Repo: item.Repo, User: item.User, + Version: v.Semantic(), }) // add the executor to the worker @@ -58,9 +63,10 @@ func (w *Worker) exec(index int) error { // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields logger := logrus.WithFields(logrus.Fields{ - "build": item.Build.GetNumber(), - "host": w.Config.API.Address.Hostname(), - "repo": item.Repo.GetFullName(), + "build": item.Build.GetNumber(), + "host": w.Config.API.Address.Hostname(), + "repo": item.Repo.GetFullName(), + "version": v.Semantic(), }) // capture the configured build timeout diff --git a/go.mod b/go.mod index c8e3018e..e98a737c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.0-rc2 + github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f github.com/go-vela/pkg-queue v0.7.0-rc2 github.com/go-vela/pkg-runtime v0.7.0-rc2 github.com/go-vela/sdk-go v0.7.0-rc2 diff --git a/go.sum b/go.sum index 7e4cf7aa..f979e5b2 100644 --- a/go.sum +++ b/go.sum @@ -203,8 +203,8 @@ github.com/go-vela/compiler v0.7.0-rc2 h1:oqEzF1rbQYTDepgWX5YWVmoPMHwYCPZFByb4WE github.com/go-vela/compiler v0.7.0-rc2/go.mod h1:yDLkztd1U/29EPleiBbkNzPWnxxUwvKNGYMTX3pYPQ8= github.com/go-vela/mock v0.7.0-rc2 h1:n+ugukio7vQrmOZ5D2td+BuGufqrT2HT3gZHO1UPeRc= github.com/go-vela/mock v0.7.0-rc2/go.mod h1:PzRHohJqr9xLxpe8482/kwL9bHy2YuKtOhzMohxYaYk= -github.com/go-vela/pkg-executor v0.7.0-rc2 h1:Tlv6oMZDKU0CkT1GP3KsI6xmYEGvRGblD9Tz3Y/wdI4= -github.com/go-vela/pkg-executor v0.7.0-rc2/go.mod h1:fZSgpMre5zppQayDBXvHk+OhTc69IVzxEl0PnniVxPk= +github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f h1:ONz4EBCrIXhQVsxnPL7g0xZEmdtIf82AhQUh5rpKslw= +github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f/go.mod h1:fZSgpMre5zppQayDBXvHk+OhTc69IVzxEl0PnniVxPk= github.com/go-vela/pkg-queue v0.7.0-rc2 h1:moOWGXmZXGgLnFEappElfkkrF1hj9yXA7D2B+47VDTA= github.com/go-vela/pkg-queue v0.7.0-rc2/go.mod h1:UCfvqjVN+88FDApBRPdIQ/lgvpuoBsn8jyvsjwq9CnM= github.com/go-vela/pkg-runtime v0.7.0-rc2 h1:/t1F4wXsGsk1vEdKH6asadD3IeK6ocjmaytlp1AwGXM= From 9f0d8219bfaad8de6f2b75a763d6a21e5e2db24c Mon Sep 17 00:00:00 2001 From: David Vader <48764154+davidvader@users.noreply.github.com> Date: Thu, 28 Jan 2021 15:59:23 -0600 Subject: [PATCH 149/430] upgrade to v0.7.0-rc3 (#148) --- go.mod | 10 +++++----- go.sum | 38 ++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index e98a737c..54c8a8eb 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f - github.com/go-vela/pkg-queue v0.7.0-rc2 - github.com/go-vela/pkg-runtime v0.7.0-rc2 - github.com/go-vela/sdk-go v0.7.0-rc2 - github.com/go-vela/types v0.7.0-rc2 + github.com/go-vela/pkg-executor v0.7.0-rc3 + github.com/go-vela/pkg-queue v0.7.0-rc3 + github.com/go-vela/pkg-runtime v0.7.0-rc3 + github.com/go-vela/sdk-go v0.7.0-rc3 + github.com/go-vela/types v0.7.0-rc3 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index f979e5b2..e2d4f6c4 100644 --- a/go.sum +++ b/go.sum @@ -199,22 +199,22 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.0-rc2 h1:oqEzF1rbQYTDepgWX5YWVmoPMHwYCPZFByb4WEm4LUg= -github.com/go-vela/compiler v0.7.0-rc2/go.mod h1:yDLkztd1U/29EPleiBbkNzPWnxxUwvKNGYMTX3pYPQ8= -github.com/go-vela/mock v0.7.0-rc2 h1:n+ugukio7vQrmOZ5D2td+BuGufqrT2HT3gZHO1UPeRc= -github.com/go-vela/mock v0.7.0-rc2/go.mod h1:PzRHohJqr9xLxpe8482/kwL9bHy2YuKtOhzMohxYaYk= -github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f h1:ONz4EBCrIXhQVsxnPL7g0xZEmdtIf82AhQUh5rpKslw= -github.com/go-vela/pkg-executor v0.7.0-rc2.0.20210125155500-a6fec1db703f/go.mod h1:fZSgpMre5zppQayDBXvHk+OhTc69IVzxEl0PnniVxPk= -github.com/go-vela/pkg-queue v0.7.0-rc2 h1:moOWGXmZXGgLnFEappElfkkrF1hj9yXA7D2B+47VDTA= -github.com/go-vela/pkg-queue v0.7.0-rc2/go.mod h1:UCfvqjVN+88FDApBRPdIQ/lgvpuoBsn8jyvsjwq9CnM= -github.com/go-vela/pkg-runtime v0.7.0-rc2 h1:/t1F4wXsGsk1vEdKH6asadD3IeK6ocjmaytlp1AwGXM= -github.com/go-vela/pkg-runtime v0.7.0-rc2/go.mod h1:gzlGU38GT9SE20p5YpoPl0S1iVmCr6xaIB+kAtUFzo0= -github.com/go-vela/sdk-go v0.7.0-rc2 h1:i6CWvEFWyJqMDAQhqYy2+cRnZS1ENs2Ex3CLOExPhjI= -github.com/go-vela/sdk-go v0.7.0-rc2/go.mod h1:6TqE5wJtpl39XXjfdLPW14q+qerYlam64NvZXt/e58c= -github.com/go-vela/types v0.7.0-rc2 h1:snUSTjd1BW3Kkn9RxfLeufSxbmlomFicmoPBeNNl+ik= -github.com/go-vela/types v0.7.0-rc2/go.mod h1:ATtwTwp2l4jI4GUmw840xHZgHmg8FbZPo4g0azImggA= -github.com/goccy/go-yaml v1.8.4 h1:AOEdR7aQgbgwHznGe3BLkDQVujxCPUpHOZZcQcp8Y3M= -github.com/goccy/go-yaml v1.8.4/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/go-vela/compiler v0.7.0-rc3 h1:mCw6uUGqpGuPHIQfBYswMEcCSU9R/ZK2t+GLQagHJ+M= +github.com/go-vela/compiler v0.7.0-rc3/go.mod h1:XbNRK9QmVlYh+iVeRmwLAxRe3mCQ/xxJcR4vruSqs/U= +github.com/go-vela/mock v0.7.0-rc4 h1:iZbuaW6L8XpbK0DNZ8sO/4Xr1NdgVw9D4iVYudRXpQc= +github.com/go-vela/mock v0.7.0-rc4/go.mod h1:usmS36SotbkJWmY/9pNXiaruSgUNwwDkavfC4aOc/Fw= +github.com/go-vela/pkg-executor v0.7.0-rc3 h1:7Djtda75Gg/YNBep4V7U+yFQu6LuSwt3PY/FOVNjjMM= +github.com/go-vela/pkg-executor v0.7.0-rc3/go.mod h1:EzKi57eFBratPHUlGLm3BP9SOmsRWh/t+6AiQqHG1ak= +github.com/go-vela/pkg-queue v0.7.0-rc3 h1:FVJjTNzgFIth8BdHKcikjqkCBAtvh9lC35N5D8YCyj0= +github.com/go-vela/pkg-queue v0.7.0-rc3/go.mod h1:koTbnYThmbxwWsfDrLFFSlnDp989BDZrj+E8nmQYocU= +github.com/go-vela/pkg-runtime v0.7.0-rc3 h1:8WrANwE7Zuz8WVikhFqsdHBlgyLuJ93F7EylYlzsakw= +github.com/go-vela/pkg-runtime v0.7.0-rc3/go.mod h1:WUYkGTOhpPb9nNf97x+ppI7EGXw/yaKQ1wPT+Ke7xwo= +github.com/go-vela/sdk-go v0.7.0-rc3 h1:y9rRUM9Ds9cgyRC/I3eW3lepIZOrS3XkyirwhhQrmEU= +github.com/go-vela/sdk-go v0.7.0-rc3/go.mod h1:UoH5+fBchts1ugmbI3kWUbQSintdSu16AWXahLfl6+U= +github.com/go-vela/types v0.7.0-rc3 h1:47vQFWitVF7DcHKH7/bI1eFaTdLfOrWqhoTogIiZhR4= +github.com/go-vela/types v0.7.0-rc3/go.mod h1:N6YU6eSm/hxAgIdaZtHyKSquNZm2nqK0fFwwPdDWDS0= +github.com/goccy/go-yaml v1.8.5 h1:f1UH5GVhLZE6ElNBAgCtF3ZUOuJ62dNOo3Y5dOJqTV4= +github.com/goccy/go-yaml v1.8.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -716,8 +716,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 h1:BaN3BAqnopnKjvl+15DYP6LLrbBHfbfmlFYzmFj/Q9Q= -golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013 h1:55H5j7lotzuFCEOKDsMch+fRNUQ9DgtyHOUP31FNqKc= +golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -783,6 +783,8 @@ golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY= golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 3db1a5c7df6a68d9bf692bfb076b71b37c517e92 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 2 Feb 2021 10:52:34 -0600 Subject: [PATCH 150/430] chore: linter setup and fixes, doc changes (#149) * chore: linter setup and fixes, doc changes * chore: linter fixes v2 --- .github/CONTRIBUTING.md | 39 +++++++++++++++++++++++++- .golangci.yml | 10 ++++--- api/executor.go | 4 +-- api/health.go | 2 +- api/metrics.go | 2 +- cmd/vela-worker/exec.go | 1 + cmd/vela-worker/register.go | 4 +-- cmd/vela-worker/run.go | 2 ++ cmd/vela-worker/start.go | 2 ++ cmd/vela-worker/worker.go | 2 +- router/build.go | 2 ++ router/executor.go | 2 ++ router/middleware/executor/executor.go | 8 +++--- router/middleware/header.go | 1 + router/middleware/logger_test.go | 1 + router/middleware/payload.go | 2 +- router/middleware/perm/doc.go | 1 - router/middleware/perm/perm.go | 2 +- router/middleware/token/doc.go | 1 - router/middleware/token/token.go | 2 ++ router/middleware/user/doc.go | 1 - router/middleware/user/user.go | 4 +-- router/pipeline.go | 2 ++ router/repo.go | 2 ++ 24 files changed, 76 insertions(+), 23 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b06d8f08..5be6cc36 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -63,6 +63,22 @@ cd $HOME/go-vela/worker * Write your code and tests to implement the changes you desire. * Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules) + * Please address linter warnings appropriately. If you are intentionally violating a rule that triggers a linter, please annotate the respective code with `nolint` declarations [[docs](https://golangci-lint.run/usage/false-positives/)]. we are using the following format for `nolint` declarations: + + ```go + // nolint: // + ``` + + Example: + + ```go + // nolint:gocyclo // legacy function is complex, needs simplification + func superComplexFunction() error { + // .. + } + ``` + + Check the [documentation for more examples](https://golangci-lint.run/usage/false-positives/). * Run the repository code (ensures your changes perform as you desire): @@ -92,4 +108,25 @@ make clean git push fork master ``` -* Open a pull request. Thank you for your contribution! \ No newline at end of file +* Open a pull request! + * For the title of the pull request, please use the following format for the title: + + ```text + feat(wobble): add hat wobble + ^--^^------^ ^------------^ + | | | + | | +---> Summary in present tense. + | +---> Scope: a noun describing a section of the codebase (optional) + +---> Type: chore, docs, feat, fix, refactor, or test. + ``` + + * feat: adds a new feature (equivalent to a MINOR in Semantic Versioning) + * fix: fixes a bug (equivalent to a PATCH in Semantic Versioning) + * docs: changes to the documentation + * refactor: refactors production code, eg. renaming a variable; doesn't change public API + * test: adds missing tests, refactors tests; no production code change + * chore: updates something without impacting the user (ex: bump a dependency in package.json or go.mod); no production code change + + If a code change introduces a breaking change, place ! suffix after type, ie. feat(change)!: adds breaking change. correlates with MAJOR in semantic versioning. + +Thank you for your contribution! diff --git a/.golangci.yml b/.golangci.yml index 665b1f01..85c783b6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -56,10 +56,10 @@ linters-settings: # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint nolintlint: - allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) - allow-unused: false # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped + allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space) + allow-unused: false # allow nolint directives that don't address a linting issue + require-explanation: true # require an explanation for nolint directives + require-specific: true # require nolint directives to be specific about which linter is being skipped # This section provides the configuration for which linters # golangci will execute. Several of them were disabled by @@ -131,7 +131,9 @@ issues: # prevent linters from running on *_test.go files - path: _test\.go linters: + - dupl - funlen - goconst - gocyclo - gomnd + - lll diff --git a/api/executor.go b/api/executor.go index f37b72b1..63ac478a 100644 --- a/api/executor.go +++ b/api/executor.go @@ -123,7 +123,7 @@ func GetExecutors(c *gin.Context) { // capture executors value from context value := c.Value("executors") if value == nil { - msg := fmt.Sprintf("no running executors found") + msg := "no running executors found" c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) @@ -133,7 +133,7 @@ func GetExecutors(c *gin.Context) { // cast executors value to expected type e, ok := value.(map[int]executor.Engine) if !ok { - msg := fmt.Sprintf("unable to get executors") + msg := "unable to get executors" c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) diff --git a/api/health.go b/api/health.go index 9ad158fb..32bbc894 100644 --- a/api/health.go +++ b/api/health.go @@ -25,7 +25,7 @@ import ( // schema: // type: string -// Health check the status of the application +// Health check the status of the application. func Health(c *gin.Context) { c.JSON(http.StatusOK, "ok") } diff --git a/api/metrics.go b/api/metrics.go index 2f62428e..992c2121 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -25,7 +25,7 @@ import ( // schema: // type: string -// Metrics returns a Prometheus handler for serving go metrics +// Metrics returns a Prometheus handler for serving go metrics. func Metrics() http.Handler { return promhttp.Handler() } diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2ef9582d..2324b352 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -20,6 +20,7 @@ import ( // exec is a helper function to poll the queue // and execute Vela pipelines for the Worker. +// // nolint:funlen // ignore function length due to comments and log messages func (w *Worker) exec(index int) error { var err error diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index d699f283..a054b295 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -12,7 +12,7 @@ import ( "github.com/sirupsen/logrus" ) -// checkIn is a helper function to to phone home to the server +// checkIn is a helper function to to phone home to the server. func (w *Worker) checkIn(config *library.Worker) error { // check to see if the worker already exists in the database logrus.Infof("retrieving worker %s from the server", config.GetHostname()) @@ -36,7 +36,7 @@ func (w *Worker) checkIn(config *library.Worker) error { return nil } -// register is a helper function to register the worker with the server +// register is a helper function to register the worker with the server. func (w *Worker) register(config *library.Worker) error { logrus.Infof("worker %s not found, registering it with the server", config.GetHostname()) _, _, err := w.VelaClient.Worker.Add(config) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 0356a5c6..64b01fd8 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -23,6 +23,8 @@ import ( // run executes the worker based // off the configuration provided. +// +// nolint: funlen // ignore function length due to comments func run(c *cli.Context) error { // set log format for the worker switch c.String("log.format") { diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index d34bbaed..4f808a14 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -71,6 +71,8 @@ func (w *Worker) Start() error { }() // create an infinite loop to poll for errors + // + // nolint: gosimple // ignore this for now for { // create a select statement to check for errors select { diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index f55a9a5e..dae07639 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -38,7 +38,7 @@ type ( Secret string } - // Certificate represents the optional cert and key to enable TLS + // Certificate represents the optional cert and key to enable TLS. Certificate struct { Cert string Key string diff --git a/router/build.go b/router/build.go index d04da9d6..2338727a 100644 --- a/router/build.go +++ b/router/build.go @@ -10,6 +10,8 @@ import ( "github.com/go-vela/worker/api" ) +// nolint: godot // ignore comment ending in period +// // BuildHandlers extends the provided base router group // by adding a collection of endpoints for handling // build related requests. diff --git a/router/executor.go b/router/executor.go index 83cb208e..54d923c2 100644 --- a/router/executor.go +++ b/router/executor.go @@ -10,6 +10,8 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) +// nolint: godot // ignore comment ending in period +// // ExecutorHandlers extends the provided base router group // by adding a collection of endpoints for handling // executor related requests. diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index 81ac82bc..5aa4bcc2 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -17,12 +17,12 @@ import ( "github.com/sirupsen/logrus" ) -// Retrieve gets the repo in the given context +// Retrieve gets the repo in the given context. func Retrieve(c *gin.Context) executor.Engine { return executor.FromGinContext(c) } -// Establish sets the executor in the given context +// Establish sets the executor in the given context. func Establish() gin.HandlerFunc { return func(c *gin.Context) { param := c.Param("executor") @@ -46,7 +46,7 @@ func Establish() gin.HandlerFunc { // capture executors value from context value := c.Value("executors") if value == nil { - msg := fmt.Sprintf("no running executors found") + msg := "no running executors found" c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) @@ -56,7 +56,7 @@ func Establish() gin.HandlerFunc { // cast executors value to expected type executors, ok := value.(map[int]executor.Engine) if !ok { - msg := fmt.Sprintf("unable to get executors") + msg := "unable to get executors" c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) diff --git a/router/middleware/header.go b/router/middleware/header.go index 05ce4065..b3f53f77 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -33,6 +33,7 @@ func Options(c *gin.Context) { c.Header("Access-Control-Allow-Headers", "authorization, origin, content-type, accept") c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS") c.Header("Content-Type", "application/json") + // nolint: gomnd // ignore magic number c.AbortWithStatus(200) } } diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 3732566d..620b9637 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -80,6 +80,7 @@ func TestMiddleware_Logger_Error(t *testing.T) { // setup mock server engine.Use(Logger(logger, time.RFC3339, true)) engine.GET("/foobar", func(c *gin.Context) { + // nolint: errcheck // ignore checking error c.Error(fmt.Errorf("test error")) c.Status(http.StatusOK) }) diff --git a/router/middleware/payload.go b/router/middleware/payload.go index 974b0263..e84ca1f7 100644 --- a/router/middleware/payload.go +++ b/router/middleware/payload.go @@ -13,7 +13,7 @@ import ( ) // Payload is a middleware function that captures the user provided json body -// and attaches it to the context of every http.Request to be logged +// and attaches it to the context of every http.Request to be logged. func Payload() gin.HandlerFunc { return func(c *gin.Context) { // bind JSON payload from request to be added to context diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go index c7845f27..29469464 100644 --- a/router/middleware/perm/doc.go +++ b/router/middleware/perm/doc.go @@ -9,5 +9,4 @@ // Usage: // // import "github.com/go-vela/worker/router/middleware/perm" - package perm diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index 5c119067..675b224c 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -16,7 +16,7 @@ import ( "github.com/sirupsen/logrus" ) -// MustServer ensures the user is the vela server +// MustServer ensures the user is the vela server. func MustServer() gin.HandlerFunc { return func(c *gin.Context) { u := user.Retrieve(c) diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go index c5a89d03..8ebe0e2a 100644 --- a/router/middleware/token/doc.go +++ b/router/middleware/token/doc.go @@ -9,5 +9,4 @@ // Usage: // // import "github.com/go-vela/worker/router/middleware/token" - package token diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 465ac143..310a2d80 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -10,6 +10,8 @@ import ( "strings" ) +// nolint: godot // ignore comment ending in period +// // Retrieve gets the token from the provided request http.Request // to be parsed and validated. This is called on every request // to enable capturing the user making the request and validating diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go index 4436d8cb..2d64d5d2 100644 --- a/router/middleware/user/doc.go +++ b/router/middleware/user/doc.go @@ -9,5 +9,4 @@ // Usage: // // import "github.com/go-vela/worker/router/middleware/user" - package user diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go index a9a30af1..3f451603 100644 --- a/router/middleware/user/user.go +++ b/router/middleware/user/user.go @@ -15,12 +15,12 @@ import ( "github.com/gin-gonic/gin" ) -// Retrieve gets the user in the given context +// Retrieve gets the user in the given context. func Retrieve(c *gin.Context) *library.User { return FromContext(c) } -// Establish sets the user in the given context +// Establish sets the user in the given context. func Establish() gin.HandlerFunc { return func(c *gin.Context) { u := new(library.User) diff --git a/router/pipeline.go b/router/pipeline.go index e75c4963..6fb9fadd 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -10,6 +10,8 @@ import ( "github.com/go-vela/worker/api" ) +// nolint: godot // ignore comment ending in period +// // PipelineHandlers extends the provided base router group // by adding a collection of endpoints for handling // pipeline related requests. diff --git a/router/repo.go b/router/repo.go index 2d18b400..b4dec747 100644 --- a/router/repo.go +++ b/router/repo.go @@ -10,6 +10,8 @@ import ( "github.com/go-vela/worker/api" ) +// nolint: godot // ignore comment ending in period +// // RepoHandlers extends the provided base router group // by adding a collection of endpoints for handling // repo related requests. From a8d6ed80b9b36c8dc972eaae8dc602867b5e24aa Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 2 Feb 2021 11:20:41 -0600 Subject: [PATCH 151/430] refactor: use constant for 200 http status code (#150) --- router/middleware/header.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/router/middleware/header.go b/router/middleware/header.go index b3f53f77..19cd47f2 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -33,8 +33,7 @@ func Options(c *gin.Context) { c.Header("Access-Control-Allow-Headers", "authorization, origin, content-type, accept") c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS") c.Header("Content-Type", "application/json") - // nolint: gomnd // ignore magic number - c.AbortWithStatus(200) + c.AbortWithStatus(http.StatusOK) } } From 23023f0af2ce7b4d4bdc303074d399d7f2a5cdf0 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 2 Feb 2021 14:44:34 -0600 Subject: [PATCH 152/430] chore: upgrade go-vela deps on v0.7.0 (#151) --- go.mod | 10 +++++----- go.sum | 35 +++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 54c8a8eb..a153c04a 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.0-rc3 - github.com/go-vela/pkg-queue v0.7.0-rc3 - github.com/go-vela/pkg-runtime v0.7.0-rc3 - github.com/go-vela/sdk-go v0.7.0-rc3 - github.com/go-vela/types v0.7.0-rc3 + github.com/go-vela/pkg-executor v0.7.0 + github.com/go-vela/pkg-queue v0.7.0 + github.com/go-vela/pkg-runtime v0.7.0 + github.com/go-vela/sdk-go v0.7.0 + github.com/go-vela/types v0.7.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index e2d4f6c4..78eb6ed4 100644 --- a/go.sum +++ b/go.sum @@ -199,22 +199,24 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.0-rc3 h1:mCw6uUGqpGuPHIQfBYswMEcCSU9R/ZK2t+GLQagHJ+M= -github.com/go-vela/compiler v0.7.0-rc3/go.mod h1:XbNRK9QmVlYh+iVeRmwLAxRe3mCQ/xxJcR4vruSqs/U= -github.com/go-vela/mock v0.7.0-rc4 h1:iZbuaW6L8XpbK0DNZ8sO/4Xr1NdgVw9D4iVYudRXpQc= -github.com/go-vela/mock v0.7.0-rc4/go.mod h1:usmS36SotbkJWmY/9pNXiaruSgUNwwDkavfC4aOc/Fw= -github.com/go-vela/pkg-executor v0.7.0-rc3 h1:7Djtda75Gg/YNBep4V7U+yFQu6LuSwt3PY/FOVNjjMM= -github.com/go-vela/pkg-executor v0.7.0-rc3/go.mod h1:EzKi57eFBratPHUlGLm3BP9SOmsRWh/t+6AiQqHG1ak= -github.com/go-vela/pkg-queue v0.7.0-rc3 h1:FVJjTNzgFIth8BdHKcikjqkCBAtvh9lC35N5D8YCyj0= -github.com/go-vela/pkg-queue v0.7.0-rc3/go.mod h1:koTbnYThmbxwWsfDrLFFSlnDp989BDZrj+E8nmQYocU= -github.com/go-vela/pkg-runtime v0.7.0-rc3 h1:8WrANwE7Zuz8WVikhFqsdHBlgyLuJ93F7EylYlzsakw= -github.com/go-vela/pkg-runtime v0.7.0-rc3/go.mod h1:WUYkGTOhpPb9nNf97x+ppI7EGXw/yaKQ1wPT+Ke7xwo= -github.com/go-vela/sdk-go v0.7.0-rc3 h1:y9rRUM9Ds9cgyRC/I3eW3lepIZOrS3XkyirwhhQrmEU= -github.com/go-vela/sdk-go v0.7.0-rc3/go.mod h1:UoH5+fBchts1ugmbI3kWUbQSintdSu16AWXahLfl6+U= -github.com/go-vela/types v0.7.0-rc3 h1:47vQFWitVF7DcHKH7/bI1eFaTdLfOrWqhoTogIiZhR4= -github.com/go-vela/types v0.7.0-rc3/go.mod h1:N6YU6eSm/hxAgIdaZtHyKSquNZm2nqK0fFwwPdDWDS0= +github.com/go-vela/compiler v0.7.0 h1:4tdcAXFbZmXPcXz+pQnuvQElNB69PRWhwCbujTjztV8= +github.com/go-vela/compiler v0.7.0/go.mod h1:a026OVG4ODRMgcg07IBa9IUHXJMZno0UNbx1CH6nCeE= +github.com/go-vela/mock v0.7.0 h1:6EYLlt1q+XmPj5UlW5Og2F0vV4QkuLq7mOYSVYuniYw= +github.com/go-vela/mock v0.7.0/go.mod h1:w2qVdJFQ0diP783XST19HWVWvfDR+9IW+zjJd+ADsCk= +github.com/go-vela/pkg-executor v0.7.0 h1:nOwOsgVExar9GD+WKKs1H+9Rfv8eg2Ozn2h36meYazo= +github.com/go-vela/pkg-executor v0.7.0/go.mod h1:5ad4XqWutQoWh8pwiIMGXRNuhnNZ5VmJjylbIjc3zRw= +github.com/go-vela/pkg-queue v0.7.0 h1:tApJof94xo8L7Lp3FdBxnVbkIkkYpspEbs75NoF7xsE= +github.com/go-vela/pkg-queue v0.7.0/go.mod h1:qcduhHpcN+e8Q0mIvV77znGFTqVPonsnu4Z2Q/PHSpM= +github.com/go-vela/pkg-runtime v0.7.0 h1:P5O4RI7VwpS0GhdNqXlYeO6VSnKqV1ZXqIp8zLwA4gs= +github.com/go-vela/pkg-runtime v0.7.0/go.mod h1:Gbgm5vXH0+b9rHwPqx6gO1iOiJL3Dpk4bYl31cgyYPs= +github.com/go-vela/sdk-go v0.7.0 h1:M2nqmPsYs4XHzmFTolf2oRD7BtuyZFI/HJHVo/J8bG4= +github.com/go-vela/sdk-go v0.7.0/go.mod h1:m/6TliMlQDdevy+bF+Y/32yl16SuNdBZuFXAkglwqGc= +github.com/go-vela/types v0.7.0 h1:9JNeSZwJDnKAn6eMM7I+cjT65KBJ3WsEROcgE8XfAYo= +github.com/go-vela/types v0.7.0/go.mod h1:40pn+lq3G3wGFau2OjCmmFO4fYDCU3dUkmCY15/8fpI= github.com/goccy/go-yaml v1.8.5 h1:f1UH5GVhLZE6ElNBAgCtF3ZUOuJ62dNOo3Y5dOJqTV4= github.com/goccy/go-yaml v1.8.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/goccy/go-yaml v1.8.8 h1:MGfRB1GeSn/hWXYWS2Pt67iC2GJNnebdIro01ddyucA= +github.com/goccy/go-yaml v1.8.8/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -770,6 +772,7 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -781,8 +784,6 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY= -golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= @@ -988,6 +989,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= From a38b9857635cf42dc88b112504867a7806c7b328 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Thu, 4 Feb 2021 14:49:22 -0600 Subject: [PATCH 153/430] fix(cancel): return build struct instead of string resp (#152) --- api/build.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/api/build.go b/api/build.go index 6fa42200..28e30293 100644 --- a/api/build.go +++ b/api/build.go @@ -96,15 +96,6 @@ func GetBuild(c *gin.Context) { func CancelBuild(c *gin.Context) { e := executor.Retrieve(c) - repo, err := e.GetRepo() - if err != nil { - msg := fmt.Errorf("unable to repo build: %w", err).Error() - - c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) - - return - } - build, err := e.CancelBuild() if err != nil { msg := fmt.Errorf("unable to cancel build: %w", err).Error() @@ -114,5 +105,5 @@ func CancelBuild(c *gin.Context) { return } - c.JSON(http.StatusOK, fmt.Sprintf("canceled build %s/%d", repo.GetFullName(), build.GetNumber())) + c.JSON(http.StatusOK, build) } From 2b55b25ac5e09595283f689ba5d7ba39e06f41cd Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Mon, 8 Feb 2021 15:05:30 -0600 Subject: [PATCH 154/430] chore: update go-vela/executor to master (#153) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index a153c04a..75326c89 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.0 - github.com/go-vela/pkg-queue v0.7.0 - github.com/go-vela/pkg-runtime v0.7.0 - github.com/go-vela/sdk-go v0.7.0 - github.com/go-vela/types v0.7.0 + github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e + github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c + github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 + github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003 + github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index 78eb6ed4..4f5a95de 100644 --- a/go.sum +++ b/go.sum @@ -199,20 +199,20 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.0 h1:4tdcAXFbZmXPcXz+pQnuvQElNB69PRWhwCbujTjztV8= -github.com/go-vela/compiler v0.7.0/go.mod h1:a026OVG4ODRMgcg07IBa9IUHXJMZno0UNbx1CH6nCeE= -github.com/go-vela/mock v0.7.0 h1:6EYLlt1q+XmPj5UlW5Og2F0vV4QkuLq7mOYSVYuniYw= -github.com/go-vela/mock v0.7.0/go.mod h1:w2qVdJFQ0diP783XST19HWVWvfDR+9IW+zjJd+ADsCk= -github.com/go-vela/pkg-executor v0.7.0 h1:nOwOsgVExar9GD+WKKs1H+9Rfv8eg2Ozn2h36meYazo= -github.com/go-vela/pkg-executor v0.7.0/go.mod h1:5ad4XqWutQoWh8pwiIMGXRNuhnNZ5VmJjylbIjc3zRw= -github.com/go-vela/pkg-queue v0.7.0 h1:tApJof94xo8L7Lp3FdBxnVbkIkkYpspEbs75NoF7xsE= -github.com/go-vela/pkg-queue v0.7.0/go.mod h1:qcduhHpcN+e8Q0mIvV77znGFTqVPonsnu4Z2Q/PHSpM= -github.com/go-vela/pkg-runtime v0.7.0 h1:P5O4RI7VwpS0GhdNqXlYeO6VSnKqV1ZXqIp8zLwA4gs= -github.com/go-vela/pkg-runtime v0.7.0/go.mod h1:Gbgm5vXH0+b9rHwPqx6gO1iOiJL3Dpk4bYl31cgyYPs= -github.com/go-vela/sdk-go v0.7.0 h1:M2nqmPsYs4XHzmFTolf2oRD7BtuyZFI/HJHVo/J8bG4= -github.com/go-vela/sdk-go v0.7.0/go.mod h1:m/6TliMlQDdevy+bF+Y/32yl16SuNdBZuFXAkglwqGc= -github.com/go-vela/types v0.7.0 h1:9JNeSZwJDnKAn6eMM7I+cjT65KBJ3WsEROcgE8XfAYo= -github.com/go-vela/types v0.7.0/go.mod h1:40pn+lq3G3wGFau2OjCmmFO4fYDCU3dUkmCY15/8fpI= +github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09 h1:W00prox3a5x6lcLJnhC5lvwMZb025osYNZceFy3bGto= +github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09/go.mod h1:DjQyMnNKhoXcNCgpW8MJ6kevr6BYGL5kZ1IutQjjuUU= +github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e h1:UH9DJGe3zT3mpp0fXa/f+yvH5pW++w5ffGHyhZJFRUM= +github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e/go.mod h1:N6iWKh7OvllL8jNipNlc9UVSpbNtf6rnuuqXFrAcTo0= +github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e h1:2ZHUYz3Jy3wiJIzCDHNcVQ7jgpUE1zDgb881YSom730= +github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e/go.mod h1:z6pqpc0G3hLGmrgYvO3LdyfftGCjJgPSeO2qa3e38Xw= +github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c h1:dPMjOyu0RnKedTPSWQbQHgfLKwJhOVuw6NTKWArWgUg= +github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c/go.mod h1:EME7XavJLsMOXNGgIQvvtjbXWyoLvC9SvuybW+9YtFg= +github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 h1:/XI44IofYZ7NM/rpMO8sv1A9CKb8gTtPe4iMemf/IqA= +github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988/go.mod h1:lF2tjbkxNqlf7j7rjC7kEApahz9YpW24YXN9PzCjAWg= +github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003 h1:Rlzxu3wHb6UCCE34W1XSdssGop48Zxr+lFlgQcJbLGo= +github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003/go.mod h1:ZXxG5qSRNvn4FodldhwSsuivT13cSvFcn4PmHk6X6Jw= +github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed h1:hI3H8i+kR6n69Uls+Up+xjRzZbA8uz1FsB7S+oErkhY= +github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed/go.mod h1:e1aq1gtDHXroC1zklr85+lWXSKuAjv5DjV2tec3fMbk= github.com/goccy/go-yaml v1.8.5 h1:f1UH5GVhLZE6ElNBAgCtF3ZUOuJ62dNOo3Y5dOJqTV4= github.com/goccy/go-yaml v1.8.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/goccy/go-yaml v1.8.8 h1:MGfRB1GeSn/hWXYWS2Pt67iC2GJNnebdIro01ddyucA= From 2793dbb83756c705266e7253e967ea8e63537f22 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Wed, 10 Feb 2021 13:24:38 -0600 Subject: [PATCH 155/430] chore: import pkg-executor@master (#155) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 75326c89..8cc479f7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e + github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329 github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003 diff --git a/go.sum b/go.sum index 4f5a95de..7b27694e 100644 --- a/go.sum +++ b/go.sum @@ -203,8 +203,8 @@ github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09 h1:W00prox3a5x6 github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09/go.mod h1:DjQyMnNKhoXcNCgpW8MJ6kevr6BYGL5kZ1IutQjjuUU= github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e h1:UH9DJGe3zT3mpp0fXa/f+yvH5pW++w5ffGHyhZJFRUM= github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e/go.mod h1:N6iWKh7OvllL8jNipNlc9UVSpbNtf6rnuuqXFrAcTo0= -github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e h1:2ZHUYz3Jy3wiJIzCDHNcVQ7jgpUE1zDgb881YSom730= -github.com/go-vela/pkg-executor v0.7.1-0.20210208205014-f56811ef669e/go.mod h1:z6pqpc0G3hLGmrgYvO3LdyfftGCjJgPSeO2qa3e38Xw= +github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329 h1:EWq9xwGs9KNXsSA7lGlsfc16EHXwIbLF6GwDqtap/K8= +github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329/go.mod h1:z6pqpc0G3hLGmrgYvO3LdyfftGCjJgPSeO2qa3e38Xw= github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c h1:dPMjOyu0RnKedTPSWQbQHgfLKwJhOVuw6NTKWArWgUg= github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c/go.mod h1:EME7XavJLsMOXNGgIQvvtjbXWyoLvC9SvuybW+9YtFg= github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 h1:/XI44IofYZ7NM/rpMO8sv1A9CKb8gTtPe4iMemf/IqA= From cb600b9809ef86278d1d2deb7523f80cfe7ce4b3 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 11 Feb 2021 17:59:49 +0000 Subject: [PATCH 156/430] chore: bump to v0.7.2 (#158) --- go.mod | 10 +++++----- go.sum | 37 ++++++++++++++----------------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 8cc479f7..65b0fc93 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.13 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329 - github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c - github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 - github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003 - github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed + github.com/go-vela/pkg-executor v0.7.2 + github.com/go-vela/pkg-queue v0.7.2 + github.com/go-vela/pkg-runtime v0.7.2 + github.com/go-vela/sdk-go v0.7.2 + github.com/go-vela/types v0.7.2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index 7b27694e..41e3fb73 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,6 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -199,24 +197,20 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09 h1:W00prox3a5x6lcLJnhC5lvwMZb025osYNZceFy3bGto= -github.com/go-vela/compiler v0.7.1-0.20210208192832-b648ca61be09/go.mod h1:DjQyMnNKhoXcNCgpW8MJ6kevr6BYGL5kZ1IutQjjuUU= -github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e h1:UH9DJGe3zT3mpp0fXa/f+yvH5pW++w5ffGHyhZJFRUM= -github.com/go-vela/mock v0.7.1-0.20210208195429-9d0ef290107e/go.mod h1:N6iWKh7OvllL8jNipNlc9UVSpbNtf6rnuuqXFrAcTo0= -github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329 h1:EWq9xwGs9KNXsSA7lGlsfc16EHXwIbLF6GwDqtap/K8= -github.com/go-vela/pkg-executor v0.7.1-0.20210210190530-32cbe2cb0329/go.mod h1:z6pqpc0G3hLGmrgYvO3LdyfftGCjJgPSeO2qa3e38Xw= -github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c h1:dPMjOyu0RnKedTPSWQbQHgfLKwJhOVuw6NTKWArWgUg= -github.com/go-vela/pkg-queue v0.7.1-0.20210208203158-505fa958b42c/go.mod h1:EME7XavJLsMOXNGgIQvvtjbXWyoLvC9SvuybW+9YtFg= -github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988 h1:/XI44IofYZ7NM/rpMO8sv1A9CKb8gTtPe4iMemf/IqA= -github.com/go-vela/pkg-runtime v0.7.1-0.20210208201149-a992dd308988/go.mod h1:lF2tjbkxNqlf7j7rjC7kEApahz9YpW24YXN9PzCjAWg= -github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003 h1:Rlzxu3wHb6UCCE34W1XSdssGop48Zxr+lFlgQcJbLGo= -github.com/go-vela/sdk-go v0.7.1-0.20210208200135-738ada5b7003/go.mod h1:ZXxG5qSRNvn4FodldhwSsuivT13cSvFcn4PmHk6X6Jw= -github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed h1:hI3H8i+kR6n69Uls+Up+xjRzZbA8uz1FsB7S+oErkhY= -github.com/go-vela/types v0.7.1-0.20210204153653-939416ae12ed/go.mod h1:e1aq1gtDHXroC1zklr85+lWXSKuAjv5DjV2tec3fMbk= -github.com/goccy/go-yaml v1.8.5 h1:f1UH5GVhLZE6ElNBAgCtF3ZUOuJ62dNOo3Y5dOJqTV4= -github.com/goccy/go-yaml v1.8.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= -github.com/goccy/go-yaml v1.8.8 h1:MGfRB1GeSn/hWXYWS2Pt67iC2GJNnebdIro01ddyucA= -github.com/goccy/go-yaml v1.8.8/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/go-vela/compiler v0.7.2 h1:cvuCxJgxg+gxPBSrs2x0T5+VFSkKeyVKt20n6hk8AXs= +github.com/go-vela/compiler v0.7.2/go.mod h1:cHDJdAps5eln5eAqU0xh8nEQtIUtiSSXot+6g3yBJKc= +github.com/go-vela/mock v0.7.2 h1:tovXTHJOSR3lXRmUDUSc20GoJtCU5GH0UQMX3JBmjx4= +github.com/go-vela/mock v0.7.2/go.mod h1:K1YqAz0Zyl0NGdKdMHs4F57mGNRfT29pxRx6Fvi5IdA= +github.com/go-vela/pkg-executor v0.7.2 h1:OyT4lSGljOBaczE3p1Tzi8CrVesVcwjACOBHCG0Z/Fw= +github.com/go-vela/pkg-executor v0.7.2/go.mod h1:OX8QQL2T/EqMEVAGTNKIRppJXjrtJO5rQE4ExQhuU1k= +github.com/go-vela/pkg-queue v0.7.2 h1:carPo67kmuE8RiE54EmYNmrUZglN9RKL99C8wv5jFPQ= +github.com/go-vela/pkg-queue v0.7.2/go.mod h1:0eqwFmFzr8OLaXttengZ3aML1IHAg0x1NKnrulz2aGk= +github.com/go-vela/pkg-runtime v0.7.2 h1:KpWgJIYVZu6/2I1hw6bF3EdVJAUEQ6LwPvH4aCJGfaI= +github.com/go-vela/pkg-runtime v0.7.2/go.mod h1:l1r3OeRsB/3xfk8GtAh5zaqFK4vGHpFpV+uHBDqLVug= +github.com/go-vela/sdk-go v0.7.2 h1:RT76aECly43i/xsXWrZgUoVfWTAWxZnWmHXK3F0VqZA= +github.com/go-vela/sdk-go v0.7.2/go.mod h1:5kj+iti8RATJnZIEhuPyS9OcPXU2rvQHV8kprO9zSFc= +github.com/go-vela/types v0.7.2 h1:ERsqcAb2sXNqEPOBtRBnZ3IRp4xEIVEIZ9TqqgypKGo= +github.com/go-vela/types v0.7.2/go.mod h1:VWpaynT/gWAMsqh6/FQygCzL8LSy289cqV36UIhubD8= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -403,8 +397,6 @@ github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= @@ -772,7 +764,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 7bddf1a646b97e8ac27f370ae551d6898603f487 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 12 Feb 2021 11:54:36 -0600 Subject: [PATCH 157/430] ci(Makefile): remove pull target from up target (#159) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 02443dbf..9f4d4f9b 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ restart: down up # # Usage: `make up` .PHONY: up -up: build pull compose-up +up: build compose-up # The `down` target is intended to destroy # the local Docker compose stack. From 2e51507214406db6d6a3c418bbb648b5e0085fc2 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 17 Feb 2021 21:24:49 +0000 Subject: [PATCH 158/430] chore(actions): pin golang to 1.15 (#161) * chore(actions): pin golang to 1.15 * up go.mod version --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 4 ++-- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 2 +- go.mod | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b95230f..aaa98822 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index e0a7c28d..ac2ef3be 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -12,7 +12,7 @@ jobs: prerelease: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7b20a1e1..6db5c8fe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: publish: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a625d367..9fdbe949 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: release: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index efb9f856..7129c0bd 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -10,7 +10,7 @@ jobs: diff-review: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 @@ -27,7 +27,7 @@ jobs: full-review: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e32bc53d..f914f797 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b95283e0..82c0c7ee 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -11,7 +11,7 @@ jobs: validate: runs-on: ubuntu-latest container: - image: golang:latest + image: golang:1.15 steps: - name: clone uses: actions/checkout@v2 diff --git a/go.mod b/go.mod index 65b0fc93..0ecadf04 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-vela/worker -go 1.13 +go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 From 9a5ff240e5e0203dd6c7cfc4b30fc1a0ef449a57 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 19 Feb 2021 21:18:55 +0000 Subject: [PATCH 159/430] chore(release): v0.7.3 (#163) --- go.mod | 12 ++++++------ go.sum | 34 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 0ecadf04..296a3066 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.2 - github.com/go-vela/pkg-queue v0.7.2 - github.com/go-vela/pkg-runtime v0.7.2 - github.com/go-vela/sdk-go v0.7.2 - github.com/go-vela/types v0.7.2 + github.com/go-vela/pkg-executor v0.7.3 + github.com/go-vela/pkg-queue v0.7.3 + github.com/go-vela/pkg-runtime v0.7.3 + github.com/go-vela/sdk-go v0.7.3 + github.com/go-vela/types v0.7.3 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 - github.com/sirupsen/logrus v1.7.0 + github.com/sirupsen/logrus v1.8.0 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 diff --git a/go.sum b/go.sum index 41e3fb73..ab8b7e15 100644 --- a/go.sum +++ b/go.sum @@ -197,20 +197,20 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.2 h1:cvuCxJgxg+gxPBSrs2x0T5+VFSkKeyVKt20n6hk8AXs= -github.com/go-vela/compiler v0.7.2/go.mod h1:cHDJdAps5eln5eAqU0xh8nEQtIUtiSSXot+6g3yBJKc= -github.com/go-vela/mock v0.7.2 h1:tovXTHJOSR3lXRmUDUSc20GoJtCU5GH0UQMX3JBmjx4= -github.com/go-vela/mock v0.7.2/go.mod h1:K1YqAz0Zyl0NGdKdMHs4F57mGNRfT29pxRx6Fvi5IdA= -github.com/go-vela/pkg-executor v0.7.2 h1:OyT4lSGljOBaczE3p1Tzi8CrVesVcwjACOBHCG0Z/Fw= -github.com/go-vela/pkg-executor v0.7.2/go.mod h1:OX8QQL2T/EqMEVAGTNKIRppJXjrtJO5rQE4ExQhuU1k= -github.com/go-vela/pkg-queue v0.7.2 h1:carPo67kmuE8RiE54EmYNmrUZglN9RKL99C8wv5jFPQ= -github.com/go-vela/pkg-queue v0.7.2/go.mod h1:0eqwFmFzr8OLaXttengZ3aML1IHAg0x1NKnrulz2aGk= -github.com/go-vela/pkg-runtime v0.7.2 h1:KpWgJIYVZu6/2I1hw6bF3EdVJAUEQ6LwPvH4aCJGfaI= -github.com/go-vela/pkg-runtime v0.7.2/go.mod h1:l1r3OeRsB/3xfk8GtAh5zaqFK4vGHpFpV+uHBDqLVug= -github.com/go-vela/sdk-go v0.7.2 h1:RT76aECly43i/xsXWrZgUoVfWTAWxZnWmHXK3F0VqZA= -github.com/go-vela/sdk-go v0.7.2/go.mod h1:5kj+iti8RATJnZIEhuPyS9OcPXU2rvQHV8kprO9zSFc= -github.com/go-vela/types v0.7.2 h1:ERsqcAb2sXNqEPOBtRBnZ3IRp4xEIVEIZ9TqqgypKGo= -github.com/go-vela/types v0.7.2/go.mod h1:VWpaynT/gWAMsqh6/FQygCzL8LSy289cqV36UIhubD8= +github.com/go-vela/compiler v0.7.3 h1:/3AP1uYk+K0vZVJNttA0Dyp9lYsyLPTB/iAF/OfV/30= +github.com/go-vela/compiler v0.7.3/go.mod h1:xMVdK2vQML4CyZP5pLXEGt8KuLVXSoT2+nz4laHE8EU= +github.com/go-vela/mock v0.7.3 h1:pvOap2DzUd7De/VTVQkWZgqdei3SQnQdTBmXmOAv6eg= +github.com/go-vela/mock v0.7.3/go.mod h1:oAaP3+MikD9nYur3Xy+ogG+frMvSyRm4M4W66TNBkd0= +github.com/go-vela/pkg-executor v0.7.3 h1:9bbA0db675rb8XX5r4ooFaFw9h+s8A9cBXOklZMjOcQ= +github.com/go-vela/pkg-executor v0.7.3/go.mod h1:yQq0KKVMOj3wMive/Y6nvHCSxPi7HY90UCu6OAkMP44= +github.com/go-vela/pkg-queue v0.7.3 h1:AwW0ur+RWqZJ76hUIeAx98gchXkYkv7pVmEmWl5VHaU= +github.com/go-vela/pkg-queue v0.7.3/go.mod h1:qpZVA058jjy2ZNZR3xw+WZ3MH99adH7or74i9zKipRU= +github.com/go-vela/pkg-runtime v0.7.3 h1:e7vmzJiDjEY1UxSNCNG9oRafUxpwc6pD+BtKRuBiSBI= +github.com/go-vela/pkg-runtime v0.7.3/go.mod h1:M5KA4E3JFhn2SZA9yvKbEncNTspnU7mWUx9xNz5v5vY= +github.com/go-vela/sdk-go v0.7.3 h1:IsndR8UU/JaNlr9UnYBumf1/zp3pP9amj1QRJJSM7Pw= +github.com/go-vela/sdk-go v0.7.3/go.mod h1:MSk5dRxEPSD9fVxJrxpzlEsvLgYs6lGVr4dhacRunn4= +github.com/go-vela/types v0.7.3 h1:q0gUtl/IKBCxjfHkRSHbYcKBF7FMGVi6m7RAE4ZGGzk= +github.com/go-vela/types v0.7.3/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -393,6 +393,8 @@ github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g= +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -540,8 +542,8 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= +github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= From f16cd8c92c49dc4c9b53da9cfa540071b5e378b8 Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Tue, 23 Feb 2021 09:33:15 -0600 Subject: [PATCH 160/430] fix(executors): set id in returned payload (#169) --- api/executor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/executor.go b/api/executor.go index 63ac478a..84907c93 100644 --- a/api/executor.go +++ b/api/executor.go @@ -142,7 +142,7 @@ func GetExecutors(c *gin.Context) { executors := []*library.Executor{} - for _, executor := range e { + for id, executor := range e { // create a temporary executor to append results to response tmp := &library.Executor{} @@ -150,6 +150,7 @@ func GetExecutors(c *gin.Context) { // tmp.SetHost(executor.GetHost()) tmp.SetRuntime("docker") tmp.SetDistribution("linux") + tmp.SetID(int64(id)) // get build on executor tmp.Build, err = executor.GetBuild() From be762c36366cec90ea7afff20515289c6cd20713 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Feb 2021 13:11:02 -0600 Subject: [PATCH 161/430] fix(deps): update golang.org/x/sync commit hash to 036812b (#166) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 296a3066..cc618dfb 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,6 @@ require ( github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.8.0 github.com/urfave/cli/v2 v2.3.0 - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index ab8b7e15..590484a9 100644 --- a/go.sum +++ b/go.sum @@ -726,6 +726,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 16fcdfcc618b1ff2be2338a0f57e63768da96876 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 25 Feb 2021 19:18:33 +0000 Subject: [PATCH 162/430] chore: add codeql (#171) --- .github/workflows/codeql-analysis.yml | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..5f2ba692 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '38 18 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 0825dc880fb5fb911387e9721505b2a6489490d1 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 26 Feb 2021 09:22:15 -0600 Subject: [PATCH 163/430] docs: fix authorization callback url (#170) Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- DOCS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCS.md b/DOCS.md index ea2b465d..7edf5824 100644 --- a/DOCS.md +++ b/DOCS.md @@ -44,7 +44,7 @@ echo "VELA_SOURCE_URL=" >> .env * Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: * `Application name` = `Vela - local` (name of the OAuth application shouldn't matter) * `Homepage URL` = `http://localhost:8080` (base URL of the server) - * `Authorization callback URL` = `http://localhost:8888/account/authenticate` (authenticate endpoint of the base URL of the UI) + * `Authorization callback URL` = `http://localhost:8080/authenticate` (authenticate endpoint of the base URL of the server) * Add OAuth client secrets to a local `.env` file: @@ -201,4 +201,4 @@ This component is used for storing sensitive data like secrets. For more information, please review [the official documentation](https://www.vaultproject.io/).

- \ No newline at end of file + From 52d3d73573250d7e7a5e5fdb27c6d60f4d704964 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 9 Mar 2021 12:10:59 -0600 Subject: [PATCH 164/430] chore: upgrade go-vela deps on v0.7.4 (#176) --- go.mod | 10 ++--- go.sum | 115 ++++++++++++--------------------------------------------- 2 files changed, 29 insertions(+), 96 deletions(-) diff --git a/go.mod b/go.mod index cc618dfb..03bbdb9b 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-vela/pkg-executor v0.7.3 - github.com/go-vela/pkg-queue v0.7.3 - github.com/go-vela/pkg-runtime v0.7.3 - github.com/go-vela/sdk-go v0.7.3 - github.com/go-vela/types v0.7.3 + github.com/go-vela/pkg-executor v0.7.4 + github.com/go-vela/pkg-queue v0.7.4 + github.com/go-vela/pkg-runtime v0.7.4 + github.com/go-vela/sdk-go v0.7.4 + github.com/go-vela/types v0.7.4 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.8.0 diff --git a/go.sum b/go.sum index 590484a9..84ef7b14 100644 --- a/go.sum +++ b/go.sum @@ -47,12 +47,12 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.0 h1:P1ekkbuU73Ui/wS0nK1HOM37hh4xdfZo485UPf8rc+Y= -github.com/Masterminds/sprig/v3 v3.2.0/go.mod h1:tWhwTbUTndesPNeF0C900vKoq283u6zp4APT9vaF3SI= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -71,13 +71,12 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U= github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.14.1 h1:GjlbSeoJ24bzdLRs13HoMEeaRZx9kg5nHoRW7QV/nCs= -github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg= +github.com/alicebob/miniredis/v2 v2.14.3 h1:QWoo2wchYmLgOB6ctlTt2dewQ1Vu6phl+iQbwT8SYGo= +github.com/alicebob/miniredis/v2 v2.14.3/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -114,7 +113,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -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/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -127,7 +125,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 h1:w3NnFcKR5241cfmQU5ZZAsf0xcpId6mWOupTvJlUX2U= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible h1:SiUATuP//KecDjpOK2tvZJgeScYAklvyjfK8JZlU6fo= github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -151,14 +148,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -189,7 +184,6 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= @@ -197,29 +191,27 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.7.3 h1:/3AP1uYk+K0vZVJNttA0Dyp9lYsyLPTB/iAF/OfV/30= -github.com/go-vela/compiler v0.7.3/go.mod h1:xMVdK2vQML4CyZP5pLXEGt8KuLVXSoT2+nz4laHE8EU= -github.com/go-vela/mock v0.7.3 h1:pvOap2DzUd7De/VTVQkWZgqdei3SQnQdTBmXmOAv6eg= -github.com/go-vela/mock v0.7.3/go.mod h1:oAaP3+MikD9nYur3Xy+ogG+frMvSyRm4M4W66TNBkd0= -github.com/go-vela/pkg-executor v0.7.3 h1:9bbA0db675rb8XX5r4ooFaFw9h+s8A9cBXOklZMjOcQ= -github.com/go-vela/pkg-executor v0.7.3/go.mod h1:yQq0KKVMOj3wMive/Y6nvHCSxPi7HY90UCu6OAkMP44= -github.com/go-vela/pkg-queue v0.7.3 h1:AwW0ur+RWqZJ76hUIeAx98gchXkYkv7pVmEmWl5VHaU= -github.com/go-vela/pkg-queue v0.7.3/go.mod h1:qpZVA058jjy2ZNZR3xw+WZ3MH99adH7or74i9zKipRU= -github.com/go-vela/pkg-runtime v0.7.3 h1:e7vmzJiDjEY1UxSNCNG9oRafUxpwc6pD+BtKRuBiSBI= -github.com/go-vela/pkg-runtime v0.7.3/go.mod h1:M5KA4E3JFhn2SZA9yvKbEncNTspnU7mWUx9xNz5v5vY= -github.com/go-vela/sdk-go v0.7.3 h1:IsndR8UU/JaNlr9UnYBumf1/zp3pP9amj1QRJJSM7Pw= -github.com/go-vela/sdk-go v0.7.3/go.mod h1:MSk5dRxEPSD9fVxJrxpzlEsvLgYs6lGVr4dhacRunn4= -github.com/go-vela/types v0.7.3 h1:q0gUtl/IKBCxjfHkRSHbYcKBF7FMGVi6m7RAE4ZGGzk= -github.com/go-vela/types v0.7.3/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= +github.com/go-vela/compiler v0.7.4 h1:dJG5Qmq3eQrT+5TzrOhdWKCG9RjIXI0uKakGDAtwOcU= +github.com/go-vela/compiler v0.7.4/go.mod h1:1l4DWOSHJMHVcmgq6P6PEDTQicI6KMtSn7GI8LmoJ+M= +github.com/go-vela/mock v0.7.4 h1:YthX/HXq9796wUAd+LV++x1tHnUJoWQnKZw7Rupw54w= +github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= +github.com/go-vela/pkg-executor v0.7.4 h1:qAY+vywxDTKykIiQet1aZObXRWT45lc9JCBbSUbEFRs= +github.com/go-vela/pkg-executor v0.7.4/go.mod h1:BHSNSW0RLcvmcRCLi+LtYH/bm3NSWYUldN12b4KOvlQ= +github.com/go-vela/pkg-queue v0.7.4 h1:CVfygL8idPl6RuXevA5YrdyXjvkJpC4g7Pg06ltR0Dw= +github.com/go-vela/pkg-queue v0.7.4/go.mod h1:9oe/qmuRaByQZdeedROATTqAMYZhoPgZC36EhN0753Q= +github.com/go-vela/pkg-runtime v0.7.4 h1:uz9Zqub/YW9Tf/d2jnUc9fCv2fEGyjHMukzZ7yrRet4= +github.com/go-vela/pkg-runtime v0.7.4/go.mod h1:CCY2iidKjW7Pte4quOG6Zn9Flx7OyV4uQEP0TM2Jj3I= +github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= +github.com/go-vela/sdk-go v0.7.4/go.mod h1:I1K3LpWOnfsJUhHXJf7DpwR9zVz4h65hRXzQ5IOxPuo= +github.com/go-vela/types v0.7.4 h1:iVz1kDS/uvkOoridyyt0bTZ5tG2j3QYx25rbyFdu35M= +github.com/go-vela/types v0.7.4/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -235,9 +227,7 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= @@ -247,7 +237,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= @@ -259,11 +248,9 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= @@ -275,7 +262,6 @@ github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvK github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -291,15 +277,12 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.4 h1:0ecGp3skIrHWPNGPJDaBIghfA6Sp7Ruo2Io8eLKzWm0= github.com/google/uuid v1.1.4/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/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= @@ -320,8 +303,9 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -342,7 +326,6 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= @@ -362,7 +345,6 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= @@ -375,12 +357,9 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -448,7 +427,6 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= @@ -456,9 +434,7 @@ github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= @@ -484,7 +460,6 @@ github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -497,14 +472,12 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= @@ -512,7 +485,6 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -520,7 +492,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -538,9 +509,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= @@ -564,20 +533,15 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= @@ -592,8 +556,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -625,9 +587,7 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -677,7 +637,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -697,12 +656,9 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -710,22 +666,17 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013 h1:55H5j7lotzuFCEOKDsMch+fRNUQ9DgtyHOUP31FNqKc= -golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 h1:alLDrZkL34Y2bnGHfvC1CYBRBXCXgx8AC2vY4MRtYX4= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -777,7 +728,6 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -785,19 +735,15 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0J golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -852,7 +798,6 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -881,7 +826,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -924,7 +868,6 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -932,7 +875,6 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= @@ -944,19 +886,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -973,16 +912,12 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1018,9 +953,7 @@ k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 0f67196e1e1280624396a1f0af62d0d0793a784a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Mar 2021 00:19:26 -0600 Subject: [PATCH 165/430] fix(deps): update module github.com/sirupsen/logrus to v1.8.1 (#173) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 03bbdb9b..a0030ed8 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-vela/types v0.7.4 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.9.0 - github.com/sirupsen/logrus v1.8.0 + github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 diff --git a/go.sum b/go.sum index 84ef7b14..20558d5b 100644 --- a/go.sum +++ b/go.sum @@ -513,6 +513,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= +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.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= From 331a8862df66bd2205e8275822e9e713c5f2d2be Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Tue, 23 Mar 2021 09:35:42 -0500 Subject: [PATCH 166/430] feat(shutdown): handle sigterm properly (#154) * feat(shutdown): handle sigterm properly * fix sum * update comments * add timeout flag * update go.sum * update import * make golangci-lint happy * update pkg-queue version --- cmd/vela-worker/exec.go | 31 ++------- cmd/vela-worker/operate.go | 77 +++++++++++++--------- cmd/vela-worker/run.go | 1 + cmd/vela-worker/server.go | 12 ++-- cmd/vela-worker/start.go | 132 ++++++++++++++++++++----------------- go.mod | 3 +- go.sum | 6 +- 7 files changed, 132 insertions(+), 130 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2324b352..169ad4df 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,9 +6,6 @@ package main import ( "context" - "os" - "os/signal" - "syscall" "time" "github.com/go-vela/pkg-executor/executor" @@ -42,6 +39,10 @@ func (w *Worker) exec(index int) error { return err } + if item == nil { + return nil + } + // setup the executor // // https://godoc.org/github.com/go-vela/pkg-executor/executor#New @@ -86,30 +87,6 @@ func (w *Worker) exec(index int) error { ctx, timeout := context.WithTimeout(ctx, t) defer timeout() - // create channel for catching OS signals - sigchan := make(chan os.Signal, 1) - - // add a cancelation signal to our current context - ctx, sig := context.WithCancel(ctx) - - // set the OS signals the Worker will respond to - signal.Notify(sigchan, syscall.SIGTERM) - - // defer canceling the context - defer func() { - signal.Stop(sigchan) - sig() - }() - - // spawn a goroutine to listen for the signals - go func() { - select { - case <-sigchan: - sig() - case <-ctx.Done(): - } - }() - defer func() { logger.Info("destroying build") // destroy the build with the executor diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 232221d6..9e713504 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -5,6 +5,7 @@ package main import ( + "context" "time" "github.com/go-vela/pkg-queue/queue" @@ -18,7 +19,8 @@ import ( // operate is a helper function to initiate all // subprocesses for the operator to poll the // queue and execute Vela pipelines. -func (w *Worker) operate() error { +// nolint: funlen // ignore function length +func (w *Worker) operate(ctx context.Context) error { var err error // setup the client @@ -27,6 +29,11 @@ func (w *Worker) operate() error { return err } + // create the errgroup for managing operator subprocesses + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group + executors, gctx := errgroup.WithContext(ctx) + // Define the database representation of the worker // and register itself in the database registryWorker := new(library.Worker) @@ -38,26 +45,33 @@ func (w *Worker) operate() error { registryWorker.SetBuildLimit(int64(w.Config.Build.Limit)) // spawn goroutine for phoning home - go func() { + executors.Go(func() error { for { - // set checking time to now and call the server - registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + select { + case <-gctx.Done(): + logrus.Info("Completed looping on worker registration") + return nil + default: + // set checking time to now and call the server + registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + + // register or update the worker + err = w.checkIn(registryWorker) + if err != nil { + logrus.Error(err) + } - // register or update the worker - err = w.checkIn(registryWorker) - if err != nil { - logrus.Error(err) - } + // if unable to update the worker, log the error but allow the worker to continue running + if err != nil { + // nolint: lll // ignore long line length due to error message + logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) + } - // if unable to update the worker, log the error but allow the worker to continue running - if err != nil { - logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) + // sleep for the configured time + time.Sleep(w.Config.CheckIn) } - - // sleep for the configured time - time.Sleep(w.Config.CheckIn) } - }() + }) // setup the queue // @@ -67,11 +81,6 @@ func (w *Worker) operate() error { return err } - // create the errgroup for managing operator subprocesses - // - // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group - executors := new(errgroup.Group) - // iterate till the configured build limit for i := 0; i < w.Config.Build.Limit; i++ { // evaluate and capture i at each iteration @@ -90,15 +99,23 @@ func (w *Worker) operate() error { executors.Go(func() error { // create an infinite loop to poll for builds for { - // exec operator subprocess to poll and execute builds - err = w.exec(id) - if err != nil { - // log the error received from the executor - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf - logrus.Errorf("failing worker executor: %v", err) - - return err + select { + case <-gctx.Done(): + logrus.WithFields(logrus.Fields{ + "id": id, + }).Info("Completed looping on worker executor") + return nil + default: + // exec operator subprocess to poll and execute builds + err = w.exec(id) + if err != nil { + // log the error received from the executor + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf + logrus.Errorf("failing worker executor: %v", err) + + return err + } } } }) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 64b01fd8..90b18404 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -116,6 +116,7 @@ func run(c *cli.Context) error { Config: c.String("queue.config"), Cluster: c.Bool("queue.cluster"), Routes: c.StringSlice("queue.worker.routes"), + Timeout: c.Duration("queue.worker.blpop.timeout"), }, // server configuration Server: &Server{ diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index e9e9947c..44cc1095 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -5,7 +5,7 @@ package main import ( - "fmt" + "net/http" "os" "strings" "time" @@ -18,7 +18,7 @@ import ( // server is a helper function to listen and serve // traffic for web and API requests for the Worker. -func (w *Worker) server() error { +func (w *Worker) server() (http.Handler, bool) { // log a message indicating the setup of the server handlers // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Trace @@ -54,14 +54,10 @@ func (w *Worker) server() error { } else { logrus.Fatal("unable to run with TLS: No certificate provided") } - return _server.RunTLS( - fmt.Sprintf(":%s", w.Config.API.Address.Port()), - w.Config.Certificate.Cert, - w.Config.Certificate.Key, - ) + return _server, true } // else serve over http // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run - return _server.Run(fmt.Sprintf(":%s", w.Config.API.Address.Port())) + return _server, false } diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 4f808a14..f27350c5 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -5,9 +5,15 @@ package main import ( - "github.com/sirupsen/logrus" + "context" + "fmt" + "net/http" + "os" + "os/signal" + "syscall" - tomb "gopkg.in/tomb.v2" + "github.com/sirupsen/logrus" + "golang.org/x/sync/errgroup" ) // Start initiates all subprocesses for the Worker @@ -17,79 +23,87 @@ import ( // operator subprocess enables the Worker to // poll the queue and execute Vela pipelines. func (w *Worker) Start() error { - // create the tomb for managing worker subprocesses + // create the context for controlling the worker subprocesses + ctx, done := context.WithCancel(context.Background()) + // create the errgroup for managing worker subprocesses // - // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb - tomb := new(tomb.Tomb) + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group + g, gctx := errgroup.WithContext(ctx) - // spawn a tomb goroutine to manage the worker subprocesses - // - // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Go - tomb.Go(func() error { - // spawn goroutine for starting the server - go func() { - // log a message indicating the start of the server - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info - logrus.Info("starting worker server") + httpHandler, tls := w.server() - // start the server for the worker - err := w.server() - if err != nil { - // log the error received from the server - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf - logrus.Errorf("failing worker server: %v", err) + server := &http.Server{ + Addr: fmt.Sprintf(":%s", w.Config.API.Address.Port()), + Handler: httpHandler, + } - // kill the worker subprocesses - // - // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill - tomb.Kill(err) + // goroutine to check for signals to gracefully finish all functions + g.Go(func() error { + signalChannel := make(chan os.Signal, 1) + signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM) + + select { + case sig := <-signalChannel: + logrus.Infof("Received signal: %s", sig) + err := server.Shutdown(ctx) + if err != nil { + logrus.Error(err) } - }() + done() + case <-gctx.Done(): + logrus.Info("Closing signal goroutine") + err := server.Shutdown(ctx) + if err != nil { + logrus.Error(err) + } + return gctx.Err() + } - // spawn goroutine for starting the operator - go func() { - // log a message indicating the start of the operator - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info - logrus.Info("starting worker operator") + return nil + }) - // start the operator for the worker - err := w.operate() - if err != nil { - // log the error received from the operator + // spawn goroutine for starting the server + g.Go(func() error { + var err error + logrus.Info("starting worker server") + if tls { + // nolint: lll // ignore long line length due to error message + if err := server.ListenAndServeTLS(w.Config.Certificate.Cert, w.Config.Certificate.Key); err != http.ErrServerClosed { + // log a message indicating the start of the server // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf - logrus.Errorf("failing worker operator: %v", err) - - // kill the worker subprocesses + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info + logrus.Errorf("failing worker server: %v", err) + } + } else { + if err := server.ListenAndServe(); err != http.ErrServerClosed { + // log a message indicating the start of the server // - // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Kill - tomb.Kill(err) + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info + logrus.Errorf("failing worker server: %v", err) } - }() + } - // create an infinite loop to poll for errors - // - // nolint: gosimple // ignore this for now - for { - // create a select statement to check for errors - select { - // check if one of the worker subprocesses died - case <-tomb.Dying(): - // fatally log that we're shutting down the worker - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Fatal - logrus.Fatal("shutting down worker") + return err + }) - return tomb.Err() - } + // spawn goroutine for starting the operator + g.Go(func() error { + logrus.Info("starting worker operator") + // start the operator for the worker + err := w.operate(gctx) + if err != nil { + // log the error received from the operator + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf + logrus.Errorf("failing worker operator: %v", err) + return err } + + return err }) // wait for errors from worker subprocesses // // https://pkg.go.dev/gopkg.in/tomb.v2?tab=doc#Tomb.Wait - return tomb.Wait() + return g.Wait() } diff --git a/go.mod b/go.mod index a0030ed8..4dd49416 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 github.com/go-vela/pkg-executor v0.7.4 - github.com/go-vela/pkg-queue v0.7.4 + github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9 github.com/go-vela/pkg-runtime v0.7.4 github.com/go-vela/sdk-go v0.7.4 github.com/go-vela/types v0.7.4 @@ -15,5 +15,4 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) diff --git a/go.sum b/go.sum index 20558d5b..b7202ddd 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/go-vela/mock v0.7.4 h1:YthX/HXq9796wUAd+LV++x1tHnUJoWQnKZw7Rupw54w= github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= github.com/go-vela/pkg-executor v0.7.4 h1:qAY+vywxDTKykIiQet1aZObXRWT45lc9JCBbSUbEFRs= github.com/go-vela/pkg-executor v0.7.4/go.mod h1:BHSNSW0RLcvmcRCLi+LtYH/bm3NSWYUldN12b4KOvlQ= -github.com/go-vela/pkg-queue v0.7.4 h1:CVfygL8idPl6RuXevA5YrdyXjvkJpC4g7Pg06ltR0Dw= -github.com/go-vela/pkg-queue v0.7.4/go.mod h1:9oe/qmuRaByQZdeedROATTqAMYZhoPgZC36EhN0753Q= +github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9 h1:q4AaO2hpAxTdnmr2tDusd7obYGQNWdrGfPRHluo6avo= +github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9/go.mod h1:Piy3qvDQaOzGRiSoF7eyW12boJZFu3LnYmDd1imoy8k= github.com/go-vela/pkg-runtime v0.7.4 h1:uz9Zqub/YW9Tf/d2jnUc9fCv2fEGyjHMukzZ7yrRet4= github.com/go-vela/pkg-runtime v0.7.4/go.mod h1:CCY2iidKjW7Pte4quOG6Zn9Flx7OyV4uQEP0TM2Jj3I= github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= @@ -907,8 +907,6 @@ gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From aa1618ab3284a6c7c8d4ab5b053fbcf70425303e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Mar 2021 10:19:39 -0500 Subject: [PATCH 167/430] fix(deps): update module github.com/prometheus/client_golang to v1.10.0 (#177) * fix(deps): update module github.com/prometheus/client_golang to v1.10.0 * chore: manual make clean for renovate Co-authored-by: Renovate Bot Co-authored-by: Jordan Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- go.mod | 2 +- go.sum | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 4dd49416..82ea9ebc 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-vela/sdk-go v0.7.4 github.com/go-vela/types v0.7.4 github.com/joho/godotenv v1.3.0 - github.com/prometheus/client_golang v1.9.0 + github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c diff --git a/go.sum b/go.sum index b7202ddd..60f72fc1 100644 --- a/go.sum +++ b/go.sum @@ -372,7 +372,6 @@ github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g= github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= @@ -473,8 +472,8 @@ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -486,15 +485,15 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -511,7 +510,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -679,6 +677,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -730,9 +729,9 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From f1354869594ce355bd539cecbb612d95eac66134 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 7 Apr 2021 11:14:03 -0500 Subject: [PATCH 168/430] refactor: update go-vela/pkg-queue to latest (#178) * chore: update go-vela/pkg-queue on master * refactor: updates for go-vela/pkg-queue --- cmd/vela-worker/exec.go | 2 +- cmd/vela-worker/run.go | 6 +++--- docker-compose.yml | 12 ++++++------ go.mod | 2 +- go.sum | 35 +++++++++++++++++++++++++++-------- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 169ad4df..2d40428f 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -34,7 +34,7 @@ func (w *Worker) exec(index int) error { } // capture an item from the queue - item, err := w.Queue.Pop() + item, err := w.Queue.Pop(context.Background()) if err != nil { return err } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 90b18404..2b71c376 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -113,10 +113,10 @@ func run(c *cli.Context) error { // queue configuration Queue: &queue.Setup{ Driver: c.String("queue.driver"), - Config: c.String("queue.config"), + Address: c.String("queue.addr"), Cluster: c.Bool("queue.cluster"), - Routes: c.StringSlice("queue.worker.routes"), - Timeout: c.Duration("queue.worker.blpop.timeout"), + Routes: c.StringSlice("queue.routes"), + Timeout: c.Duration("queue.pop.timeout"), }, // server configuration Server: &Server{ diff --git a/docker-compose.yml b/docker-compose.yml index e81bf765..7f1407ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,12 +20,12 @@ services: networks: - vela environment: + QUEUE_DRIVER: redis + QUEUE_ADDR: 'redis://redis:6379' + QUEUE_ROUTES: 'docker,local,docker:local' VELA_BUILD_LIMIT: 1 VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace - VELA_QUEUE_DRIVER: redis - VELA_QUEUE_CONFIG: 'redis://redis:6379' - VELA_QUEUE_WORKER_ROUTES: 'docker,local,docker:local' VELA_RUNTIME_DRIVER: docker VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' @@ -52,14 +52,14 @@ services: networks: - vela environment: + QUEUE_DRIVER: redis + QUEUE_ADDR: 'redis://redis:6379' + QUEUE_ROUTES: 'docker,local,docker:local' VELA_ADDR: 'http://localhost:8080' VELA_WEBUI_ADDR: 'http://localhost:8888' VELA_DATABASE_DRIVER: postgres VELA_DATABASE_CONFIG: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' VELA_LOG_LEVEL: trace - VELA_QUEUE_DRIVER: redis - VELA_QUEUE_CONFIG: 'redis://redis:6379' - VELA_QUEUE_WORKER_ROUTES: 'docker,local,docker:local' VELA_PORT: ':8080' VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' VELA_SOURCE_DRIVER: github diff --git a/go.mod b/go.mod index 82ea9ebc..714e089c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.6.3 github.com/go-vela/pkg-executor v0.7.4 - github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9 + github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 github.com/go-vela/pkg-runtime v0.7.4 github.com/go-vela/sdk-go v0.7.4 github.com/go-vela/types v0.7.4 diff --git a/go.sum b/go.sum index 60f72fc1..227c06af 100644 --- a/go.sum +++ b/go.sum @@ -123,6 +123,8 @@ 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= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -187,8 +189,8 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis/v8 v8.8.0 h1:fDZP58UN/1RD3DjtTXP/fFZ04TFohSYhjZDkcDe2dnw= +github.com/go-redis/redis/v8 v8.8.0/go.mod h1:F7resOH5Kdug49Otu24RjHWwgK7u9AmtqWMnCV1iP5Y= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.7.4 h1:dJG5Qmq3eQrT+5TzrOhdWKCG9RjIXI0uKakGDAtwOcU= @@ -197,8 +199,8 @@ github.com/go-vela/mock v0.7.4 h1:YthX/HXq9796wUAd+LV++x1tHnUJoWQnKZw7Rupw54w= github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= github.com/go-vela/pkg-executor v0.7.4 h1:qAY+vywxDTKykIiQet1aZObXRWT45lc9JCBbSUbEFRs= github.com/go-vela/pkg-executor v0.7.4/go.mod h1:BHSNSW0RLcvmcRCLi+LtYH/bm3NSWYUldN12b4KOvlQ= -github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9 h1:q4AaO2hpAxTdnmr2tDusd7obYGQNWdrGfPRHluo6avo= -github.com/go-vela/pkg-queue v0.7.5-0.20210312154545-ffd1c460efa9/go.mod h1:Piy3qvDQaOzGRiSoF7eyW12boJZFu3LnYmDd1imoy8k= +github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 h1:/K6hmGkYfJKaGwH7uNHN8M1SP7crWxjS9cQrD7gx8kA= +github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88/go.mod h1:AcS5EDcNHhoJbsJlxtOKesRJ79XUnE9kqnUJMnOJITY= github.com/go-vela/pkg-runtime v0.7.4 h1:uz9Zqub/YW9Tf/d2jnUc9fCv2fEGyjHMukzZ7yrRet4= github.com/go-vela/pkg-runtime v0.7.4/go.mod h1:CCY2iidKjW7Pte4quOG6Zn9Flx7OyV4uQEP0TM2Jj3I= github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= @@ -253,8 +255,9 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= @@ -428,16 +431,18 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -536,8 +541,9 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= @@ -554,6 +560,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q 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/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= @@ -567,6 +574,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng= +go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= +go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg= +go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= +go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q= +go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= +go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= +go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= go.starlark.net v0.0.0-20201014215153-dff0ae5b4820 h1:GsJfRMJ3pXl+Pa5CkSQKIA1hNIo1u0M7I2+ff3RCCME= go.starlark.net v0.0.0-20201014215153-dff0ae5b4820/go.mod h1:f0znQkUKRrkk36XxWbGjMqQM8wGv/xHBVE2qc3B5oFU= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -659,6 +674,7 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -677,6 +693,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -729,6 +746,7 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -797,6 +815,7 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 31f1968e0d1f8e52c165dc9eef7557726ca468a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Apr 2021 13:18:02 -0500 Subject: [PATCH 169/430] fix(deps): update module github.com/gin-gonic/gin to v1.7.1 (#179) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 714e089c..fd2273e7 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/gin-gonic/gin v1.6.3 + github.com/gin-gonic/gin v1.7.1 github.com/go-vela/pkg-executor v0.7.4 github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 github.com/go-vela/pkg-runtime v0.7.4 diff --git a/go.sum b/go.sum index 227c06af..fffea924 100644 --- a/go.sum +++ b/go.sum @@ -166,6 +166,8 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.1 h1:qC89GU3p8TvKWMAVhEpmpB2CIb1hnqt2UdKZaP93mS8= +github.com/gin-gonic/gin v1.7.1/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 46f83569189625d35bd3606a792ae684023d8825 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 16 Apr 2021 11:17:42 -0500 Subject: [PATCH 170/430] chore: update environment variables for server (#180) --- .env.example | 4 ++-- docker-compose.yml | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 61252c32..6f209ab9 100644 --- a/.env.example +++ b/.env.example @@ -43,8 +43,8 @@ VELA_API=http://localhost:8080 # github web url (only required if using GitHub Enterprise) # -# default: https://github.com/ -# VELA_SOURCE_URL= +# default: https://github.com +# VELA_SOURCE_ADDR= # github client id from oauth application VELA_SOURCE_CLIENT= diff --git a/docker-compose.yml b/docker-compose.yml index 7f1407ec..2e3fb124 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,19 +55,22 @@ services: QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' QUEUE_ROUTES: 'docker,local,docker:local' + SOURCE_DRIVER: github + SOURCE_CONTEXT: 'continuous-integration/vela' + SECRET_VAULT: 'true' + SECRET_VAULT_ADDR: 'http://vault:8200' + SECRET_VAULT_TOKEN: vela VELA_ADDR: 'http://localhost:8080' VELA_WEBUI_ADDR: 'http://localhost:8888' VELA_DATABASE_DRIVER: postgres VELA_DATABASE_CONFIG: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' + VELA_DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' VELA_LOG_LEVEL: trace - VELA_PORT: ':8080' VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' - VELA_SOURCE_DRIVER: github - VELA_SECRET_NATIVE_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' - VELA_SECRET_VAULT: 'true' - VELA_SECRET_VAULT_ADDR: 'http://vault:8200' - VELA_SECRET_VAULT_TOKEN: vela + VELA_REFRESH_TOKEN_DURATION: 5m + VELA_ACCESS_TOKEN_DURATION: 1m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' + VELA_ENABLE_SECURE_COOKIE: 'false' env_file: - .env restart: always From f5370a88d1bff41b4bd513ae6226c88ba5502c60 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Tue, 20 Apr 2021 14:35:53 -0500 Subject: [PATCH 171/430] chore: bump executor (#181) --- cmd/vela-worker/run.go | 6 +- docker-compose.yml | 1 + go.mod | 4 +- go.sum | 222 ++++++++++++++++++++++++++++++++--------- 4 files changed, 182 insertions(+), 51 deletions(-) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 2b71c376..0cae9f21 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -105,10 +105,10 @@ func run(c *cli.Context) error { // runtime configuration Runtime: &runtime.Setup{ Driver: c.String("runtime.driver"), - Config: c.String("runtime.config"), + ConfigFile: c.String("runtime.config"), Namespace: c.String("runtime.namespace"), - Volumes: c.StringSlice("runtime.volumes"), - PrivilegedImages: c.StringSlice("runtime.allowed-privileged-images"), + HostVolumes: c.StringSlice("runtime.volumes"), + PrivilegedImages: c.StringSlice("runtime.privileged-images"), }, // queue configuration Queue: &queue.Setup{ diff --git a/docker-compose.yml b/docker-compose.yml index 2e3fb124..60df77f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,6 +27,7 @@ services: VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace VELA_RUNTIME_DRIVER: docker + VELA_RUNTIME_PRIVILEGED_IMAGES: 'target/vela-docker' VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: http://worker:8080 diff --git a/go.mod b/go.mod index fd2273e7..75f0e95c 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.1 - github.com/go-vela/pkg-executor v0.7.4 + github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844 github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 - github.com/go-vela/pkg-runtime v0.7.4 + github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186 github.com/go-vela/sdk-go v0.7.4 github.com/go-vela/types v0.7.4 github.com/joho/godotenv v1.3.0 diff --git a/go.sum b/go.sum index fffea924..5c737f3e 100644 --- a/go.sum +++ b/go.sum @@ -33,13 +33,13 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -56,6 +56,7 @@ github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFP github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -77,14 +78,17 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.14.3 h1:QWoo2wchYmLgOB6ctlTt2dewQ1Vu6phl+iQbwT8SYGo= github.com/alicebob/miniredis/v2 v2.14.3/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.38.2/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -106,8 +110,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/containerd v1.4.3 h1:ijQT13JedHSHrQGWFcGEwzcNKrAGIiZ+jSD5QQG07SY= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= +github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -117,10 +121,16 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA= +github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= @@ -128,8 +138,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible h1:SiUATuP//KecDjpOK2tvZJgeScYAklvyjfK8JZlU6fo= -github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.6+incompatible h1:oXI3Vas8TI8Eu/EjH4srKHJBVqraSzJybhxY7Om9faQ= +github.com/docker/docker v20.10.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= @@ -144,18 +154,26 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -164,7 +182,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.1 h1:qC89GU3p8TvKWMAVhEpmpB2CIb1hnqt2UdKZaP93mS8= github.com/gin-gonic/gin v1.7.1/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= @@ -174,14 +191,24 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -191,22 +218,30 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+ github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis/v8 v8.8.0 h1:fDZP58UN/1RD3DjtTXP/fFZ04TFohSYhjZDkcDe2dnw= github.com/go-redis/redis/v8 v8.8.0/go.mod h1:F7resOH5Kdug49Otu24RjHWwgK7u9AmtqWMnCV1iP5Y= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/compiler v0.7.4 h1:dJG5Qmq3eQrT+5TzrOhdWKCG9RjIXI0uKakGDAtwOcU= github.com/go-vela/compiler v0.7.4/go.mod h1:1l4DWOSHJMHVcmgq6P6PEDTQicI6KMtSn7GI8LmoJ+M= -github.com/go-vela/mock v0.7.4 h1:YthX/HXq9796wUAd+LV++x1tHnUJoWQnKZw7Rupw54w= github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= -github.com/go-vela/pkg-executor v0.7.4 h1:qAY+vywxDTKykIiQet1aZObXRWT45lc9JCBbSUbEFRs= -github.com/go-vela/pkg-executor v0.7.4/go.mod h1:BHSNSW0RLcvmcRCLi+LtYH/bm3NSWYUldN12b4KOvlQ= +github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1 h1:99+SdZ72L5vTDdB4MJShE0oa5W5rUeYens/W0vhOosM= +github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1/go.mod h1:mjLSUHXoCVEjlfAhMhqjQuwOr7ZLNGuOxOXvjK+79jE= +github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844 h1:3lb+YZK+DJJhS4twm2sphJvmS72Et7+2xaFrkFHeSt4= +github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844/go.mod h1:2874xtAJ7/xA7OwQY6BhyPBP4LAdffDu2Akrdg4v7+Q= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 h1:/K6hmGkYfJKaGwH7uNHN8M1SP7crWxjS9cQrD7gx8kA= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88/go.mod h1:AcS5EDcNHhoJbsJlxtOKesRJ79XUnE9kqnUJMnOJITY= -github.com/go-vela/pkg-runtime v0.7.4 h1:uz9Zqub/YW9Tf/d2jnUc9fCv2fEGyjHMukzZ7yrRet4= -github.com/go-vela/pkg-runtime v0.7.4/go.mod h1:CCY2iidKjW7Pte4quOG6Zn9Flx7OyV4uQEP0TM2Jj3I= +github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186 h1:sCjs5Rivkuy/r2rgvjIqtj4VNr7x03DC+RFWPGbcTA0= +github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186/go.mod h1:gfF1R51abdO4noNrlfFPgrEkct+bTpftJRtw/M1hEzs= github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= github.com/go-vela/sdk-go v0.7.4/go.mod h1:I1K3LpWOnfsJUhHXJf7DpwR9zVz4h65hRXzQ5IOxPuo= +github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff h1:1LT69ic6xXBKSi+FngkSCJTqqv3xCWTYzdlLKg9xRzk= +github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff/go.mod h1:QCB02xu5y2OMSZMNOZAjyoT3j5O6zTlDSdR/lF4ajYI= github.com/go-vela/types v0.7.4 h1:iVz1kDS/uvkOoridyyt0bTZ5tG2j3QYx25rbyFdu35M= github.com/go-vela/types v0.7.4/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -214,8 +249,11 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -245,6 +283,7 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -257,6 +296,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -264,6 +304,7 @@ github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4r github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= +github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -284,14 +325,14 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.4 h1:0ecGp3skIrHWPNGPJDaBIghfA6Sp7Ruo2Io8eLKzWm0= github.com/google/uuid v1.1.4/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.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/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -299,6 +340,7 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -308,29 +350,45 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= +github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= @@ -342,7 +400,16 @@ github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E= +github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -361,32 +428,46 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -394,14 +475,21 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -422,6 +510,8 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= @@ -431,7 +521,7 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= @@ -440,7 +530,6 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= @@ -460,11 +549,13 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -507,6 +598,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR 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/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -538,6 +631,7 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3 github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -596,18 +690,21 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/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= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -639,6 +736,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB 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/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -659,6 +757,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -678,15 +777,17 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 h1:alLDrZkL34Y2bnGHfvC1CYBRBXCXgx8AC2vY4MRtYX4= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84 h1:duBc5zuJsmJXYOVVE/6PxejI+N3AaCqKjtsoLn1Je5Q= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -709,21 +810,25 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190222072716-a9d3bda3a223/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-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -747,17 +852,23 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= @@ -766,8 +877,9 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -783,6 +895,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn 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= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -814,10 +927,12 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY 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= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -850,6 +965,7 @@ google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuh google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -881,12 +997,14 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -912,10 +1030,12 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -923,10 +1043,12 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -943,6 +1065,7 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclp gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -953,27 +1076,34 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.17.3 h1:XAm3PZp3wnEdzekNkcmj/9Y1zdmQYJ1I4GKSBBZ8aG0= -k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= -k8s.io/apimachinery v0.17.3 h1:f+uZV6rm4/tHE7xXgLyToprg6xWairaClGVkm2t8omg= +k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y= +k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= -k8s.io/client-go v0.17.3 h1:deUna1Ksx05XeESH6XGCyONNFfiQmDdqeqUvicvP6nU= -k8s.io/client-go v0.17.3/go.mod h1:cLXlTMtWHkuK4tD360KpWz2gG2KtdWEr/OT02i3emRQ= +k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA= +k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= +k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag= +k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7 h1:XQ0OMFdRDkDIu0b1zqEKSZdWUD7I4bZ4d4nqr8CLKbQ= -k8s.io/utils v0.0.0-20201005171033-6301aaf42dc7/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 1cf03d44d9bc84ef05cd238fb8fbdf2febe41f13 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 28 Apr 2021 11:20:19 -0500 Subject: [PATCH 172/430] chore: upgrade go-vela/pkg-executor on latest (#182) --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 75f0e95c..86f06e6a 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.1 - github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844 + github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01 github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 - github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186 + github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 github.com/go-vela/sdk-go v0.7.4 github.com/go-vela/types v0.7.4 github.com/joho/godotenv v1.3.0 diff --git a/go.sum b/go.sum index 5c737f3e..f42f27dd 100644 --- a/go.sum +++ b/go.sum @@ -232,12 +232,12 @@ github.com/go-vela/compiler v0.7.4/go.mod h1:1l4DWOSHJMHVcmgq6P6PEDTQicI6KMtSn7G github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1 h1:99+SdZ72L5vTDdB4MJShE0oa5W5rUeYens/W0vhOosM= github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1/go.mod h1:mjLSUHXoCVEjlfAhMhqjQuwOr7ZLNGuOxOXvjK+79jE= -github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844 h1:3lb+YZK+DJJhS4twm2sphJvmS72Et7+2xaFrkFHeSt4= -github.com/go-vela/pkg-executor v0.7.5-0.20210420190841-456373a52844/go.mod h1:2874xtAJ7/xA7OwQY6BhyPBP4LAdffDu2Akrdg4v7+Q= +github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01 h1:8SHkOYqGff0Gvf1gX6EbBYmN4HzU+valzOkoJwWvJh8= +github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01/go.mod h1:UYQ4NJPVFqDMWNgi5XW52TqPQ0mAq7UEhSmf2uLA8bM= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 h1:/K6hmGkYfJKaGwH7uNHN8M1SP7crWxjS9cQrD7gx8kA= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88/go.mod h1:AcS5EDcNHhoJbsJlxtOKesRJ79XUnE9kqnUJMnOJITY= -github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186 h1:sCjs5Rivkuy/r2rgvjIqtj4VNr7x03DC+RFWPGbcTA0= -github.com/go-vela/pkg-runtime v0.7.5-0.20210420185916-57eb15a12186/go.mod h1:gfF1R51abdO4noNrlfFPgrEkct+bTpftJRtw/M1hEzs= +github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 h1:MijNDyaFrM5iygRc0wcdJt2IL6Krth2/GTT8ZBbZopg= +github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10/go.mod h1:gfF1R51abdO4noNrlfFPgrEkct+bTpftJRtw/M1hEzs= github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= github.com/go-vela/sdk-go v0.7.4/go.mod h1:I1K3LpWOnfsJUhHXJf7DpwR9zVz4h65hRXzQ5IOxPuo= github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff h1:1LT69ic6xXBKSi+FngkSCJTqqv3xCWTYzdlLKg9xRzk= From 16f751983beda7f22662161991351d1274e76818 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 23:25:09 -0500 Subject: [PATCH 173/430] chore(deps): update postgres docker tag to v13 (#187) Co-authored-by: Renovate Bot --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 60df77f8..84b71d29 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -121,7 +121,7 @@ services: # https://www.postgresql.org/ postgres: container_name: postgres - image: postgres:12-alpine + image: postgres:13-alpine networks: - vela environment: From 38e00562247717cebb978a9d94f1bf335e4d7afb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 07:39:20 -0500 Subject: [PATCH 174/430] chore(deps): update redis docker tag to v6 (#188) Co-authored-by: Renovate Bot --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 84b71d29..c3719049 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -108,7 +108,7 @@ services: # https://redis.io/ redis: container_name: redis - image: redis:5-alpine + image: redis:6-alpine networks: - vela ports: From 3c40c0e320eaf59bcdeefced9f31fe67fa02ac36 Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Thu, 20 May 2021 09:34:07 -0500 Subject: [PATCH 175/430] docs: update local dev docs (#189) --- DOCS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCS.md b/DOCS.md index 7edf5824..d95ce3b4 100644 --- a/DOCS.md +++ b/DOCS.md @@ -38,7 +38,7 @@ cd $HOME/go-vela/worker ```bash # add Github Enterprise Web URL to local `.env` file for `docker-compose` -echo "VELA_SOURCE_URL=" >> .env +echo "VELA_SOURCE_ADDR=" >> .env ``` * Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: From bad3e58c38f244f3c44ab03633f6e4cc79baed7d Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 21 May 2021 10:56:43 -0500 Subject: [PATCH 176/430] chore: update dependencies for types pr 175 (#190) * chore: update dependencies for types pr 175 * chore: update dependencies for types pr 175 --- go.mod | 4 ++-- go.sum | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 86f06e6a..89dc5ff9 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.1 - github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01 + github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36 github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 github.com/go-vela/sdk-go v0.7.4 - github.com/go-vela/types v0.7.4 + github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index f42f27dd..a1448556 100644 --- a/go.sum +++ b/go.sum @@ -90,6 +90,8 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.2/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -232,8 +234,8 @@ github.com/go-vela/compiler v0.7.4/go.mod h1:1l4DWOSHJMHVcmgq6P6PEDTQicI6KMtSn7G github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1 h1:99+SdZ72L5vTDdB4MJShE0oa5W5rUeYens/W0vhOosM= github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1/go.mod h1:mjLSUHXoCVEjlfAhMhqjQuwOr7ZLNGuOxOXvjK+79jE= -github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01 h1:8SHkOYqGff0Gvf1gX6EbBYmN4HzU+valzOkoJwWvJh8= -github.com/go-vela/pkg-executor v0.7.5-0.20210428160348-6ebccf544f01/go.mod h1:UYQ4NJPVFqDMWNgi5XW52TqPQ0mAq7UEhSmf2uLA8bM= +github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36 h1:PRsZx/utUZKURUWhSqtw1lF/5jADxC8kNORjifq/gqU= +github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36/go.mod h1:GA88in6i9qfddO+Roc3WjH1yud+T34zAyz5NNNIEwx0= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 h1:/K6hmGkYfJKaGwH7uNHN8M1SP7crWxjS9cQrD7gx8kA= github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88/go.mod h1:AcS5EDcNHhoJbsJlxtOKesRJ79XUnE9kqnUJMnOJITY= github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 h1:MijNDyaFrM5iygRc0wcdJt2IL6Krth2/GTT8ZBbZopg= @@ -244,6 +246,8 @@ github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff h1:1LT69ic6xXBKSi github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff/go.mod h1:QCB02xu5y2OMSZMNOZAjyoT3j5O6zTlDSdR/lF4ajYI= github.com/go-vela/types v0.7.4 h1:iVz1kDS/uvkOoridyyt0bTZ5tG2j3QYx25rbyFdu35M= github.com/go-vela/types v0.7.4/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= +github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad h1:SAEQdnOTQegVClpCixxe6Qnt8EKntA0cNbTI7s9VF1k= +github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -335,6 +339,8 @@ github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyyc github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= @@ -445,6 +451,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -470,6 +478,8 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJK github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/microcosm-cc/bluemonday v1.0.9 h1:dpCwruVKoyrULicJwhuY76jB+nIxRVKv/e248Vx/BXg= +github.com/microcosm-cc/bluemonday v1.0.9/go.mod h1:B2riunDr9benLHghZB7hjIgdwSUzzs0pjCxFrWYEZFU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -780,6 +790,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -860,6 +872,8 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe h1:WdX7u8s3yOigWAhHEaDl8r9G+4XwFQEQFtBMYyN+kXQ= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -873,6 +887,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 1977380d737e35fd319fd26b09ea958c91510ea5 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 24 May 2021 11:10:30 -0500 Subject: [PATCH 177/430] chore: upgrade go-vela deps on v0.8.0-rc1 (#192) --- go.mod | 12 ++-- go.sum | 218 ++++++++++++--------------------------------------------- 2 files changed, 50 insertions(+), 180 deletions(-) diff --git a/go.mod b/go.mod index 89dc5ff9..2cee71ad 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,12 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/gin-gonic/gin v1.7.1 - github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36 - github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 - github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 - github.com/go-vela/sdk-go v0.7.4 - github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad + github.com/gin-gonic/gin v1.7.2 + github.com/go-vela/pkg-executor v0.8.0-rc1 + github.com/go-vela/pkg-queue v0.8.0-rc1 + github.com/go-vela/pkg-runtime v0.8.0-rc1 + github.com/go-vela/sdk-go v0.8.0-rc1 + github.com/go-vela/types v0.8.0-rc1 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index a1448556..c0fa70d6 100644 --- a/go.sum +++ b/go.sum @@ -56,11 +56,8 @@ github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFP github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -76,9 +73,8 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.14.3 h1:QWoo2wchYmLgOB6ctlTt2dewQ1Vu6phl+iQbwT8SYGo= -github.com/alicebob/miniredis/v2 v2.14.3/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= -github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/alicebob/miniredis/v2 v2.14.4 h1:n0tBOMFgADoJNnCWqJ1J13c7peMbWN8up3ozQ/wMrd0= +github.com/alicebob/miniredis/v2 v2.14.4/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -88,9 +84,7 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.38.2/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -126,27 +120,21 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= -github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA= -github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.6+incompatible h1:oXI3Vas8TI8Eu/EjH4srKHJBVqraSzJybhxY7Om9faQ= github.com/docker/docker v20.10.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= @@ -155,7 +143,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= @@ -163,52 +150,40 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.7.1 h1:qC89GU3p8TvKWMAVhEpmpB2CIb1hnqt2UdKZaP93mS8= -github.com/gin-gonic/gin v1.7.1/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.2 h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA= +github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= @@ -217,47 +192,33 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-redis/redis/v8 v8.8.0 h1:fDZP58UN/1RD3DjtTXP/fFZ04TFohSYhjZDkcDe2dnw= -github.com/go-redis/redis/v8 v8.8.0/go.mod h1:F7resOH5Kdug49Otu24RjHWwgK7u9AmtqWMnCV1iP5Y= +github.com/go-redis/redis/v8 v8.8.3 h1:BefJyU89cTF25I00D5N9pJdWB1d1RBj8d7MBf71M7uQ= +github.com/go-redis/redis/v8 v8.8.3/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/compiler v0.7.4 h1:dJG5Qmq3eQrT+5TzrOhdWKCG9RjIXI0uKakGDAtwOcU= -github.com/go-vela/compiler v0.7.4/go.mod h1:1l4DWOSHJMHVcmgq6P6PEDTQicI6KMtSn7GI8LmoJ+M= -github.com/go-vela/mock v0.7.4/go.mod h1:MZBxR/A9ChWsHI/+b3NQPYF85VJqh6iYU47Wpoujjrk= -github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1 h1:99+SdZ72L5vTDdB4MJShE0oa5W5rUeYens/W0vhOosM= -github.com/go-vela/mock v0.7.5-0.20210416160452-fa8721fcc6a1/go.mod h1:mjLSUHXoCVEjlfAhMhqjQuwOr7ZLNGuOxOXvjK+79jE= -github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36 h1:PRsZx/utUZKURUWhSqtw1lF/5jADxC8kNORjifq/gqU= -github.com/go-vela/pkg-executor v0.7.5-0.20210521154632-d53be352df36/go.mod h1:GA88in6i9qfddO+Roc3WjH1yud+T34zAyz5NNNIEwx0= -github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88 h1:/K6hmGkYfJKaGwH7uNHN8M1SP7crWxjS9cQrD7gx8kA= -github.com/go-vela/pkg-queue v0.7.5-0.20210402170103-bcd9ababfe88/go.mod h1:AcS5EDcNHhoJbsJlxtOKesRJ79XUnE9kqnUJMnOJITY= -github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10 h1:MijNDyaFrM5iygRc0wcdJt2IL6Krth2/GTT8ZBbZopg= -github.com/go-vela/pkg-runtime v0.7.5-0.20210428154035-f007d6e59a10/go.mod h1:gfF1R51abdO4noNrlfFPgrEkct+bTpftJRtw/M1hEzs= -github.com/go-vela/sdk-go v0.7.4 h1:OXUR8LZzO8kBmNY3yRuFojcmjWaMoK1s2q5iIpu5vhg= -github.com/go-vela/sdk-go v0.7.4/go.mod h1:I1K3LpWOnfsJUhHXJf7DpwR9zVz4h65hRXzQ5IOxPuo= -github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff h1:1LT69ic6xXBKSi+FngkSCJTqqv3xCWTYzdlLKg9xRzk= -github.com/go-vela/server v0.7.5-0.20210323124812-0da2c57a87ff/go.mod h1:QCB02xu5y2OMSZMNOZAjyoT3j5O6zTlDSdR/lF4ajYI= -github.com/go-vela/types v0.7.4 h1:iVz1kDS/uvkOoridyyt0bTZ5tG2j3QYx25rbyFdu35M= -github.com/go-vela/types v0.7.4/go.mod h1:/IsyxCijlz8BArRxBfrfRv7BBe/hmJGtVWegkS3ooJU= -github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad h1:SAEQdnOTQegVClpCixxe6Qnt8EKntA0cNbTI7s9VF1k= -github.com/go-vela/types v0.7.5-0.20210520185150-62027576a4ad/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= +github.com/go-vela/compiler v0.8.0-rc1 h1:JWg50c2/6/90KLIMEhTHCaopXrpS9T2LswAnnjifTbQ= +github.com/go-vela/compiler v0.8.0-rc1/go.mod h1:HjHWX/XXgMse6XxateVeorUjuViUfcmgUnJJeOL3u4s= +github.com/go-vela/mock v0.8.0-rc1 h1:nQHK4rBKYx9h8dKbxrpzr0ysgI83/A24CYgUflXEYwU= +github.com/go-vela/mock v0.8.0-rc1/go.mod h1:bHEfteKaPwudK9MpzB0qFYuUiYh0l+G7bfgHEW7XAwg= +github.com/go-vela/pkg-executor v0.8.0-rc1 h1:1//ba9cOBzcBf6E5mI84jnatJKv52AVUTCfYctcpGQc= +github.com/go-vela/pkg-executor v0.8.0-rc1/go.mod h1:pN4r03xk/TeXv+e82yMrif4HirEQnLMuvsCdw0Wc3G8= +github.com/go-vela/pkg-queue v0.8.0-rc1 h1:4AvITL4EJzMfDWf+TX/7Pp2AwPZrLBNBcPl50252x9I= +github.com/go-vela/pkg-queue v0.8.0-rc1/go.mod h1:7cIZ0qEyZvfe0GinRYR9XFcXnZv1E72Ybdgx3CSGReo= +github.com/go-vela/pkg-runtime v0.8.0-rc1 h1:IReNHOPxI/MPnoB//JzX1MpaqMo0NxswQgOq4Us2Nfk= +github.com/go-vela/pkg-runtime v0.8.0-rc1/go.mod h1:S9Ec1ElBNuRPMaKKEi4LgcjfZnZF1QWkDKHC/ZcQrB0= +github.com/go-vela/sdk-go v0.8.0-rc1 h1:UhnRLjASW8hGkhfP3eNBQxp5padKNl9K4l8pYG8f4B8= +github.com/go-vela/sdk-go v0.8.0-rc1/go.mod h1:HgzLI4mo8j7fJnMkB50FB1Av8hyWsIH8dsmXqBCriuY= +github.com/go-vela/types v0.8.0-rc1 h1:jRlrjCKxYuTvqE4StER9Y3sAMqaU5yJoPcl0zM3bLL8= +github.com/go-vela/types v0.8.0-rc1/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -270,7 +231,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 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/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -287,7 +247,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -304,14 +263,11 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4= -github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M= -github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-github/v35 v35.2.0 h1:s/soW8jauhjUC3rh8JI0FePuocj0DEI9DNBg/bVplE8= +github.com/google/go-github/v35 v35.2.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -334,12 +290,10 @@ github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.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/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -356,45 +310,30 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs= -github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= +github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= @@ -406,21 +345,11 @@ github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= -github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -448,16 +377,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= @@ -473,27 +396,19 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= -github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.9 h1:dpCwruVKoyrULicJwhuY76jB+nIxRVKv/e248Vx/BXg= github.com/microcosm-cc/bluemonday v1.0.9/go.mod h1:B2riunDr9benLHghZB7hjIgdwSUzzs0pjCxFrWYEZFU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -503,7 +418,6 @@ github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXy github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -530,7 +444,6 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -559,19 +472,16 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -608,8 +518,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR 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/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -620,7 +528,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= 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= @@ -642,7 +549,6 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -680,16 +586,16 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng= -go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= -go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg= -go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= -go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q= -go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= -go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= -go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= -go.starlark.net v0.0.0-20201014215153-dff0ae5b4820 h1:GsJfRMJ3pXl+Pa5CkSQKIA1hNIo1u0M7I2+ff3RCCME= -go.starlark.net v0.0.0-20201014215153-dff0ae5b4820/go.mod h1:f0znQkUKRrkk36XxWbGjMqQM8wGv/xHBVE2qc3B5oFU= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.starlark.net v0.0.0-20210511153848-cca21e7857d4 h1:Jv3qnj+QmBjvAeyPwsTAm26oKmU/Z9F6EZIMDNznH6Q= +go.starlark.net v0.0.0-20210511153848-cca21e7857d4/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -697,21 +603,17 @@ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/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= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -745,8 +647,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -768,7 +668,6 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -784,11 +683,8 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= @@ -797,9 +693,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84 h1:duBc5zuJsmJXYOVVE/6PxejI+N3AaCqKjtsoLn1Je5Q= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -812,9 +707,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 h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -822,12 +715,10 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/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-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -870,7 +761,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe h1:WdX7u8s3yOigWAhHEaDl8r9G+4XwFQEQFtBMYyN+kXQ= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -878,14 +768,11 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -899,7 +786,6 @@ golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -981,7 +867,6 @@ google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuh google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1013,14 +898,12 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -1046,7 +929,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1059,12 +941,10 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1079,8 +959,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -1092,22 +970,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y= -k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= -k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= -k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA= -k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag= -k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/api v0.21.1 h1:94bbZ5NTjdINJEdzOkpS4vdPhkb1VFpTYC9zh43f75c= +k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= +k8s.io/apimachinery v0.21.1 h1:Q6XuHGlj2xc+hlMCvqyYfbv3H7SRGn2c8NycxJquDVs= +k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= +k8s.io/client-go v0.21.1 h1:bhblWYLZKUu+pm50plvQF8WpY6TXdRRtcS/K9WauOj4= +k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= @@ -1115,8 +987,6 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From b62311e6c1a1251b420ad7c60ede96a30d15fa3f Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 28 May 2021 14:08:45 -0500 Subject: [PATCH 178/430] chore: upgrade go-vela deps on v0.8.0-rc2 (#193) --- go.mod | 10 +++++----- go.sum | 39 ++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 2cee71ad..9c6945b7 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.2 - github.com/go-vela/pkg-executor v0.8.0-rc1 - github.com/go-vela/pkg-queue v0.8.0-rc1 - github.com/go-vela/pkg-runtime v0.8.0-rc1 - github.com/go-vela/sdk-go v0.8.0-rc1 - github.com/go-vela/types v0.8.0-rc1 + github.com/go-vela/pkg-executor v0.8.0-rc2 + github.com/go-vela/pkg-queue v0.8.0-rc2 + github.com/go-vela/pkg-runtime v0.8.0-rc2 + github.com/go-vela/sdk-go v0.8.0-rc2 + github.com/go-vela/types v0.8.0-rc2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index c0fa70d6..ec9f1778 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.14.4 h1:n0tBOMFgADoJNnCWqJ1J13c7peMbWN8up3ozQ/wMrd0= -github.com/alicebob/miniredis/v2 v2.14.4/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.14.5 h1:iCFJiSur7871KaFJLAsBEpmc3DJHJ4YuB7W1hYLWs+U= +github.com/alicebob/miniredis/v2 v2.14.5/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -194,24 +194,24 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.8.3 h1:BefJyU89cTF25I00D5N9pJdWB1d1RBj8d7MBf71M7uQ= -github.com/go-redis/redis/v8 v8.8.3/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= +github.com/go-redis/redis/v8 v8.9.0 h1:FTTbB7WqlXfVNdVv0SsxA+oVi0bAwit6bMe3IUucq2o= +github.com/go-redis/redis/v8 v8.9.0/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.8.0-rc1 h1:JWg50c2/6/90KLIMEhTHCaopXrpS9T2LswAnnjifTbQ= -github.com/go-vela/compiler v0.8.0-rc1/go.mod h1:HjHWX/XXgMse6XxateVeorUjuViUfcmgUnJJeOL3u4s= -github.com/go-vela/mock v0.8.0-rc1 h1:nQHK4rBKYx9h8dKbxrpzr0ysgI83/A24CYgUflXEYwU= -github.com/go-vela/mock v0.8.0-rc1/go.mod h1:bHEfteKaPwudK9MpzB0qFYuUiYh0l+G7bfgHEW7XAwg= -github.com/go-vela/pkg-executor v0.8.0-rc1 h1:1//ba9cOBzcBf6E5mI84jnatJKv52AVUTCfYctcpGQc= -github.com/go-vela/pkg-executor v0.8.0-rc1/go.mod h1:pN4r03xk/TeXv+e82yMrif4HirEQnLMuvsCdw0Wc3G8= -github.com/go-vela/pkg-queue v0.8.0-rc1 h1:4AvITL4EJzMfDWf+TX/7Pp2AwPZrLBNBcPl50252x9I= -github.com/go-vela/pkg-queue v0.8.0-rc1/go.mod h1:7cIZ0qEyZvfe0GinRYR9XFcXnZv1E72Ybdgx3CSGReo= -github.com/go-vela/pkg-runtime v0.8.0-rc1 h1:IReNHOPxI/MPnoB//JzX1MpaqMo0NxswQgOq4Us2Nfk= -github.com/go-vela/pkg-runtime v0.8.0-rc1/go.mod h1:S9Ec1ElBNuRPMaKKEi4LgcjfZnZF1QWkDKHC/ZcQrB0= -github.com/go-vela/sdk-go v0.8.0-rc1 h1:UhnRLjASW8hGkhfP3eNBQxp5padKNl9K4l8pYG8f4B8= -github.com/go-vela/sdk-go v0.8.0-rc1/go.mod h1:HgzLI4mo8j7fJnMkB50FB1Av8hyWsIH8dsmXqBCriuY= -github.com/go-vela/types v0.8.0-rc1 h1:jRlrjCKxYuTvqE4StER9Y3sAMqaU5yJoPcl0zM3bLL8= -github.com/go-vela/types v0.8.0-rc1/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= +github.com/go-vela/compiler v0.8.0-rc2 h1:8Y2V9Zfsmhzor9EY7/YD550v1IfmiMvypbBevBQYOI4= +github.com/go-vela/compiler v0.8.0-rc2/go.mod h1:DclWFwoHXRvrDz04nu4jYhG0ERX4dihHU+lo1ZAV3es= +github.com/go-vela/mock v0.8.0-rc2 h1:vvYEa2m1NQ9Gsf16PBPEI58w14HRZOdCem6SWQLSRTo= +github.com/go-vela/mock v0.8.0-rc2/go.mod h1:XVIjXAx6ArvS+HQ2QYCzYgP+YG7w0wZ/MrORCWOM/7k= +github.com/go-vela/pkg-executor v0.8.0-rc2 h1:S1E5MxIkRLv9ORsLe5QVRS7dS4C2nlvvdUjBF/p3I2o= +github.com/go-vela/pkg-executor v0.8.0-rc2/go.mod h1:63ztJzzBD/kFTyWSoOT3HMzVImQKyZCwdGh608YZhwA= +github.com/go-vela/pkg-queue v0.8.0-rc2 h1:xRX4VGBvMEMlu/TEXPgz85PjWLGwasumHSZY1xv03EM= +github.com/go-vela/pkg-queue v0.8.0-rc2/go.mod h1:iyohp8o0yc5S1lEdvwaNNsSGFMa49ZBNR3w7QoDqLlE= +github.com/go-vela/pkg-runtime v0.8.0-rc2 h1:Xw4nRQKBQxZ1siclSN087rQkIP/fzLP5lsjH+Zt5j0o= +github.com/go-vela/pkg-runtime v0.8.0-rc2/go.mod h1:UooCopqIk69aOgB7+2J+d/Vz7LZ4NpO2kHkunqupfUI= +github.com/go-vela/sdk-go v0.8.0-rc2 h1:iLPj3IsifZ5azMrQNjw2IrUsZNmSNIugqvRNQSt3Npg= +github.com/go-vela/sdk-go v0.8.0-rc2/go.mod h1:jzrtZKPKaFoY6Bwcve9t1WUN2rPaRJYt+is3CCGjxo0= +github.com/go-vela/types v0.8.0-rc2 h1:O9YYfdCCuHxPZ9aaXwcp/LNDLnAaHMMqfLkj4LaR69U= +github.com/go-vela/types v0.8.0-rc2/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -261,8 +261,9 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v35 v35.2.0 h1:s/soW8jauhjUC3rh8JI0FePuocj0DEI9DNBg/bVplE8= github.com/google/go-github/v35 v35.2.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= From c57a69c4e7b920d3334895b29deb901edfd4448b Mon Sep 17 00:00:00 2001 From: Emmanuel Meinen Date: Thu, 3 Jun 2021 11:15:23 -0500 Subject: [PATCH 179/430] chore: bump deps to v0.8.0 (#194) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 9c6945b7..19db7870 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.2 - github.com/go-vela/pkg-executor v0.8.0-rc2 - github.com/go-vela/pkg-queue v0.8.0-rc2 - github.com/go-vela/pkg-runtime v0.8.0-rc2 - github.com/go-vela/sdk-go v0.8.0-rc2 - github.com/go-vela/types v0.8.0-rc2 + github.com/go-vela/pkg-executor v0.8.0 + github.com/go-vela/pkg-queue v0.8.0 + github.com/go-vela/pkg-runtime v0.8.0 + github.com/go-vela/sdk-go v0.8.0 + github.com/go-vela/types v0.8.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index ec9f1778..794bc84b 100644 --- a/go.sum +++ b/go.sum @@ -198,20 +198,20 @@ github.com/go-redis/redis/v8 v8.9.0 h1:FTTbB7WqlXfVNdVv0SsxA+oVi0bAwit6bMe3IUucq github.com/go-redis/redis/v8 v8.9.0/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.8.0-rc2 h1:8Y2V9Zfsmhzor9EY7/YD550v1IfmiMvypbBevBQYOI4= -github.com/go-vela/compiler v0.8.0-rc2/go.mod h1:DclWFwoHXRvrDz04nu4jYhG0ERX4dihHU+lo1ZAV3es= -github.com/go-vela/mock v0.8.0-rc2 h1:vvYEa2m1NQ9Gsf16PBPEI58w14HRZOdCem6SWQLSRTo= -github.com/go-vela/mock v0.8.0-rc2/go.mod h1:XVIjXAx6ArvS+HQ2QYCzYgP+YG7w0wZ/MrORCWOM/7k= -github.com/go-vela/pkg-executor v0.8.0-rc2 h1:S1E5MxIkRLv9ORsLe5QVRS7dS4C2nlvvdUjBF/p3I2o= -github.com/go-vela/pkg-executor v0.8.0-rc2/go.mod h1:63ztJzzBD/kFTyWSoOT3HMzVImQKyZCwdGh608YZhwA= -github.com/go-vela/pkg-queue v0.8.0-rc2 h1:xRX4VGBvMEMlu/TEXPgz85PjWLGwasumHSZY1xv03EM= -github.com/go-vela/pkg-queue v0.8.0-rc2/go.mod h1:iyohp8o0yc5S1lEdvwaNNsSGFMa49ZBNR3w7QoDqLlE= -github.com/go-vela/pkg-runtime v0.8.0-rc2 h1:Xw4nRQKBQxZ1siclSN087rQkIP/fzLP5lsjH+Zt5j0o= -github.com/go-vela/pkg-runtime v0.8.0-rc2/go.mod h1:UooCopqIk69aOgB7+2J+d/Vz7LZ4NpO2kHkunqupfUI= -github.com/go-vela/sdk-go v0.8.0-rc2 h1:iLPj3IsifZ5azMrQNjw2IrUsZNmSNIugqvRNQSt3Npg= -github.com/go-vela/sdk-go v0.8.0-rc2/go.mod h1:jzrtZKPKaFoY6Bwcve9t1WUN2rPaRJYt+is3CCGjxo0= -github.com/go-vela/types v0.8.0-rc2 h1:O9YYfdCCuHxPZ9aaXwcp/LNDLnAaHMMqfLkj4LaR69U= -github.com/go-vela/types v0.8.0-rc2/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= +github.com/go-vela/compiler v0.8.0 h1:J4Yiym/psGxuFbxv7KhUfNdLc7D/UGZVyq3YhlLjKpY= +github.com/go-vela/compiler v0.8.0/go.mod h1:YibFkvNUDhjQ+p14eXY6BCTQn21LV7ffnRqIBUo0CCo= +github.com/go-vela/mock v0.8.0 h1:0LWJOS697rPqgEmi8UNDuAN2M6T1Zb2xWFPc2D+T01U= +github.com/go-vela/mock v0.8.0/go.mod h1:mom8WVv8pxmUdYLO/E7lG0rP7otvEAz3I1FauTRf1iw= +github.com/go-vela/pkg-executor v0.8.0 h1:L8zjy6W6ysmwa+kUbqGOE5hFTlspY+TduMR+PwUb84A= +github.com/go-vela/pkg-executor v0.8.0/go.mod h1:UpRjI+GOsk5WCOdS9IhlJHiVUswZ6/fZhKUTXaA4WOA= +github.com/go-vela/pkg-queue v0.8.0 h1:fZl4ELxsbdHgg/UnSJyUaxVKLTQ7Zk+Qdzvr+9iP/pQ= +github.com/go-vela/pkg-queue v0.8.0/go.mod h1:b3bxzfNAEtuVQrQ1jwPQQdEe8hK1ZQvO/Hiso4PDtUo= +github.com/go-vela/pkg-runtime v0.8.0 h1:do+B94cWbPZV/eov7//OZg3iKSzg7whZ+ug8pKIAFfg= +github.com/go-vela/pkg-runtime v0.8.0/go.mod h1:VBQlNAgav29o+5VWF70eyMyi1NwCN3KKXcVVrDngk3w= +github.com/go-vela/sdk-go v0.8.0 h1:n8EaXg0kVfvDpgfNv5h/KhTt/EUQPc+YPLlyDMYMlNw= +github.com/go-vela/sdk-go v0.8.0/go.mod h1:D9/10o816pR2isM3tb0sJCdkhZgXdmAn7SKNpdD4i2Q= +github.com/go-vela/types v0.8.0 h1:u/mlMU3/GIiXclRuD/PRHuh6wTf2ZhA5O9i9TEUZOS4= +github.com/go-vela/types v0.8.0/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From eeba3342c5a5d990987a6ba1cbd5d8e1cb54057d Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 7 Jun 2021 11:21:16 -0500 Subject: [PATCH 180/430] fix(compose): database config for server (#196) --- docker-compose.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c3719049..1d3e8aa0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,10 @@ services: networks: - vela environment: + DATABASE_DRIVER: postgres + DATABASE_ADDR: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' + DATABASE_COMPRESSION_LEVEL: 3 + DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' QUEUE_ROUTES: 'docker,local,docker:local' @@ -63,9 +67,6 @@ services: SECRET_VAULT_TOKEN: vela VELA_ADDR: 'http://localhost:8080' VELA_WEBUI_ADDR: 'http://localhost:8888' - VELA_DATABASE_DRIVER: postgres - VELA_DATABASE_CONFIG: 'postgres://vela:zB7mrKDTZqNeNTD8z47yG4DHywspAh@postgres:5432/vela?sslmode=disable' - VELA_DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' VELA_LOG_LEVEL: trace VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' VELA_REFRESH_TOKEN_DURATION: 5m From d696d209112b31b8df8ed5f5dd79f7dc80d68f11 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 11:57:12 -0500 Subject: [PATCH 181/430] fix(deps): update module github.com/prometheus/client_golang to v1.11.0 (#195) Co-authored-by: Renovate Bot Co-authored-by: Kelly Merrick --- go.mod | 2 +- go.sum | 210 +++------------------------------------------------------ 2 files changed, 12 insertions(+), 200 deletions(-) diff --git a/go.mod b/go.mod index 19db7870..bd1b1cb2 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-vela/sdk-go v0.8.0 github.com/go-vela/types v0.8.0 github.com/joho/godotenv v1.3.0 - github.com/prometheus/client_golang v1.10.0 + github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c diff --git a/go.sum b/go.sum index 794bc84b..7b1c0a45 100644 --- a/go.sum +++ b/go.sum @@ -46,7 +46,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= @@ -60,10 +59,6 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -75,48 +70,29 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.14.5 h1:iCFJiSur7871KaFJLAsBEpmc3DJHJ4YuB7W1hYLWs+U= github.com/alicebob/miniredis/v2 v2.14.5/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -138,14 +114,8 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -156,8 +126,6 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -172,7 +140,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -196,7 +164,6 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis/v8 v8.9.0 h1:FTTbB7WqlXfVNdVv0SsxA+oVi0bAwit6bMe3IUucq2o= github.com/go-redis/redis/v8 v8.9.0/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/compiler v0.8.0 h1:J4Yiym/psGxuFbxv7KhUfNdLc7D/UGZVyq3YhlLjKpY= github.com/go-vela/compiler v0.8.0/go.mod h1:YibFkvNUDhjQ+p14eXY6BCTQn21LV7ffnRqIBUo0CCo= @@ -212,15 +179,11 @@ github.com/go-vela/sdk-go v0.8.0 h1:n8EaXg0kVfvDpgfNv5h/KhTt/EUQPc+YPLlyDMYMlNw= github.com/go-vela/sdk-go v0.8.0/go.mod h1:D9/10o816pR2isM3tb0sJCdkhZgXdmAn7SKNpdD4i2Q= github.com/go-vela/types v0.8.0 h1:u/mlMU3/GIiXclRuD/PRHuh6wTf2ZhA5O9i9TEUZOS4= github.com/go-vela/types v0.8.0/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -246,7 +209,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -283,7 +245,6 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.4/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -293,76 +254,43 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -379,36 +307,22 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.9/go.mod h1:B2riunDr9benLHghZB7hjIgdwSUzzs0pjCxFrWYEZFU= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= @@ -428,99 +342,57 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg= -github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= -github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 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/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -531,22 +403,13 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 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.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -557,19 +420,14 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 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/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 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= @@ -578,10 +436,6 @@ github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBU github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 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= @@ -597,20 +451,11 @@ go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52l go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.starlark.net v0.0.0-20210511153848-cca21e7857d4 h1:Jv3qnj+QmBjvAeyPwsTAm26oKmU/Z9F6EZIMDNznH6Q= go.starlark.net v0.0.0-20210511153848-cca21e7857d4/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -651,12 +496,8 @@ golang.org/x/mod v0.3.0/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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -667,7 +508,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -708,14 +548,10 @@ 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 h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -728,7 +564,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -736,7 +571,6 @@ golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -762,9 +596,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe h1:WdX7u8s3yOigWAhHEaDl8r9G+4XwFQEQFtBMYyN+kXQ= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -777,15 +611,12 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -793,7 +624,6 @@ 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= @@ -805,8 +635,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -814,7 +642,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -841,7 +668,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -859,7 +685,6 @@ google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -871,7 +696,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -899,15 +723,10 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -927,27 +746,23 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -963,7 +778,6 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -991,7 +805,5 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 5a67c0d41645bbe1010feb45b13daff6fbad5942 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 15:26:40 -0500 Subject: [PATCH 182/430] fix(deps): update deps (patch) (#197) Co-authored-by: Renovate Bot --- go.mod | 10 +++++----- go.sum | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index bd1b1cb2..19f103cb 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.2 - github.com/go-vela/pkg-executor v0.8.0 - github.com/go-vela/pkg-queue v0.8.0 - github.com/go-vela/pkg-runtime v0.8.0 - github.com/go-vela/sdk-go v0.8.0 - github.com/go-vela/types v0.8.0 + github.com/go-vela/pkg-executor v0.8.1 + github.com/go-vela/pkg-queue v0.8.1 + github.com/go-vela/pkg-runtime v0.8.1 + github.com/go-vela/sdk-go v0.8.1 + github.com/go-vela/types v0.8.2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 7b1c0a45..7ac0d0a3 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.6+incompatible h1:oXI3Vas8TI8Eu/EjH4srKHJBVqraSzJybhxY7Om9faQ= -github.com/docker/docker v20.10.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= +github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= @@ -162,23 +162,23 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.9.0 h1:FTTbB7WqlXfVNdVv0SsxA+oVi0bAwit6bMe3IUucq2o= -github.com/go-redis/redis/v8 v8.9.0/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfSQ1DM4O1uU= +github.com/go-redis/redis/v8 v8.10.0 h1:OZwrQKuZqdJ4QIM8wn8rnuz868Li91xA3J2DEq+TPGA= +github.com/go-redis/redis/v8 v8.10.0/go.mod h1:vXLTvigok0VtUX0znvbcEW1SOt4OA9CU1ZfnOtKOaiM= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.8.0 h1:J4Yiym/psGxuFbxv7KhUfNdLc7D/UGZVyq3YhlLjKpY= -github.com/go-vela/compiler v0.8.0/go.mod h1:YibFkvNUDhjQ+p14eXY6BCTQn21LV7ffnRqIBUo0CCo= -github.com/go-vela/mock v0.8.0 h1:0LWJOS697rPqgEmi8UNDuAN2M6T1Zb2xWFPc2D+T01U= -github.com/go-vela/mock v0.8.0/go.mod h1:mom8WVv8pxmUdYLO/E7lG0rP7otvEAz3I1FauTRf1iw= -github.com/go-vela/pkg-executor v0.8.0 h1:L8zjy6W6ysmwa+kUbqGOE5hFTlspY+TduMR+PwUb84A= -github.com/go-vela/pkg-executor v0.8.0/go.mod h1:UpRjI+GOsk5WCOdS9IhlJHiVUswZ6/fZhKUTXaA4WOA= -github.com/go-vela/pkg-queue v0.8.0 h1:fZl4ELxsbdHgg/UnSJyUaxVKLTQ7Zk+Qdzvr+9iP/pQ= -github.com/go-vela/pkg-queue v0.8.0/go.mod h1:b3bxzfNAEtuVQrQ1jwPQQdEe8hK1ZQvO/Hiso4PDtUo= -github.com/go-vela/pkg-runtime v0.8.0 h1:do+B94cWbPZV/eov7//OZg3iKSzg7whZ+ug8pKIAFfg= -github.com/go-vela/pkg-runtime v0.8.0/go.mod h1:VBQlNAgav29o+5VWF70eyMyi1NwCN3KKXcVVrDngk3w= -github.com/go-vela/sdk-go v0.8.0 h1:n8EaXg0kVfvDpgfNv5h/KhTt/EUQPc+YPLlyDMYMlNw= -github.com/go-vela/sdk-go v0.8.0/go.mod h1:D9/10o816pR2isM3tb0sJCdkhZgXdmAn7SKNpdD4i2Q= -github.com/go-vela/types v0.8.0 h1:u/mlMU3/GIiXclRuD/PRHuh6wTf2ZhA5O9i9TEUZOS4= -github.com/go-vela/types v0.8.0/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= +github.com/go-vela/compiler v0.8.1 h1:RLabMScVE8FGDlm7S9e5hLFeedFldkFkj45HDfHWU6s= +github.com/go-vela/compiler v0.8.1/go.mod h1:GjX2zIKqx5zVh9OaCTzzMG99VvphMqWunPRuW0QBNPg= +github.com/go-vela/mock v0.8.1 h1:NNOukyA6MRAPp59cBZlrKCrl8LSm+Ww9Pa96OpEsYCo= +github.com/go-vela/mock v0.8.1/go.mod h1:7WebOs2EzrlNzNrwss1r+tRvy0fUoN73YayMvH9+VQg= +github.com/go-vela/pkg-executor v0.8.1 h1:x2nD+mlBw7IJtNp3UaTaB7d9HRJ99VL6sheEzwChpCQ= +github.com/go-vela/pkg-executor v0.8.1/go.mod h1:s0T+g7nRUD/cVrgr+aAVQ7yPPmNgACBg2d9sG+h1suQ= +github.com/go-vela/pkg-queue v0.8.1 h1:b01vBwqUSBHR/eLjRqO8Qw9HqISrrAcPXlFRWnhp3Vo= +github.com/go-vela/pkg-queue v0.8.1/go.mod h1:HOH7w3toMDEpY20Fy76WzBw5frNczvCStDvGC2slysQ= +github.com/go-vela/pkg-runtime v0.8.1 h1:2xA4soRtpipF/OOJeK18pQQOInTaqyXLOnwgDkWcLLU= +github.com/go-vela/pkg-runtime v0.8.1/go.mod h1:+tNkePpoyWY5CJYEwvkCkI7W93b0BuWKM6gQ9Wz+Pos= +github.com/go-vela/sdk-go v0.8.1 h1:0goUbmVVuTOqU8bdhHkO6ASCAkZqEFdN5/6YRM0Zv6I= +github.com/go-vela/sdk-go v0.8.1/go.mod h1:CTNVI4j/nlupUMG1EOV3bG3vBZeu7dokwWIsNA0pPaE= +github.com/go-vela/types v0.8.2 h1:XM5fgHfbAOmIk5zzppjh4u1KsC3auTibsEoVfUZs5pc= +github.com/go-vela/types v0.8.2/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -226,8 +226,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v35 v35.2.0 h1:s/soW8jauhjUC3rh8JI0FePuocj0DEI9DNBg/bVplE8= -github.com/google/go-github/v35 v35.2.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs= +github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho= +github.com/google/go-github/v35 v35.3.0/go.mod h1:yWB7uCcVWaUbUP74Aq3whuMySRMatyRmq5U9FTNlbio= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -449,8 +449,8 @@ go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiW go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.starlark.net v0.0.0-20210511153848-cca21e7857d4 h1:Jv3qnj+QmBjvAeyPwsTAm26oKmU/Z9F6EZIMDNznH6Q= -go.starlark.net v0.0.0-20210511153848-cca21e7857d4/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a h1:wDtSCWGrX9tusypq2Qq9xzaA3Tf/+4D2KaWO+HQvGZE= +go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -759,8 +759,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From f7e2bd54ba9ee07a69bad76684bb6ab0b49c76a5 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 16 Jun 2021 11:38:54 -0500 Subject: [PATCH 183/430] feat: output version info to stdout (#198) --- cmd/vela-worker/main.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 27851caa..c0ca7878 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -5,6 +5,8 @@ package main import ( + "encoding/json" + "fmt" "os" "time" @@ -34,6 +36,18 @@ func init() { } func main() { + // capture application version information + v := version.New() + + // serialize the version information as pretty JSON + bytes, err := json.MarshalIndent(v, "", " ") + if err != nil { + logrus.Fatal(err) + } + + // output the version information to stdout + fmt.Fprintf(os.Stdout, "%s\n", string(bytes)) + app := cli.NewApp() // Worker Information @@ -53,7 +67,7 @@ func main() { app.Action = run app.Compiled = time.Now() - app.Version = version.New().Semantic() + app.Version = v.Semantic() // Worker Flags @@ -61,7 +75,7 @@ func main() { // Worker Start - err := app.Run(os.Args) + err = app.Run(os.Args) if err != nil { logrus.Fatal(err) } From 16ffd3ecf591a475ef048e422a7e751dc81d5d31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 22:34:31 +0000 Subject: [PATCH 184/430] chore(deps): update codecov/codecov-action action to v2 (#199) Co-authored-by: Renovate Bot --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f914f797..d93b082a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: go test -covermode=atomic -coverprofile=coverage.out ./... - name: coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} file: coverage.out From 28c9ccdc8e3f94f98148e489a9eb8c8452448a0f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 07:18:05 -0500 Subject: [PATCH 185/430] chore(deps): update reviewdog/action-golangci-lint action to v2 (#200) Co-authored-by: Renovate Bot --- .github/workflows/reviewdog.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 7129c0bd..ee38a036 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v2 - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} golangci_lint_flags: "--config=.golangci.yml" @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v2 - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} golangci_lint_flags: "--config=.golangci.yml" From 46eb1f5b5fdf3bea4962cf6c2ee227fd827deef1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 12:57:40 +0000 Subject: [PATCH 186/430] fix(deps): update module github.com/gin-gonic/gin to v1.7.3 (#201) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 19f103cb..716d0514 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/gin-gonic/gin v1.7.2 + github.com/gin-gonic/gin v1.7.3 github.com/go-vela/pkg-executor v0.8.1 github.com/go-vela/pkg-queue v0.8.1 github.com/go-vela/pkg-runtime v0.8.1 diff --git a/go.sum b/go.sum index 7ac0d0a3..a844342d 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.2 h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA= github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= +github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 8d9f0a44933557f030758f8347918d91110376e0 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 6 Aug 2021 15:55:04 -0500 Subject: [PATCH 187/430] chore: update go version to 1.16 (#202) --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 4 ++-- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 2 +- go.mod | 3 ++- go.sum | 10 ++-------- 9 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aaa98822..1cf68a53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index ac2ef3be..9b054c2b 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -12,7 +12,7 @@ jobs: prerelease: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6db5c8fe..ec424de8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: publish: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fdbe949..bc5eba4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: release: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index ee38a036..1c7bc7e1 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -10,7 +10,7 @@ jobs: diff-review: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 @@ -27,7 +27,7 @@ jobs: full-review: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d93b082a..095e572a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 82c0c7ee..d7e6913d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -11,7 +11,7 @@ jobs: validate: runs-on: ubuntu-latest container: - image: golang:1.15 + image: golang:1.16 steps: - name: clone uses: actions/checkout@v2 diff --git a/go.mod b/go.mod index 716d0514..41318e30 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-vela/worker -go 1.15 +go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 @@ -15,4 +15,5 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect ) diff --git a/go.sum b/go.sum index a844342d..5f2a64a3 100644 --- a/go.sum +++ b/go.sum @@ -44,7 +44,6 @@ github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWO github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= 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/FZambia/sentinel v1.0.0 h1:KJ0ryjKTZk5WMp0dXvSdNqp3lFaW1fNFuEYfrkLOYIc= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -94,7 +93,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -123,7 +121,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -211,7 +208,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -266,7 +262,6 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -310,10 +305,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= @@ -598,8 +591,9 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= From 7b949f53607334b0a0cee91ab3d34362e95f11ee Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 6 Aug 2021 15:59:59 -0500 Subject: [PATCH 188/430] chore: upgrade dependencies for v0.9.0-rc2 (#203) --- go.mod | 11 ++--- go.sum | 153 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 83 insertions(+), 81 deletions(-) diff --git a/go.mod b/go.mod index 41318e30..f74764db 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,14 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.3 - github.com/go-vela/pkg-executor v0.8.1 - github.com/go-vela/pkg-queue v0.8.1 - github.com/go-vela/pkg-runtime v0.8.1 - github.com/go-vela/sdk-go v0.8.1 - github.com/go-vela/types v0.8.2 + github.com/go-vela/pkg-executor v0.9.0-rc2 + github.com/go-vela/pkg-queue v0.9.0-rc2 + github.com/go-vela/pkg-runtime v0.9.0-rc2 + github.com/go-vela/sdk-go v0.9.0-rc2 + github.com/go-vela/types v0.9.0-rc2 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect ) diff --git a/go.sum b/go.sum index 5f2a64a3..1dff743b 100644 --- a/go.sum +++ b/go.sum @@ -34,11 +34,11 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= @@ -67,9 +67,10 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.14.5 h1:iCFJiSur7871KaFJLAsBEpmc3DJHJ4YuB7W1hYLWs+U= -github.com/alicebob/miniredis/v2 v2.14.5/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.15.1 h1:Fw+ixAJPmKhCLBqDwHlTDqxUxp0xjEwXczEpt1B6r7k= +github.com/alicebob/miniredis/v2 v2.15.1/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -97,32 +98,33 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ 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= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.8+incompatible h1:RVqD337BgQicVCzYrrlhLDWhq6OAD2PJDUg2LsEUvKM= +github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst v1.0.2 h1:dpYLMAspQHW0a8dZpLRKe9jCNvIGZPhCPrycZzIHdqo= github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= +github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= +github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -145,12 +147,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -160,31 +158,36 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.10.0 h1:OZwrQKuZqdJ4QIM8wn8rnuz868Li91xA3J2DEq+TPGA= -github.com/go-redis/redis/v8 v8.10.0/go.mod h1:vXLTvigok0VtUX0znvbcEW1SOt4OA9CU1ZfnOtKOaiM= +github.com/go-redis/redis/v8 v8.11.2 h1:WqlSpAwz8mxDSMCvbyz1Mkiqe0LE5OY4j3lgkvu1Ts0= +github.com/go-redis/redis/v8 v8.11.2/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.8.1 h1:RLabMScVE8FGDlm7S9e5hLFeedFldkFkj45HDfHWU6s= -github.com/go-vela/compiler v0.8.1/go.mod h1:GjX2zIKqx5zVh9OaCTzzMG99VvphMqWunPRuW0QBNPg= -github.com/go-vela/mock v0.8.1 h1:NNOukyA6MRAPp59cBZlrKCrl8LSm+Ww9Pa96OpEsYCo= +github.com/go-vela/compiler v0.9.0-rc2 h1:p3Ckat6sVUpkztUH5kfD+tDWqqJIE954sRdkC9dDYF0= +github.com/go-vela/compiler v0.9.0-rc2/go.mod h1:jCy7W+X9ZfPPYHO8b3JtqhE9JTg6TWder8Ookb8ZnRc= github.com/go-vela/mock v0.8.1/go.mod h1:7WebOs2EzrlNzNrwss1r+tRvy0fUoN73YayMvH9+VQg= -github.com/go-vela/pkg-executor v0.8.1 h1:x2nD+mlBw7IJtNp3UaTaB7d9HRJ99VL6sheEzwChpCQ= -github.com/go-vela/pkg-executor v0.8.1/go.mod h1:s0T+g7nRUD/cVrgr+aAVQ7yPPmNgACBg2d9sG+h1suQ= -github.com/go-vela/pkg-queue v0.8.1 h1:b01vBwqUSBHR/eLjRqO8Qw9HqISrrAcPXlFRWnhp3Vo= -github.com/go-vela/pkg-queue v0.8.1/go.mod h1:HOH7w3toMDEpY20Fy76WzBw5frNczvCStDvGC2slysQ= -github.com/go-vela/pkg-runtime v0.8.1 h1:2xA4soRtpipF/OOJeK18pQQOInTaqyXLOnwgDkWcLLU= -github.com/go-vela/pkg-runtime v0.8.1/go.mod h1:+tNkePpoyWY5CJYEwvkCkI7W93b0BuWKM6gQ9Wz+Pos= -github.com/go-vela/sdk-go v0.8.1 h1:0goUbmVVuTOqU8bdhHkO6ASCAkZqEFdN5/6YRM0Zv6I= -github.com/go-vela/sdk-go v0.8.1/go.mod h1:CTNVI4j/nlupUMG1EOV3bG3vBZeu7dokwWIsNA0pPaE= -github.com/go-vela/types v0.8.2 h1:XM5fgHfbAOmIk5zzppjh4u1KsC3auTibsEoVfUZs5pc= +github.com/go-vela/mock v0.9.0-rc2 h1:PMAGeakcR+q6iRnm+8777fhQvwnNuor1u7VUzOZCIuQ= +github.com/go-vela/mock v0.9.0-rc2/go.mod h1:LBGfAsy8sKpmmKE6LpSNOG6FaFGBmXfhD6yle0RpNSI= +github.com/go-vela/pkg-executor v0.9.0-rc2 h1:/InYJTUqH2BvL+WplEqEZVilgWXaGyuFjOjwMrSSE2I= +github.com/go-vela/pkg-executor v0.9.0-rc2/go.mod h1:m+a3loNtml75NdSUSxb/zGK85T4EQTDp1g0REgHAHWY= +github.com/go-vela/pkg-queue v0.9.0-rc2 h1:3Yk3eERXzYTqABIFewO5pL9XR3z8oaExoDciVwL0Eq4= +github.com/go-vela/pkg-queue v0.9.0-rc2/go.mod h1:pb9/f32A5R5lSeLBKW30ldL02wa/6cUpNi6FMofEc1k= +github.com/go-vela/pkg-runtime v0.9.0-rc2 h1:9kmZiMw2x1k5hapik7F6osIAvAjOuXXwrAjdJALNqJE= +github.com/go-vela/pkg-runtime v0.9.0-rc2/go.mod h1:CmGPylVrxZ4t/UGPoc5uCDVyUCBGmR71vU/yMbFaWc4= +github.com/go-vela/sdk-go v0.9.0-rc2 h1:r0BFTLaa/vsVR0gpElaOpTHY/iPtVlu4q71eBPtTWpc= +github.com/go-vela/sdk-go v0.9.0-rc2/go.mod h1:5QHRnWdzgAvPJhy4hPey5ueSQbK39KnOLHmE2Of9SNA= github.com/go-vela/types v0.8.2/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= +github.com/go-vela/types v0.9.0-rc2 h1:DRkKJG075OaQ1g0ptRAGy7M03wf/2pP3eP5xV8ltiO4= +github.com/go-vela/types v0.9.0-rc2/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -205,12 +208,15 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -223,8 +229,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho= -github.com/google/go-github/v35 v35.3.0/go.mod h1:yWB7uCcVWaUbUP74Aq3whuMySRMatyRmq5U9FTNlbio= +github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM= +github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -249,8 +255,9 @@ github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.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/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -292,11 +299,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -315,6 +322,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.9/go.mod h1:B2riunDr9benLHghZB7hjIgdwSUzzs0pjCxFrWYEZFU= +github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -342,13 +350,12 @@ github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= @@ -363,6 +370,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -398,15 +406,17 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -435,21 +445,13 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a h1:wDtSCWGrX9tusypq2Qq9xzaA3Tf/+4D2KaWO+HQvGZE= go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -520,16 +522,17 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -555,7 +558,6 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -589,9 +591,10 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -603,15 +606,14 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -623,7 +625,6 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn 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= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -716,8 +717,8 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474 h1:TbNifhX2UFPFG5PL1RUfAajMT29pJ1hq6FME8V8ZdgE= -google.golang.org/genproto v0.0.0-20201013134114-7f9ee70cb474/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 h1:bFFRpT+e8JJVY7lMMfvezL1ZIwqiwmPl2bsE2yx4HqM= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -742,8 +743,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -768,8 +770,9 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -780,25 +783,25 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.1 h1:94bbZ5NTjdINJEdzOkpS4vdPhkb1VFpTYC9zh43f75c= -k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= -k8s.io/apimachinery v0.21.1 h1:Q6XuHGlj2xc+hlMCvqyYfbv3H7SRGn2c8NycxJquDVs= -k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/client-go v0.21.1 h1:bhblWYLZKUu+pm50plvQF8WpY6TXdRRtcS/K9WauOj4= -k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= +k8s.io/api v0.22.0 h1:elCpMZ9UE8dLdYxr55E06TmSeji9I3KH494qH70/y+c= +k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= +k8s.io/apimachinery v0.22.0 h1:CqH/BdNAzZl+sr3tc0D3VsK3u6ARVSo3GWyLmfIjbP0= +k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= +k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 h1:imL9YgXQ9p7xmPzHFm/vVd/cF78jad+n4wK1ABwYtMM= +k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 5997eae13a613f286ee1c1567d6e0c852566372f Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 13 Aug 2021 10:47:22 -0500 Subject: [PATCH 189/430] chore: upgrade dependencies for v0.9.0-rc3 (#204) --- go.mod | 10 +++++----- go.sum | 61 +++++++++++++++++++++++++++------------------------------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index f74764db..091c8672 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.3 - github.com/go-vela/pkg-executor v0.9.0-rc2 - github.com/go-vela/pkg-queue v0.9.0-rc2 - github.com/go-vela/pkg-runtime v0.9.0-rc2 - github.com/go-vela/sdk-go v0.9.0-rc2 - github.com/go-vela/types v0.9.0-rc2 + github.com/go-vela/pkg-executor v0.9.0-rc3 + github.com/go-vela/pkg-queue v0.9.0-rc3 + github.com/go-vela/pkg-runtime v0.9.0-rc3 + github.com/go-vela/sdk-go v0.9.0-rc3 + github.com/go-vela/types v0.9.0-rc3 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 1dff743b..ac8d2d60 100644 --- a/go.sum +++ b/go.sum @@ -102,7 +102,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.8+incompatible h1:RVqD337BgQicVCzYrrlhLDWhq6OAD2PJDUg2LsEUvKM= github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -110,7 +109,6 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -132,7 +130,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -158,25 +155,24 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.11.2 h1:WqlSpAwz8mxDSMCvbyz1Mkiqe0LE5OY4j3lgkvu1Ts0= -github.com/go-redis/redis/v8 v8.11.2/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M= +github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCxgt8= +github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/compiler v0.9.0-rc2 h1:p3Ckat6sVUpkztUH5kfD+tDWqqJIE954sRdkC9dDYF0= -github.com/go-vela/compiler v0.9.0-rc2/go.mod h1:jCy7W+X9ZfPPYHO8b3JtqhE9JTg6TWder8Ookb8ZnRc= -github.com/go-vela/mock v0.8.1/go.mod h1:7WebOs2EzrlNzNrwss1r+tRvy0fUoN73YayMvH9+VQg= -github.com/go-vela/mock v0.9.0-rc2 h1:PMAGeakcR+q6iRnm+8777fhQvwnNuor1u7VUzOZCIuQ= -github.com/go-vela/mock v0.9.0-rc2/go.mod h1:LBGfAsy8sKpmmKE6LpSNOG6FaFGBmXfhD6yle0RpNSI= -github.com/go-vela/pkg-executor v0.9.0-rc2 h1:/InYJTUqH2BvL+WplEqEZVilgWXaGyuFjOjwMrSSE2I= -github.com/go-vela/pkg-executor v0.9.0-rc2/go.mod h1:m+a3loNtml75NdSUSxb/zGK85T4EQTDp1g0REgHAHWY= -github.com/go-vela/pkg-queue v0.9.0-rc2 h1:3Yk3eERXzYTqABIFewO5pL9XR3z8oaExoDciVwL0Eq4= -github.com/go-vela/pkg-queue v0.9.0-rc2/go.mod h1:pb9/f32A5R5lSeLBKW30ldL02wa/6cUpNi6FMofEc1k= -github.com/go-vela/pkg-runtime v0.9.0-rc2 h1:9kmZiMw2x1k5hapik7F6osIAvAjOuXXwrAjdJALNqJE= -github.com/go-vela/pkg-runtime v0.9.0-rc2/go.mod h1:CmGPylVrxZ4t/UGPoc5uCDVyUCBGmR71vU/yMbFaWc4= -github.com/go-vela/sdk-go v0.9.0-rc2 h1:r0BFTLaa/vsVR0gpElaOpTHY/iPtVlu4q71eBPtTWpc= -github.com/go-vela/sdk-go v0.9.0-rc2/go.mod h1:5QHRnWdzgAvPJhy4hPey5ueSQbK39KnOLHmE2Of9SNA= -github.com/go-vela/types v0.8.2/go.mod h1:tKk+FpEAv+BTMr9CL3Wed6tMy5IqyOCJpRTKZI88yDc= -github.com/go-vela/types v0.9.0-rc2 h1:DRkKJG075OaQ1g0ptRAGy7M03wf/2pP3eP5xV8ltiO4= -github.com/go-vela/types v0.9.0-rc2/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-vela/compiler v0.9.0-rc3 h1:dJC6345fJSIotBhIgcPkOvGK7FJMkWkl2dNyJaejZI0= +github.com/go-vela/compiler v0.9.0-rc3/go.mod h1:TNTg6Q1xKMXHnibHQa05zNdi/NtEUnbnWAegVzqlOyU= +github.com/go-vela/mock v0.9.0-rc3 h1:8npixKPD49aAZ8/dbyoqcxxjGtydFyvBQ9u8J97zJ+g= +github.com/go-vela/mock v0.9.0-rc3/go.mod h1:nxhU2OWqtFESLPz4/FbQ1WsIjHUVvhmsrvy0pIDgxSM= +github.com/go-vela/pkg-executor v0.9.0-rc3 h1:NVXDHhXO3xcC3Tny3o7HuUhD4PpQ8ZpAWvrPey2wOUg= +github.com/go-vela/pkg-executor v0.9.0-rc3/go.mod h1:Spq5BrKxLOpVCQ3ujsT7bcPgDAAC/N7qzt8oAzwT7qU= +github.com/go-vela/pkg-queue v0.9.0-rc3 h1:ZwcOOyZx7PTV/GrgD+dC4+Tv4u3lGu2wgUnudS2Wweg= +github.com/go-vela/pkg-queue v0.9.0-rc3/go.mod h1:I5QoY5uNjvFRgPK/7NyxP9IuIw6WAV1lG861pjldndk= +github.com/go-vela/pkg-runtime v0.9.0-rc3 h1:r/uBPmQA3hFkJK/TuogJ8R7XhwnHNM5ShfH7qs3zPzw= +github.com/go-vela/pkg-runtime v0.9.0-rc3/go.mod h1:nKqBfZygalgPmIFSU/57WTnvmHIwZpXH3UQnek7Ve04= +github.com/go-vela/sdk-go v0.9.0-rc3 h1:v9UhpYpSeynxtEogEKgvrLoXGmchf0vWz7fkAE1+Fzc= +github.com/go-vela/sdk-go v0.9.0-rc3/go.mod h1:Od/wwAIhuBHEjtJSDDPezX8IohcAfoV+Itu1MBmaRqY= +github.com/go-vela/types v0.9.0-rc3 h1:ucWTlDvIf1Hd3tUD4dC9plN0RbgPWny84vE/42oYctM= +github.com/go-vela/types v0.9.0-rc3/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -229,8 +225,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM= -github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= +github.com/google/go-github/v38 v38.1.0 h1:C6h1FkaITcBFK7gAmq4eFzt6gbhEhk7L5z6R3Uva+po= +github.com/google/go-github/v38 v38.1.0/go.mod h1:cStvrz/7nFr0FoENgG6GLbp53WaelXucT+BBz/3VKx4= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -321,7 +317,6 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.9/go.mod h1:B2riunDr9benLHghZB7hjIgdwSUzzs0pjCxFrWYEZFU= github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -346,21 +341,22 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= -github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= -github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= +github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -522,7 +518,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -531,8 +527,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -591,7 +587,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 17ec233d6a8325ec9075712d0f284c78b0df426e Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Thu, 26 Aug 2021 10:35:25 -0500 Subject: [PATCH 190/430] chore: upgrade dependencies for v0.9.0 (#207) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 091c8672..7ec9ada4 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.3 - github.com/go-vela/pkg-executor v0.9.0-rc3 - github.com/go-vela/pkg-queue v0.9.0-rc3 - github.com/go-vela/pkg-runtime v0.9.0-rc3 - github.com/go-vela/sdk-go v0.9.0-rc3 - github.com/go-vela/types v0.9.0-rc3 + github.com/go-vela/pkg-executor v0.9.0 + github.com/go-vela/pkg-queue v0.9.0 + github.com/go-vela/pkg-runtime v0.9.0 + github.com/go-vela/sdk-go v0.9.0 + github.com/go-vela/types v0.9.0 github.com/joho/godotenv v1.3.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index ac8d2d60..53b3e11f 100644 --- a/go.sum +++ b/go.sum @@ -159,20 +159,20 @@ github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCx github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.9.0-rc3 h1:dJC6345fJSIotBhIgcPkOvGK7FJMkWkl2dNyJaejZI0= -github.com/go-vela/compiler v0.9.0-rc3/go.mod h1:TNTg6Q1xKMXHnibHQa05zNdi/NtEUnbnWAegVzqlOyU= -github.com/go-vela/mock v0.9.0-rc3 h1:8npixKPD49aAZ8/dbyoqcxxjGtydFyvBQ9u8J97zJ+g= -github.com/go-vela/mock v0.9.0-rc3/go.mod h1:nxhU2OWqtFESLPz4/FbQ1WsIjHUVvhmsrvy0pIDgxSM= -github.com/go-vela/pkg-executor v0.9.0-rc3 h1:NVXDHhXO3xcC3Tny3o7HuUhD4PpQ8ZpAWvrPey2wOUg= -github.com/go-vela/pkg-executor v0.9.0-rc3/go.mod h1:Spq5BrKxLOpVCQ3ujsT7bcPgDAAC/N7qzt8oAzwT7qU= -github.com/go-vela/pkg-queue v0.9.0-rc3 h1:ZwcOOyZx7PTV/GrgD+dC4+Tv4u3lGu2wgUnudS2Wweg= -github.com/go-vela/pkg-queue v0.9.0-rc3/go.mod h1:I5QoY5uNjvFRgPK/7NyxP9IuIw6WAV1lG861pjldndk= -github.com/go-vela/pkg-runtime v0.9.0-rc3 h1:r/uBPmQA3hFkJK/TuogJ8R7XhwnHNM5ShfH7qs3zPzw= -github.com/go-vela/pkg-runtime v0.9.0-rc3/go.mod h1:nKqBfZygalgPmIFSU/57WTnvmHIwZpXH3UQnek7Ve04= -github.com/go-vela/sdk-go v0.9.0-rc3 h1:v9UhpYpSeynxtEogEKgvrLoXGmchf0vWz7fkAE1+Fzc= -github.com/go-vela/sdk-go v0.9.0-rc3/go.mod h1:Od/wwAIhuBHEjtJSDDPezX8IohcAfoV+Itu1MBmaRqY= -github.com/go-vela/types v0.9.0-rc3 h1:ucWTlDvIf1Hd3tUD4dC9plN0RbgPWny84vE/42oYctM= -github.com/go-vela/types v0.9.0-rc3/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= +github.com/go-vela/compiler v0.9.0 h1:JYnBuXgDGyqT68ohLbVMxQiUld/Esr22MncfGdYNLc0= +github.com/go-vela/compiler v0.9.0/go.mod h1:FbYLiz+psgcqpQaeKpVP00YNuvc/tMLrYCdgTkb/lCM= +github.com/go-vela/mock v0.9.0 h1:c1bhTmVQ8xIYFvBi8SBSWc83IkXXUTzi20P3IVjKaJ4= +github.com/go-vela/mock v0.9.0/go.mod h1:PMfa8HcsLCOfr1bVQ2+I6udUCuEnB5BXir4r+uVysXE= +github.com/go-vela/pkg-executor v0.9.0 h1:mcnYPaKLYucdJ8YkK6S7kTRaOLtxr/eZ7zEnsebUB/0= +github.com/go-vela/pkg-executor v0.9.0/go.mod h1:0V5WpKevMbaALG+qgASYKo61KwjbkxVyODODsblgin8= +github.com/go-vela/pkg-queue v0.9.0 h1:Ysn1NSLhkHWsLXZOJB4g73z65zhinoBpEWJDFE+oMEc= +github.com/go-vela/pkg-queue v0.9.0/go.mod h1:S3X9BK7l0+vBY1xMvbiSfNSEWCOuHxkRswRxnUj0u1I= +github.com/go-vela/pkg-runtime v0.9.0 h1:56pTuYqtjc7eYJ/srunRlN6zoOvX75gb2O1soEAHhkk= +github.com/go-vela/pkg-runtime v0.9.0/go.mod h1:Zpw2R5YS31RFgDNoDR5XIiDM99mdKaF3PFJf/spVmPo= +github.com/go-vela/sdk-go v0.9.0 h1:tfn3Jm05aICaAiKzG8cqU2yFZKKDL+ntNqoB65WCrq0= +github.com/go-vela/sdk-go v0.9.0/go.mod h1:YWqJ9+JaALHzCxr8rtBOGE/VUpNnYQlBkVGBuvq4j6E= +github.com/go-vela/types v0.9.0 h1:vAwxYzG8KSDtvpSALOoHzac4wrMM+NFW1QxoXrjXWSc= +github.com/go-vela/types v0.9.0/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From db183ad52d6508bf05cf400f73e9054d5d653033 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Sep 2021 14:44:16 -0500 Subject: [PATCH 191/430] fix(deps): update module github.com/gin-gonic/gin to v1.7.4 (#205) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7ec9ada4..6fbd7ff0 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/gin-gonic/gin v1.7.3 + github.com/gin-gonic/gin v1.7.4 github.com/go-vela/pkg-executor v0.9.0 github.com/go-vela/pkg-queue v0.9.0 github.com/go-vela/pkg-runtime v0.9.0 diff --git a/go.sum b/go.sum index 53b3e11f..2969e993 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= +github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 32b98bc564245914c24ae060671c5bc574fc1cf1 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 3 Sep 2021 15:10:45 -0500 Subject: [PATCH 192/430] docs - remove use at your own risk language (#208) --- .github/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index d9b9b5bc..d58a3b63 100644 --- a/.github/README.md +++ b/.github/README.md @@ -5,7 +5,7 @@ [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) [![codecov](https://codecov.io/gh/go-vela/worker/branch/master/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) -> Vela is in active development and is a pre-release product. Please use at your own risk in production. +> Vela is in active development and is a pre-release product. > > Feel free to send us feedback at https://github.com/go-vela/community/issues/new. From 015621d7ad4b4a615825a40269675ab571934e86 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 13:11:29 -0500 Subject: [PATCH 193/430] fix(deps): update module github.com/joho/godotenv to v1.4.0 (#209) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 6fbd7ff0..d928c847 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/go-vela/pkg-runtime v0.9.0 github.com/go-vela/sdk-go v0.9.0 github.com/go-vela/types v0.9.0 - github.com/joho/godotenv v1.3.0 + github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 diff --git a/go.sum b/go.sum index 2969e993..14c07692 100644 --- a/go.sum +++ b/go.sum @@ -279,8 +279,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= +github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= From 150b8b39b026b968b74c3f454d252025866b640d Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 1 Oct 2021 16:40:51 -0500 Subject: [PATCH 194/430] feat(log streaming): add ability to stream step and service logs (#211) --- go.mod | 4 ++-- go.sum | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index d928c847..61577ef6 100644 --- a/go.mod +++ b/go.mod @@ -5,10 +5,10 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/pkg-executor v0.9.0 + github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea github.com/go-vela/pkg-queue v0.9.0 github.com/go-vela/pkg-runtime v0.9.0 - github.com/go-vela/sdk-go v0.9.0 + github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41 github.com/go-vela/types v0.9.0 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 diff --git a/go.sum b/go.sum index 14c07692..32dd08c3 100644 --- a/go.sum +++ b/go.sum @@ -162,16 +162,18 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-vela/compiler v0.9.0 h1:JYnBuXgDGyqT68ohLbVMxQiUld/Esr22MncfGdYNLc0= github.com/go-vela/compiler v0.9.0/go.mod h1:FbYLiz+psgcqpQaeKpVP00YNuvc/tMLrYCdgTkb/lCM= -github.com/go-vela/mock v0.9.0 h1:c1bhTmVQ8xIYFvBi8SBSWc83IkXXUTzi20P3IVjKaJ4= github.com/go-vela/mock v0.9.0/go.mod h1:PMfa8HcsLCOfr1bVQ2+I6udUCuEnB5BXir4r+uVysXE= -github.com/go-vela/pkg-executor v0.9.0 h1:mcnYPaKLYucdJ8YkK6S7kTRaOLtxr/eZ7zEnsebUB/0= -github.com/go-vela/pkg-executor v0.9.0/go.mod h1:0V5WpKevMbaALG+qgASYKo61KwjbkxVyODODsblgin8= +github.com/go-vela/mock v0.9.1-0.20211001185918-7c31308f19fd h1:Feil57YFLwVcMzsCjDT+V938A5SulJ0/8QGqykLN+MY= +github.com/go-vela/mock v0.9.1-0.20211001185918-7c31308f19fd/go.mod h1:vJAxrKg8WpsMWoC3kN2bPyjHo0ZeRJl3f7//SpPVIQk= +github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea h1:pgaE1n91dgMiNV8DHduYY6vGLwUa7eZrSd+TjXGZAxo= +github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea/go.mod h1:YR4GBqeD+Y2JVs8o5pErXqXSycVfeY7eTDId6BXuCFE= github.com/go-vela/pkg-queue v0.9.0 h1:Ysn1NSLhkHWsLXZOJB4g73z65zhinoBpEWJDFE+oMEc= github.com/go-vela/pkg-queue v0.9.0/go.mod h1:S3X9BK7l0+vBY1xMvbiSfNSEWCOuHxkRswRxnUj0u1I= github.com/go-vela/pkg-runtime v0.9.0 h1:56pTuYqtjc7eYJ/srunRlN6zoOvX75gb2O1soEAHhkk= github.com/go-vela/pkg-runtime v0.9.0/go.mod h1:Zpw2R5YS31RFgDNoDR5XIiDM99mdKaF3PFJf/spVmPo= -github.com/go-vela/sdk-go v0.9.0 h1:tfn3Jm05aICaAiKzG8cqU2yFZKKDL+ntNqoB65WCrq0= github.com/go-vela/sdk-go v0.9.0/go.mod h1:YWqJ9+JaALHzCxr8rtBOGE/VUpNnYQlBkVGBuvq4j6E= +github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41 h1:ZqnuXOzmDtIk5vhS7XWgkpk+Td+aI6pP8fiEpxImVKE= +github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41/go.mod h1:pzj+/rUnCLBW0bSpm9OE+AFT4rBEiAcupFHOi1ptqUM= github.com/go-vela/types v0.9.0 h1:vAwxYzG8KSDtvpSALOoHzac4wrMM+NFW1QxoXrjXWSc= github.com/go-vela/types v0.9.0/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -301,6 +303,7 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -391,6 +394,7 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 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/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= From a1cc7c2adaddeaadb3f3d505135e638cad49ca14 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 7 Oct 2021 19:53:07 +0000 Subject: [PATCH 195/430] chore: release v0.10.0-rc1 (#212) --- go.mod | 10 +++---- go.sum | 86 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/go.mod b/go.mod index 61577ef6..16055de2 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea - github.com/go-vela/pkg-queue v0.9.0 - github.com/go-vela/pkg-runtime v0.9.0 - github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41 - github.com/go-vela/types v0.9.0 + github.com/go-vela/pkg-executor v0.10.0-rc1 + github.com/go-vela/pkg-queue v0.10.0-rc1 + github.com/go-vela/pkg-runtime v0.10.0-rc1 + github.com/go-vela/sdk-go v0.10.0-rc1 + github.com/go-vela/types v0.10.0-rc1 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 32dd08c3..c6599548 100644 --- a/go.sum +++ b/go.sum @@ -79,8 +79,9 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -130,7 +131,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -156,32 +156,30 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCxgt8= -github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= +github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= +github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.9.0 h1:JYnBuXgDGyqT68ohLbVMxQiUld/Esr22MncfGdYNLc0= -github.com/go-vela/compiler v0.9.0/go.mod h1:FbYLiz+psgcqpQaeKpVP00YNuvc/tMLrYCdgTkb/lCM= -github.com/go-vela/mock v0.9.0/go.mod h1:PMfa8HcsLCOfr1bVQ2+I6udUCuEnB5BXir4r+uVysXE= -github.com/go-vela/mock v0.9.1-0.20211001185918-7c31308f19fd h1:Feil57YFLwVcMzsCjDT+V938A5SulJ0/8QGqykLN+MY= -github.com/go-vela/mock v0.9.1-0.20211001185918-7c31308f19fd/go.mod h1:vJAxrKg8WpsMWoC3kN2bPyjHo0ZeRJl3f7//SpPVIQk= -github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea h1:pgaE1n91dgMiNV8DHduYY6vGLwUa7eZrSd+TjXGZAxo= -github.com/go-vela/pkg-executor v0.9.1-0.20211001211248-132383e767ea/go.mod h1:YR4GBqeD+Y2JVs8o5pErXqXSycVfeY7eTDId6BXuCFE= -github.com/go-vela/pkg-queue v0.9.0 h1:Ysn1NSLhkHWsLXZOJB4g73z65zhinoBpEWJDFE+oMEc= -github.com/go-vela/pkg-queue v0.9.0/go.mod h1:S3X9BK7l0+vBY1xMvbiSfNSEWCOuHxkRswRxnUj0u1I= -github.com/go-vela/pkg-runtime v0.9.0 h1:56pTuYqtjc7eYJ/srunRlN6zoOvX75gb2O1soEAHhkk= -github.com/go-vela/pkg-runtime v0.9.0/go.mod h1:Zpw2R5YS31RFgDNoDR5XIiDM99mdKaF3PFJf/spVmPo= -github.com/go-vela/sdk-go v0.9.0/go.mod h1:YWqJ9+JaALHzCxr8rtBOGE/VUpNnYQlBkVGBuvq4j6E= -github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41 h1:ZqnuXOzmDtIk5vhS7XWgkpk+Td+aI6pP8fiEpxImVKE= -github.com/go-vela/sdk-go v0.9.1-0.20211001205048-89431964db41/go.mod h1:pzj+/rUnCLBW0bSpm9OE+AFT4rBEiAcupFHOi1ptqUM= -github.com/go-vela/types v0.9.0 h1:vAwxYzG8KSDtvpSALOoHzac4wrMM+NFW1QxoXrjXWSc= -github.com/go-vela/types v0.9.0/go.mod h1:uiQ8TITRIemGwgnfACIHaTdcTVJaZTo7eO1HZeFgnHc= +github.com/go-vela/compiler v0.10.0-rc1 h1:mBEANEk7GAmu6xx8munxSQJIqnDCRX6wcSCOA6yW3Wk= +github.com/go-vela/compiler v0.10.0-rc1/go.mod h1:gV7bnMwofhBX2GcqzUarQxyTAGbvXwu2dFDuMWw7J1Q= +github.com/go-vela/mock v0.10.0-rc1 h1:qmNQ7+TeIXJtHduR3zVVOpBxyK+kJDGvc75W3PyotbA= +github.com/go-vela/mock v0.10.0-rc1/go.mod h1:/TyCo/+XxWmOC3n7UzhMepd3rofXcjKRQKAUR1LdIwE= +github.com/go-vela/pkg-executor v0.10.0-rc1 h1:g3UZJGF7c2/q9N5o1z5Z+cYot7onPZPI/CVKsVfjjh8= +github.com/go-vela/pkg-executor v0.10.0-rc1/go.mod h1:1sgfiRlz5z9KRQAFy99CG1UE9Gx0GVz2fYoBGY05WSA= +github.com/go-vela/pkg-queue v0.10.0-rc1 h1:9OMqTkh13dfQpU0RWS+/DeDeFUjtYiHZMuuTZuh4W68= +github.com/go-vela/pkg-queue v0.10.0-rc1/go.mod h1:AOBWglHWox9c2894CqPO6oxV36DfxrN7Cy8VGGYlAEc= +github.com/go-vela/pkg-runtime v0.10.0-rc1 h1:UJ3/o+PAIlv3jc3Y4EDF++ZJutQlbshVwJjm4QVEX8c= +github.com/go-vela/pkg-runtime v0.10.0-rc1/go.mod h1:AE4xLXfX5SSQJZimy8jqrnaTtXeKeK+/CYbVPI8vlm8= +github.com/go-vela/sdk-go v0.10.0-rc1 h1:IzCpQhi6ONvexs2Bl5lJpVOogCt/CQ4sJpAIEKX9QbY= +github.com/go-vela/sdk-go v0.10.0-rc1/go.mod h1:iRUqojGeiEYbppXEaD9ydYP8rAmMPmpOeAI0h6Ug5JY= +github.com/go-vela/types v0.10.0-rc1 h1:IivOokpjtMLpCPi3rWZcnHWrmaynxW9cDUDbhUDubqY= +github.com/go-vela/types v0.10.0-rc1/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= +github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -228,9 +226,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v38 v38.1.0 h1:C6h1FkaITcBFK7gAmq4eFzt6gbhEhk7L5z6R3Uva+po= -github.com/google/go-github/v38 v38.1.0/go.mod h1:cStvrz/7nFr0FoENgG6GLbp53WaelXucT+BBz/3VKx4= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-github/v39 v39.1.0 h1:1vf4gM0D1e+Df2HMxaYC3+o9+Huj3ywGTtWc3VVYaDA= +github.com/google/go-github/v39 v39.1.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -281,7 +278,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -310,7 +306,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -360,8 +356,8 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= -github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -447,8 +443,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a h1:wDtSCWGrX9tusypq2Qq9xzaA3Tf/+4D2KaWO+HQvGZE= -go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20210901212718-87f333178d59 h1:F8ArBy9n1l7HE1JjzOIYqweEqoUlywy5+L3bR0tIa9g= +go.starlark.net v0.0.0-20210901212718-87f333178d59/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -459,8 +455,9 @@ golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -524,6 +521,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= @@ -533,8 +531,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= -golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -595,6 +593,7 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -686,8 +685,9 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -784,20 +784,20 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0 h1:elCpMZ9UE8dLdYxr55E06TmSeji9I3KH494qH70/y+c= -k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/apimachinery v0.22.0 h1:CqH/BdNAzZl+sr3tc0D3VsK3u6ARVSo3GWyLmfIjbP0= -k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= -k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= +k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw= +k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8= +k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk= +k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/client-go v0.22.2 h1:DaSQgs02aCC1QcwUdkKZWOeaVsQjYvWv8ZazcZ6JcHc= +k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 h1:imL9YgXQ9p7xmPzHFm/vVd/cF78jad+n4wK1ABwYtMM= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g= +k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From f81b6203d071c97cf9421ca53e5ee72e29e9ddb1 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 14 Oct 2021 15:53:54 -0500 Subject: [PATCH 196/430] chore: release v0.10.0-rc2 (#213) --- go.mod | 10 +++++----- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 16055de2..79abca7d 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/pkg-executor v0.10.0-rc1 - github.com/go-vela/pkg-queue v0.10.0-rc1 - github.com/go-vela/pkg-runtime v0.10.0-rc1 - github.com/go-vela/sdk-go v0.10.0-rc1 - github.com/go-vela/types v0.10.0-rc1 + github.com/go-vela/pkg-executor v0.10.0-rc2 + github.com/go-vela/pkg-queue v0.10.0-rc2 + github.com/go-vela/pkg-runtime v0.10.0-rc2 + github.com/go-vela/sdk-go v0.10.0-rc2 + github.com/go-vela/types v0.10.0-rc2 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index c6599548..8f8a61bf 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.8+incompatible h1:RVqD337BgQicVCzYrrlhLDWhq6OAD2PJDUg2LsEUvKM= -github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.9+incompatible h1:JlsVnETOjM2RLQa0Cc1XCIspUdXW3Zenq9P54uXBm6k= +github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= @@ -160,20 +160,20 @@ github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F4 github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.10.0-rc1 h1:mBEANEk7GAmu6xx8munxSQJIqnDCRX6wcSCOA6yW3Wk= -github.com/go-vela/compiler v0.10.0-rc1/go.mod h1:gV7bnMwofhBX2GcqzUarQxyTAGbvXwu2dFDuMWw7J1Q= -github.com/go-vela/mock v0.10.0-rc1 h1:qmNQ7+TeIXJtHduR3zVVOpBxyK+kJDGvc75W3PyotbA= -github.com/go-vela/mock v0.10.0-rc1/go.mod h1:/TyCo/+XxWmOC3n7UzhMepd3rofXcjKRQKAUR1LdIwE= -github.com/go-vela/pkg-executor v0.10.0-rc1 h1:g3UZJGF7c2/q9N5o1z5Z+cYot7onPZPI/CVKsVfjjh8= -github.com/go-vela/pkg-executor v0.10.0-rc1/go.mod h1:1sgfiRlz5z9KRQAFy99CG1UE9Gx0GVz2fYoBGY05WSA= -github.com/go-vela/pkg-queue v0.10.0-rc1 h1:9OMqTkh13dfQpU0RWS+/DeDeFUjtYiHZMuuTZuh4W68= -github.com/go-vela/pkg-queue v0.10.0-rc1/go.mod h1:AOBWglHWox9c2894CqPO6oxV36DfxrN7Cy8VGGYlAEc= -github.com/go-vela/pkg-runtime v0.10.0-rc1 h1:UJ3/o+PAIlv3jc3Y4EDF++ZJutQlbshVwJjm4QVEX8c= -github.com/go-vela/pkg-runtime v0.10.0-rc1/go.mod h1:AE4xLXfX5SSQJZimy8jqrnaTtXeKeK+/CYbVPI8vlm8= -github.com/go-vela/sdk-go v0.10.0-rc1 h1:IzCpQhi6ONvexs2Bl5lJpVOogCt/CQ4sJpAIEKX9QbY= -github.com/go-vela/sdk-go v0.10.0-rc1/go.mod h1:iRUqojGeiEYbppXEaD9ydYP8rAmMPmpOeAI0h6Ug5JY= -github.com/go-vela/types v0.10.0-rc1 h1:IivOokpjtMLpCPi3rWZcnHWrmaynxW9cDUDbhUDubqY= -github.com/go-vela/types v0.10.0-rc1/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/go-vela/compiler v0.10.0-rc2 h1:Qe7h0LjYpGWxbE3lPRBNOneCd4OwYBMjOJVrY3gzIa0= +github.com/go-vela/compiler v0.10.0-rc2/go.mod h1:HyylyqSiEFK+mtGraKhmw18hcmI2xHSudIgmcrMTmc4= +github.com/go-vela/mock v0.10.0-rc2 h1:IJbrTczeGl+1Q0ynPUWVVScbc5p3/bRnfRyTRqqOl+g= +github.com/go-vela/mock v0.10.0-rc2/go.mod h1:VDKgwRdTG/mY+xMVtcxKIhiJj6iNL2Xydf5z72XWgXw= +github.com/go-vela/pkg-executor v0.10.0-rc2 h1:g3MFktSVmNlorUcLhFYAd+gn64T6NU8mcWYQqrY1ya0= +github.com/go-vela/pkg-executor v0.10.0-rc2/go.mod h1:6+J95XMgsVVtiEtZkm2u+Ycmch49HQNt3ilw7bNxeis= +github.com/go-vela/pkg-queue v0.10.0-rc2 h1:8ZuoxlD61xiovYvpnNeN8g3GiMkFfAMaW8kJtMJYon0= +github.com/go-vela/pkg-queue v0.10.0-rc2/go.mod h1:Gji1pwPHUvLZ7F1lLwt/8X4C31g3fm0JHjN766x8FRw= +github.com/go-vela/pkg-runtime v0.10.0-rc2 h1:QBKk8mecgj2iwnyMgPk4c49gBn123RP6tAqaH3hdkaE= +github.com/go-vela/pkg-runtime v0.10.0-rc2/go.mod h1:2SOQ/QK0afajWUG3KTAXj4s3NsPUtt9JAUxekIks2fU= +github.com/go-vela/sdk-go v0.10.0-rc2 h1:IhdNMw3AUuIWnQhTwIVXYfXTrj8IwgvAVghvkIuzg9g= +github.com/go-vela/sdk-go v0.10.0-rc2/go.mod h1:gDuG9hNHH0MQ1ysPzdCDfUElmsFIlzNcUJ1OGDjy4hA= +github.com/go-vela/types v0.10.0-rc2 h1:6MJBM2ZNN/czW4lQbt2hnGmpakY1Hc4Q0unrbsCdEk4= +github.com/go-vela/types v0.10.0-rc2/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From 61ed11d97fe23e8fc45db9db839337324b586d31 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:57:45 -0500 Subject: [PATCH 197/430] chore: release v0.10.0-rc3 (#214) --- go.mod | 10 +++++----- go.sum | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 79abca7d..196c7a66 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/pkg-executor v0.10.0-rc2 - github.com/go-vela/pkg-queue v0.10.0-rc2 - github.com/go-vela/pkg-runtime v0.10.0-rc2 - github.com/go-vela/sdk-go v0.10.0-rc2 - github.com/go-vela/types v0.10.0-rc2 + github.com/go-vela/pkg-executor v0.10.0-rc3 + github.com/go-vela/pkg-queue v0.10.0-rc3 + github.com/go-vela/pkg-runtime v0.10.0-rc3 + github.com/go-vela/sdk-go v0.10.0-rc3 + github.com/go-vela/types v0.10.0-rc3 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 8f8a61bf..a7490cf8 100644 --- a/go.sum +++ b/go.sum @@ -160,20 +160,20 @@ github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F4 github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.10.0-rc2 h1:Qe7h0LjYpGWxbE3lPRBNOneCd4OwYBMjOJVrY3gzIa0= -github.com/go-vela/compiler v0.10.0-rc2/go.mod h1:HyylyqSiEFK+mtGraKhmw18hcmI2xHSudIgmcrMTmc4= -github.com/go-vela/mock v0.10.0-rc2 h1:IJbrTczeGl+1Q0ynPUWVVScbc5p3/bRnfRyTRqqOl+g= -github.com/go-vela/mock v0.10.0-rc2/go.mod h1:VDKgwRdTG/mY+xMVtcxKIhiJj6iNL2Xydf5z72XWgXw= -github.com/go-vela/pkg-executor v0.10.0-rc2 h1:g3MFktSVmNlorUcLhFYAd+gn64T6NU8mcWYQqrY1ya0= -github.com/go-vela/pkg-executor v0.10.0-rc2/go.mod h1:6+J95XMgsVVtiEtZkm2u+Ycmch49HQNt3ilw7bNxeis= -github.com/go-vela/pkg-queue v0.10.0-rc2 h1:8ZuoxlD61xiovYvpnNeN8g3GiMkFfAMaW8kJtMJYon0= -github.com/go-vela/pkg-queue v0.10.0-rc2/go.mod h1:Gji1pwPHUvLZ7F1lLwt/8X4C31g3fm0JHjN766x8FRw= -github.com/go-vela/pkg-runtime v0.10.0-rc2 h1:QBKk8mecgj2iwnyMgPk4c49gBn123RP6tAqaH3hdkaE= -github.com/go-vela/pkg-runtime v0.10.0-rc2/go.mod h1:2SOQ/QK0afajWUG3KTAXj4s3NsPUtt9JAUxekIks2fU= -github.com/go-vela/sdk-go v0.10.0-rc2 h1:IhdNMw3AUuIWnQhTwIVXYfXTrj8IwgvAVghvkIuzg9g= -github.com/go-vela/sdk-go v0.10.0-rc2/go.mod h1:gDuG9hNHH0MQ1ysPzdCDfUElmsFIlzNcUJ1OGDjy4hA= -github.com/go-vela/types v0.10.0-rc2 h1:6MJBM2ZNN/czW4lQbt2hnGmpakY1Hc4Q0unrbsCdEk4= -github.com/go-vela/types v0.10.0-rc2/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/go-vela/compiler v0.10.0-rc4 h1:u4j5HX3qhucGxMaGtErCKRgqBdPCvTCJfFnY/7rxqY0= +github.com/go-vela/compiler v0.10.0-rc4/go.mod h1:Zq1L6qXsV/h5kWO5A3boGzFWvXk7he6FO2hcMVuSupw= +github.com/go-vela/mock v0.10.0-rc3 h1:8iSaXkFrfd4CLecJyoOKLHycy4V8gzNZvn2tl74gh0Y= +github.com/go-vela/mock v0.10.0-rc3/go.mod h1:2Ozzvev0kVsZCkkwbVvQHY7MbmENfR86wJ8pvtYtMhc= +github.com/go-vela/pkg-executor v0.10.0-rc3 h1:WVfpnIWD47yDv1OPWh7D1+N5I2KvRlXlgdd+6zd3WIo= +github.com/go-vela/pkg-executor v0.10.0-rc3/go.mod h1:VsF1cqbgcxDPJ3Lz3C039sSJ9UjhKZpu3s/pMVh/0kY= +github.com/go-vela/pkg-queue v0.10.0-rc3 h1:DodyfSWMxOdaWd4Itf5RdP0/9gCHr1hBBJg8Kp8AzVQ= +github.com/go-vela/pkg-queue v0.10.0-rc3/go.mod h1:d9tv7Zl/SqfVYyWVcmrmiqPOGkV2CGnCrGs8hKjSSso= +github.com/go-vela/pkg-runtime v0.10.0-rc3 h1:I7Jki1H1xU8uWhdcNyM0MJMnmHigFDyq8j7xSlssxX0= +github.com/go-vela/pkg-runtime v0.10.0-rc3/go.mod h1:1rG51snEOljmtjL5N37XvfiLfMtVuR5JHc5Aa03ee+g= +github.com/go-vela/sdk-go v0.10.0-rc3 h1:aHMnn6zBcfrgE2k6SZVhSF0scjHUhQS2Dg5LBiZPX/A= +github.com/go-vela/sdk-go v0.10.0-rc3/go.mod h1:jA2P9gyoCUgAZlYkoYhHyTNlcvRmxSinI3d1dvqGzCc= +github.com/go-vela/types v0.10.0-rc3 h1:QWxjrxJnxLCxY1aBh/2DYugfdR5WVdWmaiMfvhNaN+0= +github.com/go-vela/types v0.10.0-rc3/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From 4287cecd0295074cede411051db6147cbf69fa5d Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:21:59 -0500 Subject: [PATCH 198/430] chore: release v0.10.0 (#216) --- go.mod | 10 +++++----- go.sum | 27 ++++++++++++++------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 196c7a66..5ebc5aba 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/pkg-executor v0.10.0-rc3 - github.com/go-vela/pkg-queue v0.10.0-rc3 - github.com/go-vela/pkg-runtime v0.10.0-rc3 - github.com/go-vela/sdk-go v0.10.0-rc3 - github.com/go-vela/types v0.10.0-rc3 + github.com/go-vela/pkg-executor v0.10.0 + github.com/go-vela/pkg-queue v0.10.0 + github.com/go-vela/pkg-runtime v0.10.0 + github.com/go-vela/sdk-go v0.10.0 + github.com/go-vela/types v0.10.0 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index a7490cf8..dd3a123b 100644 --- a/go.sum +++ b/go.sum @@ -160,20 +160,21 @@ github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F4 github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.10.0-rc4 h1:u4j5HX3qhucGxMaGtErCKRgqBdPCvTCJfFnY/7rxqY0= -github.com/go-vela/compiler v0.10.0-rc4/go.mod h1:Zq1L6qXsV/h5kWO5A3boGzFWvXk7he6FO2hcMVuSupw= -github.com/go-vela/mock v0.10.0-rc3 h1:8iSaXkFrfd4CLecJyoOKLHycy4V8gzNZvn2tl74gh0Y= -github.com/go-vela/mock v0.10.0-rc3/go.mod h1:2Ozzvev0kVsZCkkwbVvQHY7MbmENfR86wJ8pvtYtMhc= -github.com/go-vela/pkg-executor v0.10.0-rc3 h1:WVfpnIWD47yDv1OPWh7D1+N5I2KvRlXlgdd+6zd3WIo= -github.com/go-vela/pkg-executor v0.10.0-rc3/go.mod h1:VsF1cqbgcxDPJ3Lz3C039sSJ9UjhKZpu3s/pMVh/0kY= -github.com/go-vela/pkg-queue v0.10.0-rc3 h1:DodyfSWMxOdaWd4Itf5RdP0/9gCHr1hBBJg8Kp8AzVQ= -github.com/go-vela/pkg-queue v0.10.0-rc3/go.mod h1:d9tv7Zl/SqfVYyWVcmrmiqPOGkV2CGnCrGs8hKjSSso= -github.com/go-vela/pkg-runtime v0.10.0-rc3 h1:I7Jki1H1xU8uWhdcNyM0MJMnmHigFDyq8j7xSlssxX0= -github.com/go-vela/pkg-runtime v0.10.0-rc3/go.mod h1:1rG51snEOljmtjL5N37XvfiLfMtVuR5JHc5Aa03ee+g= -github.com/go-vela/sdk-go v0.10.0-rc3 h1:aHMnn6zBcfrgE2k6SZVhSF0scjHUhQS2Dg5LBiZPX/A= -github.com/go-vela/sdk-go v0.10.0-rc3/go.mod h1:jA2P9gyoCUgAZlYkoYhHyTNlcvRmxSinI3d1dvqGzCc= -github.com/go-vela/types v0.10.0-rc3 h1:QWxjrxJnxLCxY1aBh/2DYugfdR5WVdWmaiMfvhNaN+0= +github.com/go-vela/compiler v0.10.0 h1:dFilpf5A+tiJWibILE2kHnAa+UEFDZgv/9lDwd0+n84= +github.com/go-vela/compiler v0.10.0/go.mod h1:Zq1L6qXsV/h5kWO5A3boGzFWvXk7he6FO2hcMVuSupw= +github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= +github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= +github.com/go-vela/pkg-executor v0.10.0 h1:7zPysuDj7oi6E056IEkU66KOYA2SIc32Kqgm1lnn0pE= +github.com/go-vela/pkg-executor v0.10.0/go.mod h1:voWCsAoHZb8HUSEcrTGYNHRh1IUBXWlovFVAWnF8xXo= +github.com/go-vela/pkg-queue v0.10.0 h1:cxpkyVuX+ZJuF9t7XEQuHOFBa776SNgraEsFpnWI03E= +github.com/go-vela/pkg-queue v0.10.0/go.mod h1:ZtkPoazVfpKK/ePdea/2s2LpNWDrc19nqmn1hPI3jxY= +github.com/go-vela/pkg-runtime v0.10.0 h1:ycjK0mSrM+sAwOtENKjKMGMTGkx4xkc/zMA0JIr9T0k= +github.com/go-vela/pkg-runtime v0.10.0/go.mod h1:ffabnvUkIEY/5r1XFep40HdCqrHp4OxmzbbY3W7g6C4= +github.com/go-vela/sdk-go v0.10.0 h1:monESdM738WeY2MKlj0COGK0W/f1PIGwp8K4tClfLlo= +github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/types v0.10.0-rc3/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= +github.com/go-vela/types v0.10.0/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From e83daee0bece6e0ffc5a43e49c6f26e1ff8b2685 Mon Sep 17 00:00:00 2001 From: Jordan Sussman Date: Thu, 21 Oct 2021 14:23:29 -0500 Subject: [PATCH 199/430] fix(register): handle nil response (#217) --- cmd/vela-worker/register.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index a054b295..bb6c646e 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -18,12 +18,16 @@ func (w *Worker) checkIn(config *library.Worker) error { logrus.Infof("retrieving worker %s from the server", config.GetHostname()) _, resp, err := w.VelaClient.Worker.Get(config.GetHostname()) if err != nil { + respErr := fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) + if resp == nil { + return respErr + } // if we receive a 404 the worker needs to be registered if resp.StatusCode == http.StatusNotFound { return w.register(config) } - return fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) + return respErr } // if we were able to GET the worker, update it From c3c5fde56f51a7969ff8cd5eebbbbc3965b76c63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 13:56:55 -0500 Subject: [PATCH 200/430] chore(deps): update postgres docker tag to v14 (#210) Co-authored-by: Renovate Bot --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1d3e8aa0..e696a1b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -122,7 +122,7 @@ services: # https://www.postgresql.org/ postgres: container_name: postgres - image: postgres:13-alpine + image: postgres:14-alpine networks: - vela environment: From 2f4981129c116a71c2b08a161d663c8a4dbb63fa Mon Sep 17 00:00:00 2001 From: kaymckay <39921134+kaymckay@users.noreply.github.com> Date: Tue, 26 Oct 2021 09:44:12 -0500 Subject: [PATCH 201/430] remove/fix broken links (#218) --- DOCS.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/DOCS.md b/DOCS.md index d95ce3b4..8d59659b 100644 --- a/DOCS.md +++ b/DOCS.md @@ -93,7 +93,7 @@ In order to run a build in Vela, you'll need to add a repo to the locally runnin

1. Navigate to the `Source Repositories` page @ http://localhost:8888/account/source-repos - * For convenience, you can reference our documentation to [learn how to enable a repo](https://go-vela.github.io/docs/usage/getting-started/enable_repo/). + * For convenience, you can reference our documentation to [learn how to enable a repo](https://go-vela.github.io/docs/usage/enable_repo/). 2. Click the blue drop down arrow on the left side next to the org that contains the repo you want to enable. @@ -115,8 +115,8 @@ In order to run a build in Vela, you'll need to add a pipeline to the repo that

click to reveal content

-1. Create a Vela [pipeline](https://go-vela.github.io/docs/concepts/pipeline/) to define a workflow for Vela to run. - * For conveinence, you can reference our documentation to use [one of our sample pipelines](https://go-vela.github.io/docs/usage/samples/). +1. Create a Vela [pipeline](https://go-vela.github.io/docs/tour/) to define a workflow for Vela to run. + * For conveinence, you can reference our documentation to use [one of our example pipelines](https://go-vela.github.io/docs/usage/examples/). 2. Add the pipeline to the repo that was enabled above. @@ -158,24 +158,18 @@ The `server` Docker compose service hosts the Vela server and API. This component is used for processing web requests and managing resources in the database and publishing builds to the FIFO queue. -For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/server/). - ### Worker The `worker` Docker compose service hosts the Vela build daemon. This component is used for pulling builds from the FIFO queue and executing them based off their configuration. -For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/worker/). - ### UI The `ui` Docker compose service hosts the Vela UI. This component is used for providing a user-friendly interface for triggering actions in the Vela system. -For more information, please review [the official documentation](https://go-vela.github.io/docs/concepts/infrastructure/ui/). - ### Redis The `redis` Docker compose service hosts the Redis database. From 778c2044ea92e92cfa2f6d993f554eb8838ce462 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 26 Oct 2021 11:56:16 -0500 Subject: [PATCH 202/430] feat(internal): add internal logic from pkg-executor (#219) * feat(internal): add logic from pkg-executor * chore: clean go dependencies * chore: address linter feedback --- go.mod | 1 + internal/build/doc.go | 11 ++ internal/build/snapshot.go | 51 +++++ internal/build/snapshot_test.go | 105 +++++++++++ internal/build/upload.go | 79 ++++++++ internal/build/upload_test.go | 132 +++++++++++++ internal/doc.go | 16 ++ internal/internal.go | 10 + internal/service/doc.go | 11 ++ internal/service/environment.go | 85 +++++++++ internal/service/environment_test.go | 134 ++++++++++++++ internal/service/load.go | 59 ++++++ internal/service/load_test.go | 162 ++++++++++++++++ internal/service/snapshot.go | 66 +++++++ internal/service/snapshot_test.go | 142 ++++++++++++++ internal/service/upload.go | 93 ++++++++++ internal/service/upload_test.go | 170 +++++++++++++++++ internal/step/doc.go | 11 ++ internal/step/environment.go | 85 +++++++++ internal/step/environment_test.go | 133 +++++++++++++ internal/step/load.go | 85 +++++++++ internal/step/load_test.go | 255 +++++++++++++++++++++++++ internal/step/skip.go | 50 +++++ internal/step/skip_test.go | 200 ++++++++++++++++++++ internal/step/snapshot.go | 119 ++++++++++++ internal/step/snapshot_test.go | 267 +++++++++++++++++++++++++++ internal/step/upload.go | 93 ++++++++++ internal/step/upload_test.go | 170 +++++++++++++++++ 28 files changed, 2795 insertions(+) create mode 100644 internal/build/doc.go create mode 100644 internal/build/snapshot.go create mode 100644 internal/build/snapshot_test.go create mode 100644 internal/build/upload.go create mode 100644 internal/build/upload_test.go create mode 100644 internal/doc.go create mode 100644 internal/internal.go create mode 100644 internal/service/doc.go create mode 100644 internal/service/environment.go create mode 100644 internal/service/environment_test.go create mode 100644 internal/service/load.go create mode 100644 internal/service/load_test.go create mode 100644 internal/service/snapshot.go create mode 100644 internal/service/snapshot_test.go create mode 100644 internal/service/upload.go create mode 100644 internal/service/upload_test.go create mode 100644 internal/step/doc.go create mode 100644 internal/step/environment.go create mode 100644 internal/step/environment_test.go create mode 100644 internal/step/load.go create mode 100644 internal/step/load_test.go create mode 100644 internal/step/skip.go create mode 100644 internal/step/skip_test.go create mode 100644 internal/step/snapshot.go create mode 100644 internal/step/snapshot_test.go create mode 100644 internal/step/upload.go create mode 100644 internal/step/upload_test.go diff --git a/go.mod b/go.mod index 5ebc5aba..48e88967 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 + github.com/go-vela/mock v0.10.0 github.com/go-vela/pkg-executor v0.10.0 github.com/go-vela/pkg-queue v0.10.0 github.com/go-vela/pkg-runtime v0.10.0 diff --git a/internal/build/doc.go b/internal/build/doc.go new file mode 100644 index 00000000..c2c5c609 --- /dev/null +++ b/internal/build/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package build provides the ability for Vela to +// manipulate and manage a build from a pipeline. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/build" +package build diff --git a/internal/build/snapshot.go b/internal/build/snapshot.go new file mode 100644 index 00000000..77adb1e8 --- /dev/null +++ b/internal/build/snapshot.go @@ -0,0 +1,51 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package build + +import ( + "strings" + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/sirupsen/logrus" +) + +// Snapshot creates a moment in time record of the build +// and attempts to upload it to the server. +func Snapshot(b *library.Build, c *vela.Client, e error, l *logrus.Entry, r *library.Repo) { + // check if the build is not in a canceled status + if !strings.EqualFold(b.GetStatus(), constants.StatusCanceled) { + // check if the error provided is empty + if e != nil { + // populate build fields with error based values + b.SetError(e.Error()) + b.SetStatus(constants.StatusError) + b.SetFinished(time.Now().UTC().Unix()) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading build snapshot") + + // send API call to update the build + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update + _, _, err := c.Build.Update(r.GetOrg(), r.GetName(), b) + if err != nil { + l.Errorf("unable to upload build snapshot: %v", err) + } + } +} diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go new file mode 100644 index 00000000..7747b6e0 --- /dev/null +++ b/internal/build/snapshot_test.go @@ -0,0 +1,105 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package build + +import ( + "errors" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" +) + +func TestBuild_Snapshot(t *testing.T) { + // setup types + b := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + r := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + err error + repo *library.Repo + }{ + { + build: b, + client: _client, + err: errors.New("unable to create network"), + repo: r, + }, + { + build: nil, + client: _client, + err: errors.New("unable to create network"), + repo: r, + }, + { + build: nil, + client: nil, + err: nil, + repo: nil, + }, + } + + // run test + for _, test := range tests { + Snapshot(test.build, test.client, test.err, nil, test.repo) + } +} diff --git a/internal/build/upload.go b/internal/build/upload.go new file mode 100644 index 00000000..4ab8e6f5 --- /dev/null +++ b/internal/build/upload.go @@ -0,0 +1,79 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package build + +import ( + "strings" + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/sirupsen/logrus" +) + +// Upload tracks the final state of the build +// and attempts to upload it to the server. +func Upload(b *library.Build, c *vela.Client, e error, l *logrus.Entry, r *library.Repo) { + // handle the build based off the status provided + switch b.GetStatus() { + // build is in a canceled state + case constants.StatusCanceled: + fallthrough + // build is in a error state + case constants.StatusError: + fallthrough + // build is in a failure state + case constants.StatusFailure: + // if the build is in a canceled, error + // or failure state we DO NOT want to + // update the state to be success + break + // build is in a pending state + case constants.StatusPending: + // if the build is in a pending state + // then something must have gone + // drastically wrong because this + // SHOULD NOT happen + b.SetStatus(constants.StatusKilled) + default: + // update the build with a success state + b.SetStatus(constants.StatusSuccess) + } + + // check if the build is not in a canceled status + if !strings.EqualFold(b.GetStatus(), constants.StatusCanceled) { + // check if the error provided is empty + if e != nil { + // update the build with error based values + b.SetError(e.Error()) + b.SetStatus(constants.StatusError) + } + } + + // update the build with the finished timestamp + b.SetFinished(time.Now().UTC().Unix()) + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading final build state") + + // send API call to update the build + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update + _, _, err := c.Build.Update(r.GetOrg(), r.GetName(), b) + if err != nil { + l.Errorf("unable to upload final build state: %v", err) + } + } +} diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go new file mode 100644 index 00000000..b29f90fc --- /dev/null +++ b/internal/build/upload_test.go @@ -0,0 +1,132 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package build + +import ( + "errors" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" +) + +func TestBuild_Upload(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _canceled := *_build + _canceled.SetStatus("canceled") + + _error := *_build + _error.SetStatus("error") + + _pending := *_build + _pending.SetStatus("pending") + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + err error + repo *library.Repo + }{ + { + build: _build, + client: _client, + err: errors.New("unable to create network"), + repo: _repo, + }, + { + build: &_canceled, + client: _client, + err: errors.New("unable to create network"), + repo: _repo, + }, + { + build: &_error, + client: _client, + err: errors.New("unable to create network"), + repo: _repo, + }, + { + build: &_pending, + client: _client, + err: errors.New("unable to create network"), + repo: _repo, + }, + { + build: nil, + client: _client, + err: errors.New("unable to create network"), + repo: _repo, + }, + { + build: nil, + client: nil, + err: nil, + repo: nil, + }, + } + + // run test + for _, test := range tests { + Upload(test.build, test.client, test.err, nil, test.repo) + } +} diff --git a/internal/doc.go b/internal/doc.go new file mode 100644 index 00000000..a8093234 --- /dev/null +++ b/internal/doc.go @@ -0,0 +1,16 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package internal provides a collection of internal +// packages used for the Vela executor systems. +// +// More information: +// +// * https://golang.org/doc/go1.4#internalpackages +// * https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit +// +// Usage: +// +// import "github.com/go-vela/worker/internal" +package internal diff --git a/internal/internal.go b/internal/internal.go new file mode 100644 index 00000000..a0e07f05 --- /dev/null +++ b/internal/internal.go @@ -0,0 +1,10 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package internal + +// For more information: +// +// * https://golang.org/doc/go1.4#internalpackages +// * https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit diff --git a/internal/service/doc.go b/internal/service/doc.go new file mode 100644 index 00000000..7a2f0920 --- /dev/null +++ b/internal/service/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package service provides the ability for Vela to +// manipulate and manage a service from a pipeline. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/service" +package service diff --git a/internal/service/environment.go b/internal/service/environment.go new file mode 100644 index 00000000..401a4b83 --- /dev/null +++ b/internal/service/environment.go @@ -0,0 +1,85 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "fmt" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Environment attempts to update the environment variables +// for the container based off the library resources. +// +// nolint: lll // ignore long line length due to parameters +func Environment(c *pipeline.Container, b *library.Build, r *library.Repo, s *library.Service, version string) error { + // check if container or container environment are empty + if c == nil || c.Environment == nil { + return fmt.Errorf("empty container provided for environment") + } + + // check if the build provided is empty + if b != nil { + // check if the channel exists in the environment + channel, ok := c.Environment["VELA_CHANNEL"] + if !ok { + // set default for channel + channel = constants.DefaultRoute + } + + // check if the workspace exists in the environment + workspace, ok := c.Environment["VELA_WORKSPACE"] + if !ok { + // set default for workspace + workspace = constants.WorkspaceDefault + } + + // update environment variables + c.Environment["VELA_DISTRIBUTION"] = b.GetDistribution() + c.Environment["VELA_HOST"] = b.GetHost() + c.Environment["VELA_RUNTIME"] = b.GetRuntime() + c.Environment["VELA_VERSION"] = version + + // populate environment variables from build library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Build.Environment + err := c.MergeEnv(b.Environment(workspace, channel)) + if err != nil { + return err + } + } + + // check if the repo provided is empty + if r != nil { + // populate environment variables from repo library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Repo.Environment + err := c.MergeEnv(r.Environment()) + if err != nil { + return err + } + } + + // check if the service provided is empty + if s != nil { + // populate environment variables from service library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Service.Environment + err := c.MergeEnv(s.Environment()) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/service/environment_test.go b/internal/service/environment_test.go new file mode 100644 index 00000000..d4c89457 --- /dev/null +++ b/internal/service/environment_test.go @@ -0,0 +1,134 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "testing" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/types/raw" +) + +func TestService_Environment(t *testing.T) { + // setup types + b := new(library.Build) + b.SetID(1) + b.SetRepoID(1) + b.SetNumber(1) + b.SetParent(1) + b.SetEvent("push") + b.SetStatus("running") + b.SetError("") + b.SetEnqueued(1563474077) + b.SetCreated(1563474076) + b.SetStarted(1563474078) + b.SetFinished(1563474079) + b.SetDeploy("") + b.SetDeployPayload(raw.StringSliceMap{"foo": "test1"}) + b.SetClone("https://github.com/github/octocat.git") + b.SetSource("https://github.com/github/octocat/48afb5bdc41ad69bf22588491333f7cf71135163") + b.SetTitle("push received from https://github.com/github/octocat") + b.SetMessage("First commit...") + b.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") + b.SetSender("OctoKitty") + b.SetAuthor("OctoKitty") + b.SetEmail("OctoKitty@github.com") + b.SetLink("https://example.company.com/github/octocat/1") + b.SetBranch("master") + b.SetRef("refs/heads/master") + b.SetBaseRef("") + b.SetHeadRef("changes") + b.SetHost("example.company.com") + b.SetRuntime("docker") + b.SetDistribution("linux") + + c := &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + } + + r := new(library.Repo) + r.SetID(1) + r.SetOrg("github") + r.SetName("octocat") + r.SetFullName("github/octocat") + r.SetLink("https://github.com/github/octocat") + r.SetClone("https://github.com/github/octocat.git") + r.SetBranch("master") + r.SetTimeout(30) + r.SetVisibility("public") + r.SetPrivate(false) + r.SetTrusted(false) + r.SetActive(true) + r.SetAllowPull(false) + r.SetAllowPush(true) + r.SetAllowDeploy(false) + r.SetAllowTag(false) + r.SetAllowComment(false) + + s := new(library.Service) + s.SetID(1) + s.SetBuildID(1) + s.SetRepoID(1) + s.SetNumber(1) + s.SetName("postgres") + s.SetImage("postgres:12-alpine") + s.SetStatus("running") + s.SetExitCode(0) + s.SetCreated(1563474076) + s.SetStarted(1563474078) + s.SetFinished(1563474079) + s.SetHost("example.company.com") + s.SetRuntime("docker") + s.SetDistribution("linux") + + // setup tests + tests := []struct { + failure bool + build *library.Build + container *pipeline.Container + repo *library.Repo + service *library.Service + }{ + { + failure: false, + build: b, + container: c, + repo: r, + service: s, + }, + { + failure: true, + build: nil, + container: nil, + repo: nil, + service: nil, + }, + } + + // run tests + for _, test := range tests { + err := Environment(test.container, test.build, test.repo, test.service, "v0.0.0") + + if test.failure { + if err == nil { + t.Errorf("Environment should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Environment returned err: %v", err) + } + } +} diff --git a/internal/service/load.go b/internal/service/load.go new file mode 100644 index 00000000..7c49e367 --- /dev/null +++ b/internal/service/load.go @@ -0,0 +1,59 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "fmt" + "sync" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Load attempts to capture the library service +// representing the container from the map. +func Load(c *pipeline.Container, m *sync.Map) (*library.Service, error) { + // check if the container provided is empty + if c == nil { + return nil, fmt.Errorf("empty container provided") + } + + // load the container ID as the service key from the map + result, ok := m.Load(c.ID) + if !ok { + return nil, fmt.Errorf("unable to load service %s", c.ID) + } + + // cast the value from the service key to the expected type + s, ok := result.(*library.Service) + if !ok { + return nil, fmt.Errorf("unable to cast value for service %s", c.ID) + } + + return s, nil +} + +// LoadLogs attempts to capture the library service logs +// representing the container from the map. +func LoadLogs(c *pipeline.Container, m *sync.Map) (*library.Log, error) { + // check if the container provided is empty + if c == nil { + return nil, fmt.Errorf("empty container provided") + } + + // load the container ID as the service log key from the map + result, ok := m.Load(c.ID) + if !ok { + return nil, fmt.Errorf("unable to load logs for service %s", c.ID) + } + + // cast the value from the service log key to the expected type + l, ok := result.(*library.Log) + if !ok { + return nil, fmt.Errorf("unable to cast value to logs for service %s", c.ID) + } + + return l, nil +} diff --git a/internal/service/load_test.go b/internal/service/load_test.go new file mode 100644 index 00000000..01d6cb63 --- /dev/null +++ b/internal/service/load_test.go @@ -0,0 +1,162 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "reflect" + "sync" + "testing" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestService_Load(t *testing.T) { + // setup types + c := &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + } + + goodMap := new(sync.Map) + goodMap.Store(c.ID, new(library.Service)) + + badMap := new(sync.Map) + badMap.Store(c.ID, c) + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + _map *sync.Map + want *library.Service + }{ + { + failure: false, + container: c, + want: new(library.Service), + _map: goodMap, + }, + { + failure: true, + container: c, + want: nil, + _map: badMap, + }, + { + failure: true, + container: new(pipeline.Container), + want: nil, + _map: new(sync.Map), + }, + { + failure: true, + container: nil, + want: nil, + _map: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := Load(test.container, test._map) + + if test.failure { + if err == nil { + t.Errorf("Load should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Load returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Load is %v, want %v", got, test.want) + } + } +} + +func TestStep_LoadLogs(t *testing.T) { + // setup types + c := &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + } + + goodMap := new(sync.Map) + goodMap.Store(c.ID, new(library.Log)) + + badMap := new(sync.Map) + badMap.Store(c.ID, c) + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + _map *sync.Map + want *library.Log + }{ + { + failure: false, + container: c, + want: new(library.Log), + _map: goodMap, + }, + { + failure: true, + container: c, + want: nil, + _map: badMap, + }, + { + failure: true, + container: new(pipeline.Container), + want: nil, + _map: new(sync.Map), + }, + { + failure: true, + container: nil, + want: nil, + _map: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := LoadLogs(test.container, test._map) + + if test.failure { + if err == nil { + t.Errorf("LoadLogs should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("LoadLogs returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadLogs is %v, want %v", got, test.want) + } + } +} diff --git a/internal/service/snapshot.go b/internal/service/snapshot.go new file mode 100644 index 00000000..5421ef02 --- /dev/null +++ b/internal/service/snapshot.go @@ -0,0 +1,66 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "strings" + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" +) + +// Snapshot creates a moment in time record of the +// service and attempts to upload it to the server. +// +// nolint: lll // ignore long line length due to parameters +func Snapshot(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Service) { + // check if the build is not in a canceled status + if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { + // check if the container is running in headless mode + if !ctn.Detach { + // update the service fields to indicate a success + s.SetStatus(constants.StatusSuccess) + s.SetFinished(time.Now().UTC().Unix()) + } + + // check if the container has an unsuccessful exit code + if ctn.ExitCode != 0 { + // check if container failures should be ignored + if !ctn.Ruleset.Continue { + // set build status to failure + b.SetStatus(constants.StatusFailure) + } + + // update the service fields to indicate a failure + s.SetExitCode(ctn.ExitCode) + s.SetStatus(constants.StatusFailure) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading service snapshot") + + // send API call to update the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Update + _, _, err := c.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + l.Errorf("unable to upload service snapshot: %v", err) + } + } +} diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go new file mode 100644 index 00000000..85d8ee48 --- /dev/null +++ b/internal/service/snapshot_test.go @@ -0,0 +1,142 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestService_Snapshot(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + } + + _exitCode := &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + ExitCode: 137, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _service := &library.Service{ + ID: vela.Int64(1), + BuildID: vela.Int64(1), + RepoID: vela.Int64(1), + Number: vela.Int(1), + Name: vela.String("postgres"), + Image: vela.String("postgres:12-alpine"), + Status: vela.String("running"), + ExitCode: vela.Int(0), + Created: vela.Int64(1563474076), + Started: vela.Int64(0), + Finished: vela.Int64(1563474079), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + container *pipeline.Container + repo *library.Repo + service *library.Service + }{ + { + build: _build, + client: _client, + container: _container, + repo: _repo, + service: _service, + }, + { + build: _build, + client: _client, + container: _exitCode, + repo: _repo, + service: nil, + }, + } + + // run test + for _, test := range tests { + Snapshot(test.container, test.build, test.client, nil, test.repo, test.service) + } +} diff --git a/internal/service/upload.go b/internal/service/upload.go new file mode 100644 index 00000000..96ac7b2e --- /dev/null +++ b/internal/service/upload.go @@ -0,0 +1,93 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" +) + +// Upload tracks the final state of the service +// and attempts to upload it to the server. +// +// nolint: lll // ignore long line length due to parameters +func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Service) { + // handle the service based off the status provided + switch s.GetStatus() { + // service is in a canceled state + case constants.StatusCanceled: + fallthrough + // service is in a error state + case constants.StatusError: + fallthrough + // service is in a failure state + case constants.StatusFailure: + // if the service is in a canceled, error + // or failure state we DO NOT want to + // update the state to be success + break + // service is in a pending state + case constants.StatusPending: + // if the service is in a pending state + // then something must have gone + // drastically wrong because this + // SHOULD NOT happen + // + // TODO: consider making this a constant + // + // nolint: gomnd // ignore magic number 137 + s.SetExitCode(137) + s.SetFinished(time.Now().UTC().Unix()) + s.SetStatus(constants.StatusKilled) + + // check if the service was not started + if s.GetStarted() == 0 { + // set the started time to the finished time + s.SetStarted(s.GetFinished()) + } + default: + // update the service with a success state + s.SetStatus(constants.StatusSuccess) + } + + // check if the service finished + if s.GetFinished() == 0 { + // update the service with the finished timestamp + s.SetFinished(time.Now().UTC().Unix()) + + // check the container for an unsuccessful exit code + if ctn.ExitCode != 0 { + // update the service fields to indicate a failure + s.SetExitCode(ctn.ExitCode) + s.SetStatus(constants.StatusFailure) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading service snapshot") + + // send API call to update the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Update + _, _, err := c.Svc.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + l.Errorf("unable to upload service snapshot: %v", err) + } + } +} diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go new file mode 100644 index 00000000..4b88c19e --- /dev/null +++ b/internal/service/upload_test.go @@ -0,0 +1,170 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package service + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestService_Upload(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _exitCode := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + ExitCode: 137, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _service := &library.Service{ + ID: vela.Int64(1), + BuildID: vela.Int64(1), + RepoID: vela.Int64(1), + Number: vela.Int(1), + Name: vela.String("postgres"), + Image: vela.String("postgres:12-alpine"), + Status: vela.String("running"), + ExitCode: vela.Int(0), + Created: vela.Int64(1563474076), + Started: vela.Int64(0), + Finished: vela.Int64(1563474079), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _canceled := *_service + _canceled.SetStatus("canceled") + + _error := *_service + _error.SetStatus("error") + + _pending := *_service + _pending.SetStatus("pending") + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + container *pipeline.Container + repo *library.Repo + service *library.Service + }{ + { + build: _build, + client: _client, + container: _container, + repo: _repo, + service: _service, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + service: &_canceled, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + service: &_error, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + service: &_pending, + }, + { + build: _build, + client: _client, + container: _exitCode, + repo: _repo, + service: nil, + }, + } + + // run test + for _, test := range tests { + Upload(test.container, test.build, test.client, nil, test.repo, test.service) + } +} diff --git a/internal/step/doc.go b/internal/step/doc.go new file mode 100644 index 00000000..e763b81d --- /dev/null +++ b/internal/step/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package step provides the ability for Vela to +// manipulate and manage a step from a pipeline. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/step" +package step diff --git a/internal/step/environment.go b/internal/step/environment.go new file mode 100644 index 00000000..36821c4a --- /dev/null +++ b/internal/step/environment.go @@ -0,0 +1,85 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "fmt" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Environment attempts to update the environment variables +// for the container based off the library resources. +// +// nolint: lll // ignore long line length due to parameters +func Environment(c *pipeline.Container, b *library.Build, r *library.Repo, s *library.Step, version string) error { + // check if container or container environment are empty + if c == nil || c.Environment == nil { + return fmt.Errorf("empty container provided for environment") + } + + // check if the build provided is empty + if b != nil { + // check if the channel exists in the environment + channel, ok := c.Environment["VELA_CHANNEL"] + if !ok { + // set default for channel + channel = constants.DefaultRoute + } + + // check if the workspace exists in the environment + workspace, ok := c.Environment["VELA_WORKSPACE"] + if !ok { + // set default for workspace + workspace = constants.WorkspaceDefault + } + + // update environment variables + c.Environment["VELA_DISTRIBUTION"] = b.GetDistribution() + c.Environment["VELA_HOST"] = b.GetHost() + c.Environment["VELA_RUNTIME"] = b.GetRuntime() + c.Environment["VELA_VERSION"] = version + + // populate environment variables from build library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Build.Environment + err := c.MergeEnv(b.Environment(workspace, channel)) + if err != nil { + return err + } + } + + // check if the repo provided is empty + if r != nil { + // populate environment variables from build library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Repo.Environment + err := c.MergeEnv(r.Environment()) + if err != nil { + return err + } + } + + // check if the step provided is empty + if s != nil { + // populate environment variables from step library + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.MergeEnv + // -> + // https://pkg.go.dev/github.com/go-vela/types/library#Service.Environment + err := c.MergeEnv(s.Environment()) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/step/environment_test.go b/internal/step/environment_test.go new file mode 100644 index 00000000..d8441374 --- /dev/null +++ b/internal/step/environment_test.go @@ -0,0 +1,133 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "testing" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/types/raw" +) + +func TestStep_Environment(t *testing.T) { + // setup types + b := new(library.Build) + b.SetID(1) + b.SetRepoID(1) + b.SetNumber(1) + b.SetParent(1) + b.SetEvent("push") + b.SetStatus("running") + b.SetError("") + b.SetEnqueued(1563474077) + b.SetCreated(1563474076) + b.SetStarted(1563474078) + b.SetFinished(1563474079) + b.SetDeploy("") + b.SetDeployPayload(raw.StringSliceMap{"foo": "test1"}) + b.SetClone("https://github.com/github/octocat.git") + b.SetSource("https://github.com/github/octocat/48afb5bdc41ad69bf22588491333f7cf71135163") + b.SetTitle("push received from https://github.com/github/octocat") + b.SetMessage("First commit...") + b.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") + b.SetSender("OctoKitty") + b.SetAuthor("OctoKitty") + b.SetEmail("OctoKitty@github.com") + b.SetLink("https://example.company.com/github/octocat/1") + b.SetBranch("master") + b.SetRef("refs/heads/master") + b.SetBaseRef("") + b.SetHeadRef("changes") + b.SetHost("example.company.com") + b.SetRuntime("docker") + b.SetDistribution("linux") + + c := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + r := new(library.Repo) + r.SetID(1) + r.SetOrg("github") + r.SetName("octocat") + r.SetFullName("github/octocat") + r.SetLink("https://github.com/github/octocat") + r.SetClone("https://github.com/github/octocat.git") + r.SetBranch("master") + r.SetTimeout(30) + r.SetVisibility("public") + r.SetPrivate(false) + r.SetTrusted(false) + r.SetActive(true) + r.SetAllowPull(false) + r.SetAllowPush(true) + r.SetAllowDeploy(false) + r.SetAllowTag(false) + r.SetAllowComment(false) + + s := new(library.Step) + s.SetID(1) + s.SetBuildID(1) + s.SetRepoID(1) + s.SetNumber(1) + s.SetName("clone") + s.SetImage("target/vela-git:v0.3.0") + s.SetStatus("running") + s.SetExitCode(0) + s.SetCreated(1563474076) + s.SetStarted(1563474078) + s.SetFinished(1563474079) + s.SetHost("example.company.com") + s.SetRuntime("docker") + s.SetDistribution("linux") + + // setup tests + tests := []struct { + failure bool + build *library.Build + container *pipeline.Container + repo *library.Repo + step *library.Step + }{ + { + failure: false, + build: b, + container: c, + repo: r, + step: s, + }, + { + failure: true, + build: nil, + container: nil, + repo: nil, + step: nil, + }, + } + + // run tests + for _, test := range tests { + err := Environment(test.container, test.build, test.repo, test.step, "v0.0.0") + + if test.failure { + if err == nil { + t.Errorf("Environment should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Environment returned err: %v", err) + } + } +} diff --git a/internal/step/load.go b/internal/step/load.go new file mode 100644 index 00000000..52b8a08f --- /dev/null +++ b/internal/step/load.go @@ -0,0 +1,85 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "fmt" + "sync" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Load attempts to capture the library step +// representing the container from the map. +func Load(c *pipeline.Container, m *sync.Map) (*library.Step, error) { + // check if the container provided is empty + if c == nil { + return nil, fmt.Errorf("empty container provided") + } + + // load the container ID as the step key from the map + result, ok := m.Load(c.ID) + if !ok { + return nil, fmt.Errorf("unable to load step %s", c.ID) + } + + // cast the value from the step key to the expected type + s, ok := result.(*library.Step) + if !ok { + return nil, fmt.Errorf("unable to cast value for step %s", c.ID) + } + + return s, nil +} + +// LoadInit attempts to capture the container representing +// the init process from the pipeline. +func LoadInit(p *pipeline.Build) (*pipeline.Container, error) { + // check if the pipeline provided is empty + if p == nil { + return nil, fmt.Errorf("empty pipeline provided") + } + + // create new container for the init step + c := new(pipeline.Container) + + // check if there are steps in the pipeline + if len(p.Steps) > 0 { + // update the container for the init process + c = p.Steps[0] + } + + // check if there are stages in the pipeline + if len(p.Stages) > 0 { + // update the container for the init process + c = p.Stages[0].Steps[0] + } + + return c, nil +} + +// LoadLogs attempts to capture the library step logs +// representing the container from the map. +func LoadLogs(c *pipeline.Container, m *sync.Map) (*library.Log, error) { + // check if the container provided is empty + if c == nil { + return nil, fmt.Errorf("empty container provided") + } + + // load the container ID as the step log key from the map + result, ok := m.Load(c.ID) + if !ok { + return nil, fmt.Errorf("unable to load logs for step %s", c.ID) + } + + // cast the value from the step log key to the expected type + l, ok := result.(*library.Log) + if !ok { + return nil, fmt.Errorf("unable to cast value to logs for step %s", c.ID) + } + + return l, nil +} diff --git a/internal/step/load_test.go b/internal/step/load_test.go new file mode 100644 index 00000000..74bb1e7c --- /dev/null +++ b/internal/step/load_test.go @@ -0,0 +1,255 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "reflect" + "sync" + "testing" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestStep_Load(t *testing.T) { + // setup types + c := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + goodMap := new(sync.Map) + goodMap.Store(c.ID, new(library.Step)) + + badMap := new(sync.Map) + badMap.Store(c.ID, c) + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + _map *sync.Map + want *library.Step + }{ + { + failure: false, + container: c, + want: new(library.Step), + _map: goodMap, + }, + { + failure: true, + container: c, + want: nil, + _map: badMap, + }, + { + failure: true, + container: new(pipeline.Container), + want: nil, + _map: new(sync.Map), + }, + { + failure: true, + container: nil, + want: nil, + _map: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := Load(test.container, test._map) + + if test.failure { + if err == nil { + t.Errorf("Load should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Load returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Load is %v, want %v", got, test.want) + } + } +} + +func TestStep_LoadInit(t *testing.T) { + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + want *pipeline.Container + }{ + { + failure: false, + pipeline: &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Stages: pipeline.StageSlice{ + { + Name: "init", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_init_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + }, + }, + }, + want: &pipeline.Container{ + ID: "github_octocat_1_init_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + { + failure: false, + pipeline: &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Steps: pipeline.ContainerSlice{ + { + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + }, + want: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + { + failure: true, + pipeline: nil, + want: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := LoadInit(test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("LoadInit should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("LoadInit returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadInit is %v, want %v", got, test.want) + } + } +} + +func TestStep_LoadLogs(t *testing.T) { + // setup types + c := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + goodMap := new(sync.Map) + goodMap.Store(c.ID, new(library.Log)) + + badMap := new(sync.Map) + badMap.Store(c.ID, c) + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + _map *sync.Map + want *library.Log + }{ + { + failure: false, + container: c, + want: new(library.Log), + _map: goodMap, + }, + { + failure: true, + container: c, + want: nil, + _map: badMap, + }, + { + failure: true, + container: new(pipeline.Container), + want: nil, + _map: new(sync.Map), + }, + { + failure: true, + container: nil, + want: nil, + _map: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := LoadLogs(test.container, test._map) + + if test.failure { + if err == nil { + t.Errorf("LoadLogs should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("LoadLogs returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadLogs is %v, want %v", got, test.want) + } + } +} diff --git a/internal/step/skip.go b/internal/step/skip.go new file mode 100644 index 00000000..cc7a8fac --- /dev/null +++ b/internal/step/skip.go @@ -0,0 +1,50 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "strings" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Skip creates the ruledata from the build and repository +// information and returns true if the data does not match +// the ruleset for the given container. +func Skip(c *pipeline.Container, b *library.Build, r *library.Repo) bool { + // check if the container provided is empty + if c == nil { + return true + } + + // create ruledata from build and repository information + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#RuleData + ruledata := &pipeline.RuleData{ + Branch: b.GetBranch(), + Event: b.GetEvent(), + Repo: r.GetFullName(), + Status: b.GetStatus(), + } + + // check if the build event is tag + if strings.EqualFold(b.GetEvent(), constants.EventTag) { + // add tag information to ruledata with refs/tags prefix removed + ruledata.Tag = strings.TrimPrefix(b.GetRef(), "refs/tags/") + } + + // check if the build event is deployment + if strings.EqualFold(b.GetEvent(), constants.EventDeploy) { + // add deployment target information to ruledata + ruledata.Target = b.GetDeploy() + } + + // return the inverse of container execute + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Execute + return !c.Execute(ruledata) +} diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go new file mode 100644 index 00000000..c1c8fc3c --- /dev/null +++ b/internal/step/skip_test.go @@ -0,0 +1,200 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "testing" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestStep_Skip(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _comment := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("comment"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _deploy := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("deployment"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _tag := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("tag"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + tests := []struct { + build *library.Build + container *pipeline.Container + repo *library.Repo + want bool + }{ + { + build: _build, + container: _container, + repo: _repo, + want: false, + }, + { + build: _comment, + container: _container, + repo: _repo, + want: false, + }, + { + build: _deploy, + container: _container, + repo: _repo, + want: false, + }, + { + build: _tag, + container: _container, + repo: _repo, + want: false, + }, + { + build: nil, + container: nil, + repo: nil, + want: true, + }, + } + + // run test + for _, test := range tests { + got := Skip(test.container, test.build, test.repo) + + if got != test.want { + t.Errorf("Skip is %v, want %v", got, test.want) + } + } +} diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go new file mode 100644 index 00000000..d1a155cc --- /dev/null +++ b/internal/step/snapshot.go @@ -0,0 +1,119 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "strings" + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" +) + +// Snapshot creates a moment in time record of the +// step and attempts to upload it to the server. +// +// nolint: lll // ignore long line length due to parameters +func Snapshot(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step) { + // check if the build is not in a canceled status + if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { + // check if the container is running in headless mode + if !ctn.Detach { + // update the step fields to indicate a success + s.SetStatus(constants.StatusSuccess) + s.SetFinished(time.Now().UTC().Unix()) + } + + // check if the container has an unsuccessful exit code + if ctn.ExitCode != 0 { + // check if container failures should be ignored + if !ctn.Ruleset.Continue { + // set build status to failure + b.SetStatus(constants.StatusFailure) + } + + // update the step fields to indicate a failure + s.SetExitCode(ctn.ExitCode) + s.SetStatus(constants.StatusFailure) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading step snapshot") + + // send API call to update the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _, _, err := c.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + l.Errorf("unable to upload step snapshot: %v", err) + } + } +} + +// SnapshotInit creates a moment in time record of the +// init step and attempts to upload it to the server. +// +// nolint: lll // ignore long line length due to parameters +func SnapshotInit(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step, lg *library.Log) { + // check if the build is not in a canceled status + if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { + // check if the container has an unsuccessful exit code + if ctn.ExitCode != 0 { + // check if container failures should be ignored + if !ctn.Ruleset.Continue { + // set build status to failure + b.SetStatus(constants.StatusFailure) + } + + // update the step fields to indicate a failure + s.SetExitCode(ctn.ExitCode) + s.SetStatus(constants.StatusFailure) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading step snapshot") + + // send API call to update the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _, _, err := c.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + l.Errorf("unable to upload step snapshot: %v", err) + } + + l.Debug("uploading step logs") + + // send API call to update the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + _, _, err = c.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber(), lg) + if err != nil { + l.Errorf("unable to upload step logs: %v", err) + } + } +} diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go new file mode 100644 index 00000000..cf3073aa --- /dev/null +++ b/internal/step/snapshot_test.go @@ -0,0 +1,267 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestStep_Snapshot(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _exitCode := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + ExitCode: 137, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _step := &library.Step{ + ID: vela.Int64(1), + BuildID: vela.Int64(1), + RepoID: vela.Int64(1), + Number: vela.Int(1), + Name: vela.String("clone"), + Image: vela.String("target/vela-git:v0.3.0"), + Status: vela.String("running"), + ExitCode: vela.Int(0), + Created: vela.Int64(1563474076), + Started: vela.Int64(0), + Finished: vela.Int64(1563474079), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + container *pipeline.Container + repo *library.Repo + step *library.Step + }{ + { + build: _build, + client: _client, + container: _container, + repo: _repo, + step: _step, + }, + { + build: _build, + client: _client, + container: _exitCode, + repo: _repo, + step: nil, + }, + } + + // run test + for _, test := range tests { + Snapshot(test.container, test.build, test.client, nil, test.repo, test.step) + } +} + +func TestStep_SnapshotInit(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _exitCode := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + ExitCode: 137, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _step := &library.Step{ + ID: vela.Int64(1), + BuildID: vela.Int64(1), + RepoID: vela.Int64(1), + Number: vela.Int(1), + Name: vela.String("clone"), + Image: vela.String("target/vela-git:v0.3.0"), + Status: vela.String("running"), + ExitCode: vela.Int(0), + Created: vela.Int64(1563474076), + Started: vela.Int64(0), + Finished: vela.Int64(1563474079), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + container *pipeline.Container + log *library.Log + repo *library.Repo + step *library.Step + }{ + { + build: _build, + client: _client, + container: _container, + log: new(library.Log), + repo: _repo, + step: _step, + }, + { + build: _build, + client: _client, + container: _exitCode, + log: new(library.Log), + repo: _repo, + step: nil, + }, + } + + // run test + for _, test := range tests { + SnapshotInit(test.container, test.build, test.client, nil, test.repo, test.step, test.log) + } +} diff --git a/internal/step/upload.go b/internal/step/upload.go new file mode 100644 index 00000000..f0c29897 --- /dev/null +++ b/internal/step/upload.go @@ -0,0 +1,93 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "time" + + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" +) + +// Upload tracks the final state of the step +// and attempts to upload it to the server. +// +// nolint: lll // ignore long line length due to parameters +func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step) { + // handle the step based off the status provided + switch s.GetStatus() { + // step is in a canceled state + case constants.StatusCanceled: + fallthrough + // step is in a error state + case constants.StatusError: + fallthrough + // step is in a failure state + case constants.StatusFailure: + // if the step is in a canceled, error + // or failure state we DO NOT want to + // update the state to be success + break + // step is in a pending state + case constants.StatusPending: + // if the step is in a pending state + // then something must have gone + // drastically wrong because this + // SHOULD NOT happen + // + // TODO: consider making this a constant + // + // nolint: gomnd // ignore magic number 137 + s.SetExitCode(137) + s.SetFinished(time.Now().UTC().Unix()) + s.SetStatus(constants.StatusKilled) + + // check if the step was not started + if s.GetStarted() == 0 { + // set the started time to the finished time + s.SetStarted(s.GetFinished()) + } + default: + // update the step with a success state + s.SetStatus(constants.StatusSuccess) + } + + // check if the step finished + if s.GetFinished() == 0 { + // update the step with the finished timestamp + s.SetFinished(time.Now().UTC().Unix()) + + // check the container for an unsuccessful exit code + if ctn.ExitCode != 0 { + // update the step fields to indicate a failure + s.SetExitCode(ctn.ExitCode) + s.SetStatus(constants.StatusFailure) + } + } + + // check if the logger provided is empty + if l == nil { + // create new logger + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + l = logrus.NewEntry(logrus.StandardLogger()) + } + + // check if the Vela client provided is empty + if c != nil { + l.Debug("uploading final step state") + + // send API call to update the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _, _, err := c.Step.Update(r.GetOrg(), r.GetName(), b.GetNumber(), s) + if err != nil { + l.Errorf("unable to upload final step state: %v", err) + } + } +} diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go new file mode 100644 index 00000000..957c92c7 --- /dev/null +++ b/internal/step/upload_test.go @@ -0,0 +1,170 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package step + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestStep_Upload(t *testing.T) { + // setup types + _build := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _container := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _exitCode := &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + ExitCode: 137, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + } + + _repo := &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _step := &library.Step{ + ID: vela.Int64(1), + BuildID: vela.Int64(1), + RepoID: vela.Int64(1), + Number: vela.Int(1), + Name: vela.String("clone"), + Image: vela.String("target/vela-git:v0.3.0"), + Status: vela.String("running"), + ExitCode: vela.Int(0), + Created: vela.Int64(1563474076), + Started: vela.Int64(0), + Finished: vela.Int64(1563474079), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _canceled := *_step + _canceled.SetStatus("canceled") + + _error := *_step + _error.SetStatus("error") + + _pending := *_step + _pending.SetStatus("pending") + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + tests := []struct { + build *library.Build + client *vela.Client + container *pipeline.Container + repo *library.Repo + step *library.Step + }{ + { + build: _build, + client: _client, + container: _container, + repo: _repo, + step: _step, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + step: &_canceled, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + step: &_error, + }, + { + build: _build, + client: _client, + container: _container, + repo: _repo, + step: &_pending, + }, + { + build: _build, + client: _client, + container: _exitCode, + repo: _repo, + step: nil, + }, + } + + // run test + for _, test := range tests { + Upload(test.container, test.build, test.client, nil, test.repo, test.step) + } +} From 4a7828eaeee03002400e3c480a0cccebfa2ddaa1 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 26 Oct 2021 14:46:54 -0500 Subject: [PATCH 203/430] feat(executor): add executor logic from pkg-executor (#220) * feat(executor): add logic from pkg-executor * chore: clean go dependencies --- api/executor.go | 2 +- cmd/vela-worker/exec.go | 4 +- cmd/vela-worker/flags.go | 2 +- cmd/vela-worker/run.go | 2 +- cmd/vela-worker/worker.go | 2 +- executor/context.go | 67 ++ executor/context_test.go | 225 +++++ executor/doc.go | 12 + executor/engine.go | 110 +++ executor/executor.go | 60 ++ executor/executor_test.go | 279 ++++++ executor/flags.go | 45 + executor/linux/api.go | 199 +++++ executor/linux/api_test.go | 154 ++++ executor/linux/build.go | 581 +++++++++++++ executor/linux/build_test.go | 573 +++++++++++++ executor/linux/doc.go | 11 + executor/linux/driver.go | 12 + executor/linux/driver_test.go | 56 ++ executor/linux/linux.go | 86 ++ executor/linux/linux_test.go | 245 ++++++ executor/linux/opts.go | 179 ++++ executor/linux/opts_test.go | 353 ++++++++ executor/linux/secret.go | 367 ++++++++ executor/linux/secret_test.go | 807 ++++++++++++++++++ executor/linux/service.go | 273 ++++++ executor/linux/service_test.go | 473 ++++++++++ executor/linux/stage.go | 167 ++++ executor/linux/stage_test.go | 456 ++++++++++ executor/linux/step.go | 327 +++++++ executor/linux/step_test.go | 515 +++++++++++ executor/linux/testdata/build/empty.yml | 1 + .../linux/testdata/build/secrets/basic.yml | 23 + .../build/secrets/img_ignorenotfound.yml | 23 + .../testdata/build/secrets/img_notfound.yml | 23 + .../testdata/build/secrets/name_notfound.yml | 23 + .../linux/testdata/build/services/basic.yml | 18 + .../build/services/img_ignorenotfound.yml | 17 + .../testdata/build/services/img_notfound.yml | 17 + .../testdata/build/services/name_notfound.yml | 17 + .../linux/testdata/build/stages/basic.yml | 13 + .../build/stages/img_ignorenotfound.yml | 13 + .../testdata/build/stages/img_notfound.yml | 13 + .../testdata/build/stages/name_notfound.yml | 13 + executor/linux/testdata/build/steps/basic.yml | 11 + .../build/steps/img_ignorenotfound.yml | 11 + .../testdata/build/steps/img_notfound.yml | 11 + .../testdata/build/steps/name_notfound.yml | 11 + executor/linux/testdata/secret/basic.yml | 25 + .../linux/testdata/secret/name_notfound.yml | 25 + executor/local/api.go | 200 +++++ executor/local/api_test.go | 154 ++++ executor/local/build.go | 417 +++++++++ executor/local/build_test.go | 438 ++++++++++ executor/local/doc.go | 11 + executor/local/driver.go | 12 + executor/local/driver_test.go | 40 + executor/local/local.go | 52 ++ executor/local/local_test.go | 220 +++++ executor/local/opts.go | 121 +++ executor/local/opts_test.go | 297 +++++++ executor/local/service.go | 165 ++++ executor/local/service_test.go | 368 ++++++++ executor/local/stage.go | 129 +++ executor/local/stage_test.go | 387 +++++++++ executor/local/step.go | 224 +++++ executor/local/step_test.go | 427 +++++++++ executor/local/testdata/build/empty.yml | 1 + .../local/testdata/build/services/basic.yml | 18 + .../build/services/img_ignorenotfound.yml | 17 + .../testdata/build/services/img_notfound.yml | 17 + .../testdata/build/services/name_notfound.yml | 17 + .../local/testdata/build/stages/basic.yml | 13 + .../build/stages/img_ignorenotfound.yml | 13 + .../testdata/build/stages/img_notfound.yml | 13 + .../testdata/build/stages/name_notfound.yml | 13 + executor/local/testdata/build/steps/basic.yml | 11 + .../build/steps/img_ignorenotfound.yml | 11 + .../testdata/build/steps/img_notfound.yml | 11 + .../testdata/build/steps/name_notfound.yml | 11 + executor/setup.go | 159 ++++ executor/setup_test.go | 339 ++++++++ go.mod | 5 +- go.sum | 9 +- router/middleware/executor.go | 2 +- router/middleware/executor/executor.go | 2 +- router/middleware/executor/executor_test.go | 2 +- router/middleware/executor_test.go | 2 +- 88 files changed, 11284 insertions(+), 16 deletions(-) create mode 100644 executor/context.go create mode 100644 executor/context_test.go create mode 100644 executor/doc.go create mode 100644 executor/engine.go create mode 100644 executor/executor.go create mode 100644 executor/executor_test.go create mode 100644 executor/flags.go create mode 100644 executor/linux/api.go create mode 100644 executor/linux/api_test.go create mode 100644 executor/linux/build.go create mode 100644 executor/linux/build_test.go create mode 100644 executor/linux/doc.go create mode 100644 executor/linux/driver.go create mode 100644 executor/linux/driver_test.go create mode 100644 executor/linux/linux.go create mode 100644 executor/linux/linux_test.go create mode 100644 executor/linux/opts.go create mode 100644 executor/linux/opts_test.go create mode 100644 executor/linux/secret.go create mode 100644 executor/linux/secret_test.go create mode 100644 executor/linux/service.go create mode 100644 executor/linux/service_test.go create mode 100644 executor/linux/stage.go create mode 100644 executor/linux/stage_test.go create mode 100644 executor/linux/step.go create mode 100644 executor/linux/step_test.go create mode 100644 executor/linux/testdata/build/empty.yml create mode 100644 executor/linux/testdata/build/secrets/basic.yml create mode 100644 executor/linux/testdata/build/secrets/img_ignorenotfound.yml create mode 100644 executor/linux/testdata/build/secrets/img_notfound.yml create mode 100644 executor/linux/testdata/build/secrets/name_notfound.yml create mode 100644 executor/linux/testdata/build/services/basic.yml create mode 100644 executor/linux/testdata/build/services/img_ignorenotfound.yml create mode 100644 executor/linux/testdata/build/services/img_notfound.yml create mode 100644 executor/linux/testdata/build/services/name_notfound.yml create mode 100644 executor/linux/testdata/build/stages/basic.yml create mode 100644 executor/linux/testdata/build/stages/img_ignorenotfound.yml create mode 100644 executor/linux/testdata/build/stages/img_notfound.yml create mode 100644 executor/linux/testdata/build/stages/name_notfound.yml create mode 100644 executor/linux/testdata/build/steps/basic.yml create mode 100644 executor/linux/testdata/build/steps/img_ignorenotfound.yml create mode 100644 executor/linux/testdata/build/steps/img_notfound.yml create mode 100644 executor/linux/testdata/build/steps/name_notfound.yml create mode 100644 executor/linux/testdata/secret/basic.yml create mode 100644 executor/linux/testdata/secret/name_notfound.yml create mode 100644 executor/local/api.go create mode 100644 executor/local/api_test.go create mode 100644 executor/local/build.go create mode 100644 executor/local/build_test.go create mode 100644 executor/local/doc.go create mode 100644 executor/local/driver.go create mode 100644 executor/local/driver_test.go create mode 100644 executor/local/local.go create mode 100644 executor/local/local_test.go create mode 100644 executor/local/opts.go create mode 100644 executor/local/opts_test.go create mode 100644 executor/local/service.go create mode 100644 executor/local/service_test.go create mode 100644 executor/local/stage.go create mode 100644 executor/local/stage_test.go create mode 100644 executor/local/step.go create mode 100644 executor/local/step_test.go create mode 100644 executor/local/testdata/build/empty.yml create mode 100644 executor/local/testdata/build/services/basic.yml create mode 100644 executor/local/testdata/build/services/img_ignorenotfound.yml create mode 100644 executor/local/testdata/build/services/img_notfound.yml create mode 100644 executor/local/testdata/build/services/name_notfound.yml create mode 100644 executor/local/testdata/build/stages/basic.yml create mode 100644 executor/local/testdata/build/stages/img_ignorenotfound.yml create mode 100644 executor/local/testdata/build/stages/img_notfound.yml create mode 100644 executor/local/testdata/build/stages/name_notfound.yml create mode 100644 executor/local/testdata/build/steps/basic.yml create mode 100644 executor/local/testdata/build/steps/img_ignorenotfound.yml create mode 100644 executor/local/testdata/build/steps/img_notfound.yml create mode 100644 executor/local/testdata/build/steps/name_notfound.yml create mode 100644 executor/setup.go create mode 100644 executor/setup_test.go diff --git a/api/executor.go b/api/executor.go index 84907c93..c4e1cc12 100644 --- a/api/executor.go +++ b/api/executor.go @@ -10,9 +10,9 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/types" "github.com/go-vela/types/library" + "github.com/go-vela/worker/executor" exec "github.com/go-vela/worker/router/middleware/executor" ) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2d40428f..b0986742 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -8,8 +8,8 @@ import ( "context" "time" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/executor" "github.com/go-vela/worker/version" "github.com/sirupsen/logrus" @@ -45,7 +45,7 @@ func (w *Worker) exec(index int) error { // setup the executor // - // https://godoc.org/github.com/go-vela/pkg-executor/executor#New + // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ Driver: w.Config.Executor.Driver, Client: w.VelaClient, diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index ee282f2b..e47d0b30 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -7,9 +7,9 @@ package main import ( "time" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/executor" "github.com/urfave/cli/v2" ) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 0cae9f21..6574c62c 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -10,9 +10,9 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/executor" "github.com/sirupsen/logrus" diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index dae07639..d05af002 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -8,10 +8,10 @@ import ( "net/url" "time" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/worker/executor" ) type ( diff --git a/executor/context.go b/executor/context.go new file mode 100644 index 00000000..37750533 --- /dev/null +++ b/executor/context.go @@ -0,0 +1,67 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "context" + + "github.com/gin-gonic/gin" +) + +// key defines the key type for storing +// the executor Engine in the context. +const key = "executor" + +// FromContext retrieves the executor Engine from the context.Context. +func FromContext(c context.Context) Engine { + // get executor value from context.Context + v := c.Value(key) + if v == nil { + return nil + } + + // cast executor value to expected Engine type + e, ok := v.(Engine) + if !ok { + return nil + } + + return e +} + +// FromGinContext retrieves the executor Engine from the gin.Context. +func FromGinContext(c *gin.Context) Engine { + // get executor value from gin.Context + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Context.Get + v, ok := c.Get(key) + if !ok { + return nil + } + + // cast executor value to expected Engine type + e, ok := v.(Engine) + if !ok { + return nil + } + + return e +} + +// WithContext inserts the executor Engine into the context.Context. +func WithContext(c context.Context, e Engine) context.Context { + // set the executor Engine in the context.Context + // + // nolint: golint,staticcheck // ignore using string with context value + return context.WithValue(c, key, e) +} + +// WithGinContext inserts the executor Engine into the gin.Context. +func WithGinContext(c *gin.Context, e Engine) { + // set the executor Engine in the gin.Context + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Context.Set + c.Set(key, e) +} diff --git a/executor/context_test.go b/executor/context_test.go new file mode 100644 index 00000000..cb98e237 --- /dev/null +++ b/executor/context_test.go @@ -0,0 +1,225 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "context" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/worker/executor/linux" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" +) + +func TestExecutor_FromContext(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _engine, err := linux.New( + linux.WithBuild(_build), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + // setup tests + tests := []struct { + context context.Context + want Engine + }{ + { + // nolint: golint,staticcheck // ignore using string with context value + context: context.WithValue(context.Background(), key, _engine), + want: _engine, + }, + { + context: context.Background(), + want: nil, + }, + { + // nolint: golint,staticcheck // ignore using string with context value + context: context.WithValue(context.Background(), key, "foo"), + want: nil, + }, + } + + // run tests + for _, test := range tests { + got := FromContext(test.context) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromContext is %v, want %v", got, test.want) + } + } +} + +func TestExecutor_FromGinContext(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _engine, err := linux.New( + linux.WithBuild(_build), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + // setup tests + tests := []struct { + context *gin.Context + value interface{} + want Engine + }{ + { + context: new(gin.Context), + value: _engine, + want: _engine, + }, + { + context: new(gin.Context), + value: nil, + want: nil, + }, + { + context: new(gin.Context), + value: "foo", + want: nil, + }, + } + + // run tests + for _, test := range tests { + if test.value != nil { + test.context.Set(key, test.value) + } + + got := FromGinContext(test.context) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromGinContext is %v, want %v", got, test.want) + } + } +} + +func TestExecutor_WithContext(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _engine, err := linux.New( + linux.WithBuild(_build), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + // nolint: golint,staticcheck // ignore using string with context value + want := context.WithValue(context.Background(), key, _engine) + + // run test + got := WithContext(context.Background(), _engine) + + if !reflect.DeepEqual(got, want) { + t.Errorf("WithContext is %v, want %v", got, want) + } +} + +func TestExecutor_WithGinContext(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _engine, err := linux.New( + linux.WithBuild(_build), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + want := new(gin.Context) + want.Set(key, _engine) + + // run test + got := new(gin.Context) + WithGinContext(got, _engine) + + if !reflect.DeepEqual(got, want) { + t.Errorf("WithGinContext is %v, want %v", got, want) + } +} diff --git a/executor/doc.go b/executor/doc.go new file mode 100644 index 00000000..b17464e1 --- /dev/null +++ b/executor/doc.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package executor provides the ability for Vela to +// integrate with different supported operating +// systems. +// +// Usage: +// +// import "github.com/go-vela/worker/executor" +package executor diff --git a/executor/engine.go b/executor/engine.go new file mode 100644 index 00000000..0fbd4c88 --- /dev/null +++ b/executor/engine.go @@ -0,0 +1,110 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "context" + "sync" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Engine represents the interface for Vela integrating +// with the different supported operating systems. +type Engine interface { + + // Engine Interface Functions + + // Driver defines a function that outputs + // the configured executor driver. + Driver() string + + // API interface functions + + // GetBuild defines a function for the API + // that gets the current build in execution. + GetBuild() (*library.Build, error) + // GetPipeline defines a function for the API + // that gets the current pipeline in execution. + GetPipeline() (*pipeline.Build, error) + // GetRepo defines a function for the API + // that gets the current repo in execution. + GetRepo() (*library.Repo, error) + // CancelBuild defines a function for the API + // that Cancels the current build in execution. + CancelBuild() (*library.Build, error) + + // Build Engine interface functions + + // CreateBuild defines a function that + // configures the build for execution. + CreateBuild(context.Context) error + // PlanBuild defines a function that + // handles the resource initialization process + // for the build. + PlanBuild(context.Context) error + // AssembleBuild defines a function that + // prepares the containers within a build + // for execution. + AssembleBuild(context.Context) error + // ExecBuild defines a function that + // runs a pipeline for a build. + ExecBuild(context.Context) error + // DestroyBuild defines a function that + // cleans up the build after execution. + DestroyBuild(context.Context) error + + // Service Engine Interface Functions + + // CreateService defines a function that + // configures the service for execution. + CreateService(context.Context, *pipeline.Container) error + // PlanService defines a function that + // prepares the service for execution. + PlanService(context.Context, *pipeline.Container) error + // ExecService defines a function that + // runs a service. + ExecService(context.Context, *pipeline.Container) error + // StreamService defines a function that + // tails the output for a service. + StreamService(context.Context, *pipeline.Container) error + // DestroyService defines a function that + // cleans up the service after execution. + DestroyService(context.Context, *pipeline.Container) error + + // Stage Engine Interface Functions + + // CreateStage defines a function that + // configures the stage for execution. + CreateStage(context.Context, *pipeline.Stage) error + // PlanStage defines a function that + // prepares the stage for execution. + PlanStage(context.Context, *pipeline.Stage, *sync.Map) error + // ExecStage defines a function that + // runs a stage. + ExecStage(context.Context, *pipeline.Stage, *sync.Map) error + // DestroyStage defines a function that + // cleans up the stage after execution. + DestroyStage(context.Context, *pipeline.Stage) error + + // Step Engine Interface Functions + + // CreateStep defines a function that + // configures the step for execution. + CreateStep(context.Context, *pipeline.Container) error + // PlanStep defines a function that + // prepares the step for execution. + PlanStep(context.Context, *pipeline.Container) error + // ExecStep defines a function that + // runs a step. + ExecStep(context.Context, *pipeline.Container) error + // StreamStep defines a function that + // tails the output for a step. + StreamStep(context.Context, *pipeline.Container) error + // DestroyStep defines a function that + // cleans up the step after execution. + DestroyStep(context.Context, *pipeline.Container) error +} diff --git a/executor/executor.go b/executor/executor.go new file mode 100644 index 00000000..1fd80458 --- /dev/null +++ b/executor/executor.go @@ -0,0 +1,60 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "fmt" + + "github.com/go-vela/types/constants" + + "github.com/sirupsen/logrus" +) + +// nolint: godot // ignore period at end for comment ending in a list +// +// New creates and returns a Vela engine capable of +// integrating with the configured executor. +// +// Currently the following executors are supported: +// +// * linux +// * local +func New(s *Setup) (Engine, error) { + // validate the setup being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/executor?tab=doc#Setup.Validate + err := s.Validate() + if err != nil { + return nil, err + } + + logrus.Debug("creating executor engine from setup") + // process the executor driver being provided + switch s.Driver { + case constants.DriverDarwin: + // handle the Darwin executor driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/executor?tab=doc#Setup.Darwin + return s.Darwin() + case constants.DriverLinux: + // handle the Linux executor driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/executor?tab=doc#Setup.Linux + return s.Linux() + case constants.DriverLocal: + // handle the Local executor driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/executor?tab=doc#Setup.Local + return s.Local() + case constants.DriverWindows: + // handle the Windows executor driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/executor?tab=doc#Setup.Windows + return s.Windows() + default: + // handle an invalid executor driver being provided + return nil, fmt.Errorf("invalid executor driver provided: %s", s.Driver) + } +} diff --git a/executor/executor_test.go b/executor/executor_test.go new file mode 100644 index 00000000..ad55ff88 --- /dev/null +++ b/executor/executor_test.go @@ -0,0 +1,279 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/worker/executor/linux" + "github.com/go-vela/worker/executor/local" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestExecutor_New(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _linux, err := linux.New( + linux.WithBuild(_build), + linux.WithHostname("localhost"), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + linux.WithVersion("v1.0.0"), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + _local, err := local.New( + local.WithBuild(_build), + local.WithHostname("localhost"), + local.WithPipeline(_pipeline), + local.WithRepo(_repo), + local.WithRuntime(_runtime), + local.WithUser(_user), + local.WithVelaClient(_client), + local.WithVersion("v1.0.0"), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + setup *Setup + want Engine + }{ + { + failure: true, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverDarwin, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: nil, + }, + { + failure: false, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: _linux, + }, + { + failure: false, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: "local", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: _local, + }, + { + failure: true, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverWindows, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: nil, + }, + { + failure: true, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: "invalid", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: nil, + }, + { + failure: true, + setup: &Setup{ + Build: _build, + Client: _client, + Driver: "", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + }, + want: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := New(test.setup) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("New is %v, want %v", got, test.want) + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("New is %v, want %v", got, test.want) + } + } +} + +// setup global variables used for testing. +var ( + _build = &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + + _pipeline = &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Steps: pipeline.ContainerSlice{ + { + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + { + ID: "step_github_octocat_1_clone", + Directory: "/home/github/octocat", + Image: "target/vela-git:v0.3.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + { + ID: "step_github_octocat_1_echo", + Commands: []string{"echo hello"}, + Directory: "/home/github/octocat", + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + } + + _repo = &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } + + _user = &library.User{ + ID: vela.Int64(1), + Name: vela.String("octocat"), + Token: vela.String("superSecretToken"), + Hash: vela.String("MzM4N2MzMDAtNmY4Mi00OTA5LWFhZDAtNWIzMTlkNTJkODMy"), + Favorites: vela.Strings([]string{"github/octocat"}), + Active: vela.Bool(true), + Admin: vela.Bool(false), + } +) diff --git a/executor/flags.go b/executor/flags.go new file mode 100644 index 00000000..f29e4549 --- /dev/null +++ b/executor/flags.go @@ -0,0 +1,45 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "github.com/go-vela/types/constants" + + "github.com/urfave/cli/v2" +) + +// Flags represents all supported command line +// interface (CLI) flags for the executor. +// +// https://pkg.go.dev/github.com/urfave/cli?tab=doc#Flag +var Flags = []cli.Flag{ + + // Logging Flags + + &cli.StringFlag{ + EnvVars: []string{"VELA_LOG_FORMAT", "EXECUTOR_LOG_FORMAT"}, + FilePath: "/vela/executor/log_format", + Name: "executor.log.format", + Usage: "format of logs to output", + Value: "json", + }, + &cli.StringFlag{ + EnvVars: []string{"VELA_LOG_LEVEL", "EXECUTOR_LOG_LEVEL"}, + FilePath: "/vela/executor/log_level", + Name: "executor.log.level", + Usage: "level of logs to output", + Value: "info", + }, + + // Executor Flags + + &cli.StringFlag{ + EnvVars: []string{"VELA_EXECUTOR_DRIVER", "EXECUTOR_DRIVER"}, + FilePath: "/vela/executor/driver", + Name: "executor.driver", + Usage: "driver to be used for the executor", + Value: constants.DriverLinux, + }, +} diff --git a/executor/linux/api.go b/executor/linux/api.go new file mode 100644 index 00000000..8c09a521 --- /dev/null +++ b/executor/linux/api.go @@ -0,0 +1,199 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "fmt" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/service" + "github.com/go-vela/worker/internal/step" +) + +// GetBuild gets the current build in execution. +func (c *client) GetBuild() (*library.Build, error) { + // check if the build resource is available + if c.build == nil { + return nil, fmt.Errorf("build resource not found") + } + + return c.build, nil +} + +// GetPipeline gets the current pipeline in execution. +func (c *client) GetPipeline() (*pipeline.Build, error) { + // check if the pipeline resource is available + if c.pipeline == nil { + return nil, fmt.Errorf("pipeline resource not found") + } + + return c.pipeline, nil +} + +// GetRepo gets the current repo in execution. +func (c *client) GetRepo() (*library.Repo, error) { + // check if the repo resource is available + if c.repo == nil { + return nil, fmt.Errorf("repo resource not found") + } + + return c.repo, nil +} + +// CancelBuild cancels the current build in execution. +// nolint: funlen // process of going through steps/services/stages is verbose and could be funcitonalized +func (c *client) CancelBuild() (*library.Build, error) { + // get the current build from the client + b, err := c.GetBuild() + if err != nil { + return nil, err + } + + // set the build status to canceled + b.SetStatus(constants.StatusCanceled) + + // get the current pipeline from the client + pipeline, err := c.GetPipeline() + if err != nil { + return nil, err + } + + // cancel non successful services + // nolint: dupl // false positive, steps/services are different + for _, _service := range pipeline.Services { + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + s, err := service.Load(_service, &c.services) + if err != nil { + // create the library service object + s = new(library.Service) + s.SetName(_service.Name) + s.SetNumber(_service.Number) + s.SetImage(_service.Image) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if service state was not terminal, set it as canceled + switch s.GetStatus() { + // service is in a error state + case constants.StatusError: + break + // service is in a failure state + case constants.StatusFailure: + break + // service is in a killed state + case constants.StatusKilled: + break + // service is in a success state + case constants.StatusSuccess: + break + default: + // update the service with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a service to a map + c.services.Store(_service.ID, s) + } + } + + // cancel non successful steps + // nolint: dupl // false positive, steps/services are different + for _, _step := range pipeline.Steps { + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + s, err := step.Load(_step, &c.steps) + if err != nil { + // create the library step object + s = new(library.Step) + s.SetName(_step.Name) + s.SetNumber(_step.Number) + s.SetImage(_step.Image) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if step state was not terminal, set it as canceled + switch s.GetStatus() { + // step is in a error state + case constants.StatusError: + break + // step is in a failure state + case constants.StatusFailure: + break + // step is in a killed state + case constants.StatusKilled: + break + // step is in a success state + case constants.StatusSuccess: + break + default: + // update the step with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a step to a map + c.steps.Store(_step.ID, s) + } + } + + // cancel non successful stages + for _, _stage := range pipeline.Stages { + // cancel non successful steps for that stage + for _, _step := range _stage.Steps { + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + s, err := step.Load(_step, &c.steps) + if err != nil { + // create the library step object + s = new(library.Step) + s.SetName(_step.Name) + s.SetNumber(_step.Number) + s.SetImage(_step.Image) + s.SetStage(_stage.Name) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if stage state was not terminal, set it as canceled + switch s.GetStatus() { + // stage is in a error state + case constants.StatusError: + break + // stage is in a failure state + case constants.StatusFailure: + break + // stage is in a killed state + case constants.StatusKilled: + break + // stage is in a success state + case constants.StatusSuccess: + break + default: + // update the step with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a step to a map + c.steps.Store(_step.ID, s) + } + } + } + + err = c.DestroyBuild(context.Background()) + if err != nil { + c.logger.Errorf("unable to destroy build: %v", err) + } + + return b, nil +} diff --git a/executor/linux/api_test.go b/executor/linux/api_test.go new file mode 100644 index 00000000..a60d0f11 --- /dev/null +++ b/executor/linux/api_test.go @@ -0,0 +1,154 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "reflect" + "testing" +) + +func TestLinux_GetBuild(t *testing.T) { + // setup types + _build := testBuild() + + _engine, err := New( + WithBuild(_build), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetBuild() + + if test.failure { + if err == nil { + t.Errorf("GetBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetBuild returned err: %v", err) + } + + if !reflect.DeepEqual(got, _build) { + t.Errorf("GetBuild is %v, want %v", got, _build) + } + } +} + +func TestLinux_GetPipeline(t *testing.T) { + // setup types + _steps := testSteps() + + _engine, err := New( + WithPipeline(_steps), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetPipeline() + + if test.failure { + if err == nil { + t.Errorf("GetPipeline should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetPipeline returned err: %v", err) + } + + if !reflect.DeepEqual(got, _steps) { + t.Errorf("GetPipeline is %v, want %v", got, _steps) + } + } +} + +func TestLinux_GetRepo(t *testing.T) { + // setup types + _repo := testRepo() + + _engine, err := New( + WithRepo(_repo), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetRepo() + + if test.failure { + if err == nil { + t.Errorf("GetRepo should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetRepo returned err: %v", err) + } + + if !reflect.DeepEqual(got, _repo) { + t.Errorf("GetRepo is %v, want %v", got, _repo) + } + } +} diff --git a/executor/linux/build.go b/executor/linux/build.go new file mode 100644 index 00000000..9cc36d87 --- /dev/null +++ b/executor/linux/build.go @@ -0,0 +1,581 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "encoding/json" + "fmt" + "sync" + "time" + + "golang.org/x/sync/errgroup" + + "github.com/go-vela/types/constants" + "github.com/go-vela/worker/internal/build" + "github.com/go-vela/worker/internal/step" +) + +// CreateBuild configures the build for execution. +func (c *client) CreateBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + + // update the build fields + c.build.SetStatus(constants.StatusRunning) + c.build.SetStarted(time.Now().UTC().Unix()) + c.build.SetHost(c.Hostname) + c.build.SetDistribution(c.Driver()) + c.build.SetRuntime(c.Runtime.Driver()) + + c.logger.Info("uploading build state") + // send API call to update the build + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update + c.build, _, c.err = c.Vela.Build.Update(c.repo.GetOrg(), c.repo.GetName(), c.build) + if c.err != nil { + return fmt.Errorf("unable to upload build state: %v", c.err) + } + + // setup the runtime build + c.err = c.Runtime.SetupBuild(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to setup build %s: %w", c.pipeline.ID, c.err) + } + + // load the init step from the pipeline + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadInit + c.init, c.err = step.LoadInit(c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to load init step from pipeline: %w", c.err) + } + + c.logger.Infof("creating %s step", c.init.Name) + // create the step + c.err = c.CreateStep(ctx, c.init) + if c.err != nil { + return fmt.Errorf("unable to create %s step: %w", c.init.Name, c.err) + } + + c.logger.Infof("planning %s step", c.init.Name) + // plan the step + c.err = c.PlanStep(ctx, c.init) + if c.err != nil { + return fmt.Errorf("unable to plan %s step: %w", c.init.Name, c.err) + } + + return c.err +} + +// PlanBuild prepares the build for execution. +// +// nolint: funlen // ignore function length due to comments and logging messages +func (c *client) PlanBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + + // load the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _init, err := step.Load(c.init, &c.steps) + if err != nil { + return err + } + + // load the logs for the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadLogs + _log, err := step.LoadLogs(c.init, &c.stepLogs) + if err != nil { + return err + } + + // defer taking a snapshot of the init step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#SnapshotInit + defer func() { step.SnapshotInit(c.init, c.build, c.Vela, c.logger, c.repo, _init, _log) }() + + c.logger.Info("creating network") + // create the runtime network for the pipeline + c.err = c.Runtime.CreateNetwork(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to create network: %w", c.err) + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Inspecting runtime network...\n")) + + // inspect the runtime network for the pipeline + network, err := c.Runtime.InspectNetwork(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect network: %w", err) + } + + // update the init log with network information + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(network) + + c.logger.Info("creating volume") + // create the runtime volume for the pipeline + c.err = c.Runtime.CreateVolume(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to create volume: %w", c.err) + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Inspecting runtime volume...\n")) + + // inspect the runtime volume for the pipeline + volume, err := c.Runtime.InspectVolume(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect volume: %w", err) + } + + // update the init log with volume information + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(volume) + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Pulling secrets...\n")) + + // iterate through each secret provided in the pipeline + for _, secret := range c.pipeline.Secrets { + // ignore pulling secrets coming from plugins + if !secret.Origin.Empty() { + continue + } + + c.logger.Infof("pulling %s %s secret %s", secret.Engine, secret.Type, secret.Name) + + s, err := c.secret.pull(secret) + if err != nil { + c.err = err + return fmt.Errorf("unable to pull secrets: %w", err) + } + + _log.AppendData([]byte( + fmt.Sprintf("$ vela view secret --secret.engine %s --secret.type %s --org %s --repo %s --name %s \n", + secret.Engine, secret.Type, s.GetOrg(), s.GetRepo(), s.GetName()))) + + sRaw, err := json.MarshalIndent(s.Sanitize(), "", " ") + if err != nil { + c.err = err + return fmt.Errorf("unable to decode secret: %w", err) + } + + _log.AppendData(append(sRaw, "\n"...)) + + // add secret to the map + c.Secrets[secret.Name] = s + } + + return nil +} + +// AssembleBuild prepares the containers within a build for execution. +// +// nolint: funlen // ignore function length due to comments and logging messages +func (c *client) AssembleBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + + // load the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _init, err := step.Load(c.init, &c.steps) + if err != nil { + return err + } + + // load the logs for the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadLogs + _log, err := step.LoadLogs(c.init, &c.stepLogs) + if err != nil { + return err + } + + // defer an upload of the init step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Upload + defer func() { step.Upload(c.init, c.build, c.Vela, c.logger, c.repo, _init) }() + + defer func() { + c.logger.Infof("uploading %s step logs", c.init.Name) + // send API call to update the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), c.init.Number, _log) + if err != nil { + c.logger.Errorf("unable to upload %s logs: %v", c.init.Name, err) + } + }() + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Pulling service images...\n")) + + // create the services for the pipeline + for _, s := range c.pipeline.Services { + // TODO: remove this; but we need it for tests + s.Detach = true + + c.logger.Infof("creating %s service", s.Name) + // create the service + c.err = c.CreateService(ctx, s) + if c.err != nil { + return fmt.Errorf("unable to create %s service: %w", s.Name, c.err) + } + + c.logger.Infof("inspecting %s service", s.Name) + // inspect the service image + image, err := c.Runtime.InspectImage(ctx, s) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect %s service: %w", s.Name, err) + } + + // update the init log with service image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(image) + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Pulling stage images...\n")) + + // create the stages for the pipeline + for _, s := range c.pipeline.Stages { + // TODO: remove hardcoded reference + // + // nolint: goconst // ignore making a constant for now + if s.Name == "init" { + continue + } + + c.logger.Infof("creating %s stage", s.Name) + // create the stage + c.err = c.CreateStage(ctx, s) + if c.err != nil { + return fmt.Errorf("unable to create %s stage: %w", s.Name, c.err) + } + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Pulling step images...\n")) + + // create the steps for the pipeline + for _, s := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if s.Name == "init" { + continue + } + + c.logger.Infof("creating %s step", s.Name) + // create the step + c.err = c.CreateStep(ctx, s) + if c.err != nil { + return fmt.Errorf("unable to create %s step: %w", s.Name, c.err) + } + + c.logger.Infof("inspecting %s step", s.Name) + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, s) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect %s step: %w", s.Name, c.err) + } + + // update the init log with step image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(image) + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Pulling secret images...\n")) + + // create the secrets for the pipeline + for _, s := range c.pipeline.Secrets { + // skip over non-plugin secrets + if s.Origin.Empty() { + continue + } + + c.logger.Infof("creating %s secret", s.Origin.Name) + // create the service + c.err = c.secret.create(ctx, s.Origin) + if c.err != nil { + return fmt.Errorf("unable to create %s secret: %w", s.Origin.Name, c.err) + } + + c.logger.Infof("inspecting %s secret", s.Origin.Name) + // inspect the service image + image, err := c.Runtime.InspectImage(ctx, s.Origin) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect %s secret: %w", s.Origin.Name, err) + } + + // update the init log with secret image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(image) + } + + // inspect the runtime build (eg a kubernetes pod) for the pipeline + buildOutput, err := c.Runtime.InspectBuild(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect build: %w", err) + } + + if len(buildOutput) > 0 { + // update the init log with progress + // (an empty value allows the runtime to opt out of providing this) + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(buildOutput) + } + + // assemble runtime build just before any containers execute + c.err = c.Runtime.AssembleBuild(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to assemble runtime build %s: %w", c.pipeline.ID, c.err) + } + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte("> Executing secret images...\n")) + + c.logger.Info("executing secret images") + // execute the secret + c.err = c.secret.exec(ctx, &c.pipeline.Secrets) + if c.err != nil { + return fmt.Errorf("unable to execute secret: %w", c.err) + } + + return c.err +} + +// ExecBuild runs a pipeline for a build. +// +// nolint: funlen // ignore function length due to comments and log messages +func (c *client) ExecBuild(ctx context.Context) error { + // defer an upload of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Upload + defer func() { build.Upload(c.build, c.Vela, c.err, c.logger, c.repo) }() + + // execute the services for the pipeline + for _, _service := range c.pipeline.Services { + c.logger.Infof("planning %s service", _service.Name) + // plan the service + c.err = c.PlanService(ctx, _service) + if c.err != nil { + return fmt.Errorf("unable to plan service: %w", c.err) + } + + c.logger.Infof("executing %s service", _service.Name) + // execute the service + c.err = c.ExecService(ctx, _service) + if c.err != nil { + return fmt.Errorf("unable to execute service: %w", c.err) + } + } + + // execute the steps for the pipeline + for _, _step := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + + // check if the step should be skipped + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip + if step.Skip(_step, c.build, c.repo) { + continue + } + + c.logger.Infof("planning %s step", _step.Name) + // plan the step + c.err = c.PlanStep(ctx, _step) + if c.err != nil { + return fmt.Errorf("unable to plan step: %w", c.err) + } + + c.logger.Infof("executing %s step", _step.Name) + // execute the step + c.err = c.ExecStep(ctx, _step) + if c.err != nil { + return fmt.Errorf("unable to execute step: %w", c.err) + } + } + + // create an error group with the context for each stage + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + stages, stageCtx := errgroup.WithContext(ctx) + + // create a map to track the progress of each stage + stageMap := new(sync.Map) + + // iterate through each stage in the pipeline + for _, _stage := range c.pipeline.Stages { + // TODO: remove hardcoded reference + if _stage.Name == "init" { + continue + } + + // https://golang.org/doc/faq#closures_and_goroutines + stage := _stage + + // create a new channel for each stage in the map + stageMap.Store(stage.Name, make(chan error)) + + // spawn errgroup routine for the stage + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Go + stages.Go(func() error { + c.logger.Infof("planning %s stage", stage.Name) + // plan the stage + c.err = c.PlanStage(stageCtx, stage, stageMap) + if c.err != nil { + return fmt.Errorf("unable to plan stage: %w", c.err) + } + + c.logger.Infof("executing %s stage", stage.Name) + // execute the stage + c.err = c.ExecStage(stageCtx, stage, stageMap) + if c.err != nil { + return fmt.Errorf("unable to execute stage: %w", c.err) + } + + return nil + }) + } + + c.logger.Debug("waiting for stages completion") + // wait for the stages to complete or return an error + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait + c.err = stages.Wait() + if c.err != nil { + return fmt.Errorf("unable to wait for stages: %v", c.err) + } + + return c.err +} + +// DestroyBuild cleans up the build after execution. +func (c *client) DestroyBuild(ctx context.Context) error { + var err error + + defer func() { + c.logger.Info("deleting runtime build") + // remove the runtime build for the pipeline + err = c.Runtime.RemoveBuild(ctx, c.pipeline) + if err != nil { + c.logger.Errorf("unable to remove runtime build: %v", err) + } + }() + + // destroy the steps for the pipeline + for _, _step := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + + c.logger.Infof("destroying %s step", _step.Name) + // destroy the step + err = c.DestroyStep(ctx, _step) + if err != nil { + c.logger.Errorf("unable to destroy step: %v", err) + } + } + + // destroy the stages for the pipeline + for _, _stage := range c.pipeline.Stages { + // TODO: remove hardcoded reference + if _stage.Name == "init" { + continue + } + + c.logger.Infof("destroying %s stage", _stage.Name) + // destroy the stage + err = c.DestroyStage(ctx, _stage) + if err != nil { + c.logger.Errorf("unable to destroy stage: %v", err) + } + } + + // destroy the services for the pipeline + for _, _service := range c.pipeline.Services { + c.logger.Infof("destroying %s service", _service.Name) + // destroy the service + err = c.DestroyService(ctx, _service) + if err != nil { + c.logger.Errorf("unable to destroy service: %v", err) + } + } + + // destroy the secrets for the pipeline + for _, _secret := range c.pipeline.Secrets { + // skip over non-plugin secrets + if _secret.Origin.Empty() { + continue + } + + c.logger.Infof("destroying %s secret", _secret.Name) + // destroy the secret + err = c.secret.destroy(ctx, _secret.Origin) + if err != nil { + c.logger.Errorf("unable to destroy secret: %v", err) + } + } + + c.logger.Info("deleting volume") + // remove the runtime volume for the pipeline + err = c.Runtime.RemoveVolume(ctx, c.pipeline) + if err != nil { + c.logger.Errorf("unable to remove volume: %v", err) + } + + c.logger.Info("deleting network") + // remove the runtime network for the pipeline + err = c.Runtime.RemoveNetwork(ctx, c.pipeline) + if err != nil { + c.logger.Errorf("unable to remove network: %v", err) + } + + return err +} diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go new file mode 100644 index 00000000..ad937865 --- /dev/null +++ b/executor/linux/build_test.go @@ -0,0 +1,573 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "flag" + "net/http/httptest" + "testing" + + "github.com/go-vela/compiler/compiler/native" + "github.com/go-vela/mock/server" + "github.com/urfave/cli/v2" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" +) + +func TestLinux_CreateBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + build *library.Build + pipeline string + }{ + { // basic secrets pipeline + failure: false, + build: _build, + pipeline: "testdata/build/secrets/basic.yml", + }, + { // basic services pipeline + failure: false, + build: _build, + pipeline: "testdata/build/services/basic.yml", + }, + { // basic steps pipeline + failure: false, + build: _build, + pipeline: "testdata/build/steps/basic.yml", + }, + { // basic stages pipeline + failure: false, + build: _build, + pipeline: "testdata/build/stages/basic.yml", + }, + { // steps pipeline with empty build + failure: true, + build: new(library.Build), + pipeline: "testdata/build/steps/basic.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(test.build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("CreateBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + } +} + +func TestLinux_PlanBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic secrets pipeline + failure: false, + pipeline: "testdata/build/secrets/basic.yml", + }, + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.PlanBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("PlanBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanBuild returned err: %v", err) + } + } +} + +func TestLinux_AssembleBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic secrets pipeline + failure: false, + pipeline: "testdata/build/secrets/basic.yml", + }, + { // secrets pipeline with image not found + failure: true, + pipeline: "testdata/build/secrets/img_notfound.yml", + }, + { // secrets pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/secrets/img_ignorenotfound.yml", + }, + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with image not found + failure: true, + pipeline: "testdata/build/services/img_notfound.yml", + }, + { // services pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/services/img_ignorenotfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with image not found + failure: true, + pipeline: "testdata/build/steps/img_notfound.yml", + }, + { // steps pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/steps/img_ignorenotfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with image not found + failure: true, + pipeline: "testdata/build/stages/img_notfound.yml", + }, + { // stages pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/stages/img_ignorenotfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.AssembleBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + } +} + +func TestLinux_ExecBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with image not found + failure: true, + pipeline: "testdata/build/services/img_notfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with image not found + failure: true, + pipeline: "testdata/build/steps/img_notfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with image not found + failure: true, + pipeline: "testdata/build/stages/img_notfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + // TODO: hack - remove this + // + // When using our Docker mock we default the list of + // Docker images that have privileged access. One of + // these images is target/vela-git which is injected + // by the compiler into every build. + // + // The problem this causes is that we haven't called + // all the necessary functions we do in a real world + // scenario to ensure we can run privileged images. + // + // This is the necessary function to create the + // runtime host config so we can run images + // in a privileged fashion. + err = _runtime.CreateVolume(context.Background(), _pipeline) + if err != nil { + t.Errorf("unable to create runtime volume: %w", err) + } + + // TODO: hack - remove this + // + // When calling CreateBuild(), it will automatically set the + // test build object to a status of `created`. This happens + // because we use a mock for the go-vela/server in our tests + // which only returns dummy based responses. + // + // The problem this causes is that our container.Execute() + // function isn't setup to handle builds in a `created` state. + // + // In a real world scenario, we never would have a build + // in this state when we call ExecBuild() because the + // go-vela/server has logic to set it to an expected state. + _engine.build.SetStatus("running") + + err = _engine.ExecBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + } + + continue + } + + if err != nil { + t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) + } + } +} + +func TestLinux_DestroyBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic secrets pipeline + failure: false, + pipeline: "testdata/build/secrets/basic.yml", + }, + { // secrets pipeline with name not found + failure: false, + pipeline: "testdata/build/secrets/name_notfound.yml", + }, + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with name not found + failure: false, + pipeline: "testdata/build/services/name_notfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with name not found + failure: false, + pipeline: "testdata/build/steps/name_notfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with name not found + failure: false, + pipeline: "testdata/build/stages/name_notfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.DestroyBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("DestroyBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyBuild returned err: %v", err) + } + } +} diff --git a/executor/linux/doc.go b/executor/linux/doc.go new file mode 100644 index 00000000..cd16e144 --- /dev/null +++ b/executor/linux/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package linux provides the ability for Vela to +// integrate with a Linux as an operating system. +// +// Usage: +// +// import "github.com/go-vela/worker/executor/linux" +package linux diff --git a/executor/linux/driver.go b/executor/linux/driver.go new file mode 100644 index 00000000..a1d80eb5 --- /dev/null +++ b/executor/linux/driver.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import "github.com/go-vela/types/constants" + +// Driver outputs the configured executor driver. +func (c *client) Driver() string { + return constants.DriverLinux +} diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go new file mode 100644 index 00000000..a1e826b3 --- /dev/null +++ b/executor/linux/driver_test.go @@ -0,0 +1,56 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + "github.com/go-vela/mock/server" + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" +) + +func TestLinux_Driver(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want := constants.DriverLinux + + _engine, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run tes + got := _engine.Driver() + + if !reflect.DeepEqual(got, want) { + t.Errorf("Driver is %v, want %v", got, want) + } +} diff --git a/executor/linux/linux.go b/executor/linux/linux.go new file mode 100644 index 00000000..80d020e8 --- /dev/null +++ b/executor/linux/linux.go @@ -0,0 +1,86 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "sync" + + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +type ( + // client manages communication with the pipeline resources. + client struct { + Vela *vela.Client + Runtime runtime.Engine + Secrets map[string]*library.Secret + Hostname string + Version string + + // clients for build actions + secret *secretSvc + + // private fields + init *pipeline.Container + logger *logrus.Entry + build *library.Build + pipeline *pipeline.Build + repo *library.Repo + // nolint: structcheck,unused // ignore false positives + secrets sync.Map + services sync.Map + serviceLogs sync.Map + steps sync.Map + stepLogs sync.Map + user *library.User + err error + } + + // nolint: structcheck // ignore false positive + svc struct { + client *client + } +) + +// New returns an Executor implementation that integrates with a Linux instance. +// +// nolint: golint // ignore unexported type as it is intentional +func New(opts ...Opt) (*client, error) { + // create new Linux client + c := new(client) + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger + logger := logrus.StandardLogger() + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + c.logger = logrus.NewEntry(logger) + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + // instantiate map for non-plugin secrets + c.Secrets = make(map[string]*library.Secret) + + // instantiate all client services + c.secret = &secretSvc{client: c} + + return c, nil +} diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go new file mode 100644 index 00000000..073ce616 --- /dev/null +++ b/executor/linux/linux_test.go @@ -0,0 +1,245 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + "github.com/go-vela/types" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLinux_New(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + build *library.Build + }{ + { + failure: false, + build: testBuild(), + }, + { + failure: true, + build: nil, + }, + } + + // run tests + for _, test := range tests { + _, err := New( + WithBuild(test.build), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + } +} + +// testBuild is a test helper function to create a Build +// type with all fields set to a fake value. +func testBuild() *library.Build { + return &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } +} + +// testRepo is a test helper function to create a Repo +// type with all fields set to a fake value. +func testRepo() *library.Repo { + return &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } +} + +// testUser is a test helper function to create a User +// type with all fields set to a fake value. +func testUser() *library.User { + return &library.User{ + ID: vela.Int64(1), + Name: vela.String("octocat"), + Token: vela.String("superSecretToken"), + Hash: vela.String("MzM4N2MzMDAtNmY4Mi00OTA5LWFhZDAtNWIzMTlkNTJkODMy"), + Favorites: vela.Strings([]string{"github/octocat"}), + Active: vela.Bool(true), + Admin: vela.Bool(false), + } +} + +// testUser is a test helper function to create a metadata +// type with all fields set to a fake value. +func testMetadata() *types.Metadata { + return &types.Metadata{ + Database: &types.Database{ + Driver: "foo", + Host: "foo", + }, + Queue: &types.Queue{ + Channel: "foo", + Driver: "foo", + Host: "foo", + }, + Source: &types.Source{ + Driver: "foo", + Host: "foo", + }, + Vela: &types.Vela{ + Address: "foo", + WebAddress: "foo", + }, + } +} + +// testSteps is a test helper function to create a steps +// pipeline with fake steps. +func testSteps() *pipeline.Build { + return &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Services: pipeline.ContainerSlice{ + { + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + Steps: pipeline.ContainerSlice{ + { + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + { + ID: "step_github_octocat_1_clone", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.3.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + { + ID: "step_github_octocat_1_echo", + Commands: []string{"echo hello"}, + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + Secrets: pipeline.SecretSlice{ + { + Name: "foo", + Key: "github/octocat/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + { + Name: "foo", + Key: "github/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + { + Name: "foo", + Key: "github/octokitties/foo", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, + } +} diff --git a/executor/linux/opts.go b/executor/linux/opts.go new file mode 100644 index 00000000..179cafdd --- /dev/null +++ b/executor/linux/opts.go @@ -0,0 +1,179 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "fmt" + + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +// Opt represents a configuration option to initialize the client. +type Opt func(*client) error + +// WithBuild sets the library build in the client. +func WithBuild(b *library.Build) Opt { + logrus.Trace("configuring build in linux client") + + return func(c *client) error { + // check if the build provided is empty + if b == nil { + return fmt.Errorf("empty build provided") + } + + // update engine logger with build metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + c.logger = c.logger.WithField("build", b.GetNumber()) + + // set the build in the client + c.build = b + + return nil + } +} + +// WithHostname sets the hostname in the client. +func WithHostname(hostname string) Opt { + logrus.Trace("configuring hostname in linux client") + + return func(c *client) error { + // check if a hostname is provided + if len(hostname) == 0 { + // default the hostname to localhost + hostname = "localhost" + } + + // update engine logger with host metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + c.logger = c.logger.WithField("host", hostname) + + // set the hostname in the client + c.Hostname = hostname + + return nil + } +} + +// WithPipeline sets the pipeline build in the client. +func WithPipeline(p *pipeline.Build) Opt { + logrus.Trace("configuring pipeline in linux client") + + return func(c *client) error { + // check if the pipeline provided is empty + if p == nil { + return fmt.Errorf("empty pipeline provided") + } + + // set the pipeline in the client + c.pipeline = p + + return nil + } +} + +// WithRepo sets the library repo in the client. +func WithRepo(r *library.Repo) Opt { + logrus.Trace("configuring repo in linux client") + + return func(c *client) error { + // check if the repo provided is empty + if r == nil { + return fmt.Errorf("empty repo provided") + } + + // update engine logger with repo metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + c.logger = c.logger.WithField("repo", r.GetFullName()) + + // set the repo in the client + c.repo = r + + return nil + } +} + +// WithRuntime sets the runtime engine in the client. +func WithRuntime(r runtime.Engine) Opt { + logrus.Trace("configuring runtime in linux client") + + return func(c *client) error { + // check if the runtime provided is empty + if r == nil { + return fmt.Errorf("empty runtime provided") + } + + // set the runtime in the client + c.Runtime = r + + return nil + } +} + +// WithUser sets the library user in the client. +func WithUser(u *library.User) Opt { + logrus.Trace("configuring user in linux client") + + return func(c *client) error { + // check if the user provided is empty + if u == nil { + return fmt.Errorf("empty user provided") + } + + // update engine logger with user metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + c.logger = c.logger.WithField("user", u.GetName()) + + // set the user in the client + c.user = u + + return nil + } +} + +// WithVelaClient sets the Vela client in the client. +func WithVelaClient(cli *vela.Client) Opt { + logrus.Trace("configuring Vela client in linux client") + + return func(c *client) error { + // check if the Vela client provided is empty + if cli == nil { + return fmt.Errorf("empty Vela client provided") + } + + // set the Vela client in the client + c.Vela = cli + + return nil + } +} + +// WithVersion sets the version in the client. +func WithVersion(version string) Opt { + logrus.Trace("configuring version in linux client") + + return func(c *client) error { + // check if a version is provided + if len(version) == 0 { + // default the version to localhost + version = "v0.0.0" + } + + // set the version in the client + c.Version = version + + return nil + } +} diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go new file mode 100644 index 00000000..1894e0d6 --- /dev/null +++ b/executor/linux/opts_test.go @@ -0,0 +1,353 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLinux_Opt_WithBuild(t *testing.T) { + // setup types + _build := testBuild() + + // setup tests + tests := []struct { + failure bool + build *library.Build + }{ + { + failure: false, + build: _build, + }, + { + failure: true, + build: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(test.build), + ) + + if test.failure { + if err == nil { + t.Errorf("WithBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithBuild returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.build, _build) { + t.Errorf("WithBuild is %v, want %v", _engine.build, _build) + } + } +} + +func TestLinux_Opt_WithHostname(t *testing.T) { + // setup tests + tests := []struct { + hostname string + want string + }{ + { + hostname: "vela.worker.localhost", + want: "vela.worker.localhost", + }, + { + hostname: "", + want: "localhost", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithHostname(test.hostname), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Hostname, test.want) { + t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) + } + } +} + +func TestLinux_Opt_WithPipeline(t *testing.T) { + // setup types + _steps := testSteps() + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _steps, + }, + { + failure: true, + pipeline: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithPipeline(test.pipeline), + ) + + if test.failure { + if err == nil { + t.Errorf("WithPipeline should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithPipeline returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.pipeline, _steps) { + t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) + } + } +} + +func TestLinux_Opt_WithRepo(t *testing.T) { + // setup types + _repo := testRepo() + + // setup tests + tests := []struct { + failure bool + repo *library.Repo + }{ + { + failure: false, + repo: _repo, + }, + { + failure: true, + repo: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithRepo(test.repo), + ) + + if test.failure { + if err == nil { + t.Errorf("WithRepo should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithRepo returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.repo, _repo) { + t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) + } + } +} + +func TestLinux_Opt_WithRuntime(t *testing.T) { + // setup types + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + runtime runtime.Engine + }{ + { + failure: false, + runtime: _runtime, + }, + { + failure: true, + runtime: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithRuntime(test.runtime), + ) + + if test.failure { + if err == nil { + t.Errorf("WithRuntime should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithRuntime returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.Runtime, _runtime) { + t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) + } + } +} + +func TestLinux_Opt_WithUser(t *testing.T) { + // setup types + _user := testUser() + + // setup tests + tests := []struct { + failure bool + user *library.User + }{ + { + failure: false, + user: _user, + }, + { + failure: true, + user: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithUser(test.user), + ) + + if test.failure { + if err == nil { + t.Errorf("WithUser should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithUser returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.user, _user) { + t.Errorf("WithUser is %v, want %v", _engine.user, _user) + } + } +} + +func TestLinux_Opt_WithVelaClient(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + // setup tests + tests := []struct { + failure bool + client *vela.Client + }{ + { + failure: false, + client: _client, + }, + { + failure: true, + client: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithVelaClient(test.client), + ) + + if test.failure { + if err == nil { + t.Errorf("WithVelaClient should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithVelaClient returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.Vela, _client) { + t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) + } + } +} + +func TestLinux_Opt_WithVersion(t *testing.T) { + // setup tests + tests := []struct { + version string + want string + }{ + { + version: "v1.0.0", + want: "v1.0.0", + }, + { + version: "", + want: "v0.0.0", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithVersion(test.version), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Version, test.want) { + t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) + } + } +} diff --git a/executor/linux/secret.go b/executor/linux/secret.go new file mode 100644 index 00000000..5db230c5 --- /dev/null +++ b/executor/linux/secret.go @@ -0,0 +1,367 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "bufio" + "bytes" + "context" + "errors" + "fmt" + "strings" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/step" + + "github.com/sirupsen/logrus" +) + +// secretSvc handles communication with secret processes during a build. +type secretSvc svc + +var ( + // ErrUnrecognizedSecretType defines the error type when the + // SecretType provided to the client is unsupported. + ErrUnrecognizedSecretType = errors.New("unrecognized secret type") + + // ErrUnableToRetrieve defines the error type when the + // secret is not able to be retrieved from the server. + ErrUnableToRetrieve = errors.New("unable to retrieve secret") +) + +// create configures the secret plugin for execution. +func (s *secretSvc) create(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with secret metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := s.client.logger.WithField("secret", ctn.Name) + + ctn.Environment["VELA_DISTRIBUTION"] = s.client.build.GetDistribution() + ctn.Environment["BUILD_HOST"] = s.client.build.GetHost() + ctn.Environment["VELA_HOST"] = s.client.build.GetHost() + ctn.Environment["VELA_RUNTIME"] = s.client.build.GetRuntime() + ctn.Environment["VELA_VERSION"] = s.client.Version + + logger.Debug("setting up container") + // setup the runtime container + err := s.client.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + + logger.Debug("injecting secrets") + // inject secrets for container + err = injectSecrets(ctn, s.client.Secrets) + if err != nil { + return err + } + + logger.Debug("substituting container configuration") + // substitute container configuration + err = ctn.Substitute() + if err != nil { + return fmt.Errorf("unable to substitute container configuration") + } + + return nil +} + +// destroy cleans up secret plugin after execution. +func (s *secretSvc) destroy(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with secret metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := s.client.logger.WithField("secret", ctn.Name) + + logger.Debug("inspecting container") + // inspect the runtime container + err := s.client.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + logger.Debug("removing container") + // remove the runtime container + err = s.client.Runtime.RemoveContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} + +// exec runs a secret plugins for a pipeline. +func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { + // stream all the logs to the init step + _init, err := step.Load(s.client.init, &s.client.steps) + if err != nil { + return err + } + + defer func() { + _init.SetFinished(time.Now().UTC().Unix()) + + s.client.logger.Infof("uploading %s step state", _init.GetName()) + // send API call to update the build + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _, _, err = s.client.Vela.Step.Update(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), _init) + if err != nil { + s.client.logger.Errorf("unable to upload init state: %v", err) + } + }() + + // execute the secrets for the pipeline + for _, _secret := range *p { + // skip over non-plugin secrets + if _secret.Origin.Empty() { + continue + } + + // update engine logger with secret metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := s.client.logger.WithField("secret", _secret.Origin.Name) + + logger.Debug("running container") + // run the runtime container + err := s.client.Runtime.RunContainer(ctx, _secret.Origin, s.client.pipeline) + if err != nil { + return err + } + + go func() { + logger.Debug("stream logs for container") + // stream logs from container + err = s.client.secret.stream(ctx, _secret.Origin) + if err != nil { + logger.Error(err) + } + }() + + logger.Debug("waiting for container") + // wait for the runtime container + err = s.client.Runtime.WaitContainer(ctx, _secret.Origin) + if err != nil { + return err + } + + logger.Debug("inspecting container") + // inspect the runtime container + err = s.client.Runtime.InspectContainer(ctx, _secret.Origin) + if err != nil { + return err + } + + // check the step exit code + if _secret.Origin.ExitCode != 0 { + // check if we ignore step failures + if !_secret.Origin.Ruleset.Continue { + // set build status to failure + s.client.build.SetStatus(constants.StatusFailure) + } + + // update the step fields + _init.SetExitCode(_secret.Origin.ExitCode) + _init.SetStatus(constants.StatusFailure) + + return fmt.Errorf("%s container exited with non-zero code", _secret.Origin.Name) + } + + // send API call to update the build + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _, _, err = s.client.Vela.Step.Update(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), _init) + if err != nil { + s.client.logger.Errorf("unable to upload init state: %v", err) + } + } + + return nil +} + +// pull defines a function that pulls the secrets from the server for a given pipeline. +func (s *secretSvc) pull(secret *pipeline.Secret) (*library.Secret, error) { + // nolint: staticcheck // reports the value is never used but we return it + _secret := new(library.Secret) + + switch secret.Type { + // handle repo secrets + case constants.SecretOrg: + org, key, err := secret.ParseOrg(s.client.repo.GetOrg()) + if err != nil { + return nil, err + } + + // send API call to capture the org secret + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SecretService.Get + _secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, "*", key) + if err != nil { + return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err) + } + + secret.Value = _secret.GetValue() + + // handle repo secrets + case constants.SecretRepo: + org, repo, key, err := secret.ParseRepo(s.client.repo.GetOrg(), s.client.repo.GetName()) + if err != nil { + return nil, err + } + + // send API call to capture the repo secret + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SecretService.Get + _secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, repo, key) + if err != nil { + return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err) + } + + secret.Value = _secret.GetValue() + + // handle shared secrets + case constants.SecretShared: + org, team, key, err := secret.ParseShared() + if err != nil { + return nil, err + } + + // send API call to capture the repo secret + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SecretService.Get + _secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, team, key) + if err != nil { + return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err) + } + + secret.Value = _secret.GetValue() + + default: + return nil, fmt.Errorf("%s: %s", ErrUnrecognizedSecretType, secret.Type) + } + + return _secret, nil +} + +// stream tails the output for a secret plugin. +func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { + // stream all the logs to the init step + _log, err := step.LoadLogs(s.client.init, &s.client.stepLogs) + if err != nil { + return err + } + + // update engine logger with secret metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := s.client.logger.WithField("secret", ctn.Name) + + // create new buffer for uploading logs + logs := new(bytes.Buffer) + + defer func() { + // NOTE: Whenever the stream ends we want to ensure + // that this function makes the call to update + // the step logs + logger.Trace(logs.String()) + + // update the existing log with the last bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("uploading logs") + // send API call to update the logs for the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Errorf("unable to upload container logs: %v", err) + } + }() + + logger.Debug("tailing container") + // tail the runtime container + rc, err := s.client.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + + // if we have at least 1000 bytes in our buffer + // + // nolint: gomnd // ignore magic number + if logs.Len() > 1000 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the init step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + // nolint: lll // skip line length due to variable names + _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), s.client.init.Number, _log) + if err != nil { + return err + } + + // flush the buffer of logs + logs.Reset() + } + } + + return scanner.Err() +} + +// TODO: Evaluate pulling this into a "bool" types function for injecting +// +// helper function to check secret whitelist before setting value. +func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error { + // inject secrets for step + for _, _secret := range ctn.Secrets { + logrus.Tracef("looking up secret %s from pipeline secrets", _secret.Source) + // lookup container secret in map + s, ok := m[_secret.Source] + if !ok { + continue + } + + logrus.Tracef("matching secret %s to container %s", _secret.Source, ctn.Name) + // ensure the secret matches with the container + if s.Match(ctn) { + ctn.Environment[strings.ToUpper(_secret.Target)] = s.GetValue() + } + } + + return nil +} + +// escapeNewlineSecrets is a helper function to double-escape escaped newlines, +// double-escaped newlines are resolved to newlines during env substitution. +func escapeNewlineSecrets(m map[string]*library.Secret) { + for i, secret := range m { + // only double-escape secrets that have been manually escaped + if !strings.Contains(secret.GetValue(), "\\\\n") { + s := strings.Replace(secret.GetValue(), "\\n", "\\\n", -1) + m[i].Value = &s + } + } +} diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go new file mode 100644 index 00000000..a1bcd3b6 --- /dev/null +++ b/executor/linux/secret_test.go @@ -0,0 +1,807 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "flag" + "io/ioutil" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/urfave/cli/v2" + + "github.com/go-vela/compiler/compiler/native" + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + + "github.com/google/go-cmp/cmp" +) + +func TestLinux_Secret_create(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + _steps := testSteps() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "not_present", + }, + }, + { + failure: true, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:notfound", + Name: "vault", + Number: 1, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.secret.create(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("create should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("create returned err: %v", err) + } + } +} + +func TestLinux_Secret_delete(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + _steps := testSteps() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _step := new(library.Step) + _step.SetName("clone") + _step.SetNumber(2) + _step.SetStatus(constants.StatusPending) + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + step *library.Step + }{ + { + failure: false, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "always", + }, + step: new(library.Step), + }, + { + failure: false, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 2, + Pull: "always", + }, + step: _step, + }, + { + failure: true, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_notfound", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "notfound", + Number: 2, + Pull: "always", + }, + step: new(library.Step), + }, + { + failure: true, + container: &pipeline.Container{ + ID: "secret_github_octocat_1_ignorenotfound", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "ignorenotfound", + Number: 2, + Pull: "always", + }, + step: new(library.Step), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + _ = _engine.CreateBuild(context.Background()) + + _engine.steps.Store(test.container.ID, test.step) + + err = _engine.secret.destroy(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("destroy should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("destroy returned err: %v", err) + } + } +} + +func TestLinux_Secret_exec(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline string + }{ + { // basic secrets pipeline + failure: false, + pipeline: "testdata/build/secrets/basic.yml", + }, + { // pipeline with secret name not found + failure: true, + pipeline: "testdata/build/secrets/name_notfound.yml", + }, + } + + // run tests + for _, test := range tests { + file, _ := ioutil.ReadFile(test.pipeline) + + p, _ := compiler. + WithBuild(_build). + WithRepo(_repo). + WithUser(_user). + WithMetadata(_metadata). + Compile(file) + + _engine, err := New( + WithBuild(_build), + WithPipeline(p), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + _engine.build.SetStatus(constants.StatusSuccess) + + // add init container info to client + _ = _engine.CreateBuild(context.Background()) + + err = _engine.secret.exec(context.Background(), &p.Secrets) + + if test.failure { + if err == nil { + t.Errorf("exec should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("exec returned err: %v", err) + } + } +} + +func TestLinux_Secret_pull(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + server := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(server.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + secret *pipeline.Secret + }{ + { // success with org secret + failure: false, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, + { // failure with invalid org secret + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "foo/foo/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, + { // failure with org secret key not found + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, + { // success with repo secret + failure: false, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octocat/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, + { // failure with invalid repo secret + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "foo/foo/foo/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, + { // failure with repo secret key not found + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, + { // success with shared secret + failure: false, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octokitties/foo", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, + { // failure with shared secret key not found + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, + { // failure with invalid type + failure: true, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octokitties/foo", + Engine: "native", + Type: "invalid", + Origin: &pipeline.Container{}, + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(testSteps()), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + _, err = _engine.secret.pull(test.secret) + + if test.failure { + if err == nil { + t.Errorf("pull should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("pull returned err: %v", err) + } + } +} + +func TestLinux_Secret_stream(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + _steps := testSteps() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + logs *library.Log + container *pipeline.Container + }{ + { // container step succeeds + failure: false, + logs: new(library.Log), + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + { // container step fails because of invalid container id + failure: true, + logs: new(library.Log), + container: &pipeline.Container{ + ID: "secret_github_octocat_1_notfound", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "notfound", + Number: 2, + Pull: "always", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // add init container info to client + _ = _engine.CreateBuild(context.Background()) + + err = _engine.secret.stream(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("stream should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("stream returned err: %v", err) + } + } +} + +func TestLinux_Secret_injectSecret(t *testing.T) { + // name and value of secret + v := "foo" + + // setup types + tests := []struct { + step *pipeline.Container + msec map[string]*library.Secret + want *pipeline.Container + }{ + // Tests for secrets with image ACLs + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"alpine:latest"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: make(map[string]string), + }, + }, + + // Tests for secrets with event ACLs + { // push event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + }, + }, + { // pull_request event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "pull_request"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "pull_request"}, + }, + }, + { // tag event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "tag"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "tag"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "tag"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "tag"}, + }, + }, + { // deployment event checks + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"deployment"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "deployment"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "deployment"}, + }, + }, + + // Tests for secrets with event and image ACLs + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"centos"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + }, + }, + { + step: &pipeline.Container{ + Image: "centos:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"pull_request"}, Images: &[]string{"centos"}}}, + want: &pipeline.Container{ + Image: "centos:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + }, + }, + { + step: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"BUILD_EVENT": "push"}, + Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, + }, + msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}, Images: &[]string{"alpine"}}}, + want: &pipeline.Container{ + Image: "alpine:latest", + Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, + }, + }, + } + + // run test + for _, test := range tests { + _ = injectSecrets(test.step, test.msec) + got := test.step + + // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. + // Switching to a Google library for increased clarity. + // https://github.com/google/go-cmp + if diff := cmp.Diff(test.want.Environment, got.Environment); diff != "" { + t.Errorf("injectSecrets mismatch (-want +got):\n%s", diff) + } + } +} + +func TestLinux_Secret_escapeNewlineSecrets(t *testing.T) { + // name and value of secret + n := "foo" + v := "bar\\nbaz" + vEscaped := "bar\\\nbaz" + + // desired secret value + w := "bar\\\nbaz" + + // setup types + tests := []struct { + secretMap map[string]*library.Secret + want map[string]*library.Secret + }{ + + { + secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &v}}, + want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, + }, + { + secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &vEscaped}}, + want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, + }, + } + + // run test + for _, test := range tests { + escapeNewlineSecrets(test.secretMap) + got := test.secretMap + + // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. + // Switching to a Google library for increased clarity. + // https://github.com/google/go-cmp + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("escapeNewlineSecrets mismatch (-want +got):\n%s", diff) + } + } +} diff --git a/executor/linux/service.go b/executor/linux/service.go new file mode 100644 index 00000000..7e67bf50 --- /dev/null +++ b/executor/linux/service.go @@ -0,0 +1,273 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "fmt" + "io/ioutil" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/service" + "golang.org/x/sync/errgroup" +) + +// CreateService configures the service for execution. +func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with service metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("service", ctn.Name) + + logger.Debug("setting up container") + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + + // update the service container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Environment + err = service.Environment(ctn, c.build, c.repo, nil, c.Version) + if err != nil { + return err + } + + logger.Debug("injecting secrets") + // inject secrets for container + err = injectSecrets(ctn, c.Secrets) + if err != nil { + return err + } + + logger.Debug("substituting container configuration") + // substitute container configuration + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Substitute + err = ctn.Substitute() + if err != nil { + return fmt.Errorf("unable to substitute container configuration") + } + + return nil +} + +// PlanService prepares the service for execution. +func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { + var err error + + // update engine logger with service metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("service", ctn.Name) + + // create the library service object + _service := new(library.Service) + _service.SetName(ctn.Name) + _service.SetNumber(ctn.Number) + _service.SetImage(ctn.Image) + _service.SetStatus(constants.StatusRunning) + _service.SetStarted(time.Now().UTC().Unix()) + _service.SetHost(c.build.GetHost()) + _service.SetRuntime(c.build.GetRuntime()) + _service.SetDistribution(c.build.GetDistribution()) + + logger.Debug("uploading service state") + // send API call to update the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Update + _service, _, err = c.Vela.Svc.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _service) + if err != nil { + return err + } + + // update the service container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Environment + err = service.Environment(ctn, c.build, c.repo, _service, c.Version) + if err != nil { + return err + } + + // add a service to a map + c.services.Store(ctn.ID, _service) + + // get the service log here + logger.Debug("retrieve service log") + // send API call to capture the service log + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.GetService + _log, _, err := c.Vela.Log.GetService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _service.GetNumber()) + if err != nil { + return err + } + + // add a service log to a map + c.serviceLogs.Store(ctn.ID, _log) + + return nil +} + +// ExecService runs a service. +func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with service metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("service", ctn.Name) + + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + _service, err := service.Load(ctn, &c.services) + if err != nil { + return err + } + + // defer taking a snapshot of the service + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Snapshot + defer func() { service.Snapshot(ctn, c.build, c.Vela, c.logger, c.repo, _service) }() + + logger.Debug("running container") + // run the runtime container + err = c.Runtime.RunContainer(ctx, ctn, c.pipeline) + if err != nil { + return err + } + + // create an error group with the parent context + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + logs, logCtx := errgroup.WithContext(ctx) + + logs.Go(func() error { + logger.Debug("streaming logs for container") + // stream logs from container + err := c.StreamService(logCtx, ctn) + if err != nil { + logger.Error(err) + } + + return nil + }) + + return nil +} + +// StreamService tails the output for a service. +func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with service metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("service", ctn.Name) + + // load the logs for the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#LoadLogs + _log, err := service.LoadLogs(ctn, &c.serviceLogs) + if err != nil { + return err + } + + // nolint: dupl // ignore similar code + defer func() { + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + logger.Errorf("unable to tail container output for upload: %v", err) + + return + } + defer rc.Close() + + // read all output from the runtime container + data, err := ioutil.ReadAll(rc) + if err != nil { + logger.Errorf("unable to read container output for upload: %v", err) + + return + } + + // overwrite the existing log with all bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData + _log.SetData(data) + + logger.Debug("uploading logs") + // send API call to update the logs for the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + _, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Errorf("unable to upload container logs: %v", err) + } + }() + + logger.Debug("tailing container") + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // set the timeout to the repo timeout + // to ensure the stream is not cut off + c.Vela.SetTimeout(time.Minute * time.Duration(c.repo.GetTimeout())) + + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Stream + _, err = c.Vela.Svc.Stream(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, rc) + if err != nil { + logger.Errorf("unable to stream logs: %v", err) + } + + logger.Info("finished streaming logs") + + return nil +} + +// DestroyService cleans up services after execution. +func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with service metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("service", ctn.Name) + + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + _service, err := service.Load(ctn, &c.services) + if err != nil { + // create the service from the container + // + // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainer + _service = library.ServiceFromContainer(ctn) + } + + // defer an upload of the service + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#LoaUploadd + defer func() { service.Upload(ctn, c.build, c.Vela, logger, c.repo, _service) }() + + logger.Debug("inspecting container") + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + logger.Debug("removing container") + // remove the runtime container + err = c.Runtime.RemoveContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go new file mode 100644 index 00000000..5b39eba7 --- /dev/null +++ b/executor/linux/service_test.go @@ -0,0 +1,473 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLinux_CreateService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with image not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:notfound", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("CreateService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateService returned err: %v", err) + } + } +} + +func TestLinux_PlanService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with nil environment + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: nil, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanService returned err: %v", err) + } + } +} + +func TestLinux_ExecService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with image not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:notfound", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + _engine.serviceLogs.Store(test.container.ID, new(library.Log)) + } + + err = _engine.ExecService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecService returned err: %v", err) + } + } +} + +func TestLinux_StreamService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with name not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_notfound", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "notfound", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + _engine.serviceLogs.Store(test.container.ID, new(library.Log)) + } + + err = _engine.StreamService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("StreamService returned err: %v", err) + } + } +} + +func TestLinux_DestroyService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with ignoring name not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_ignorenotfound", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "ignorenotfound", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyService returned err: %v", err) + } + } +} diff --git a/executor/linux/stage.go b/executor/linux/stage.go new file mode 100644 index 00000000..551fa393 --- /dev/null +++ b/executor/linux/stage.go @@ -0,0 +1,167 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "fmt" + "sync" + + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/step" +) + +// CreateStage prepares the stage for execution. +func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { + // load the logs for the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadLogs + _log, err := step.LoadLogs(c.init, &c.stepLogs) + if err != nil { + return err + } + + // update engine logger with stage metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("stage", s.Name) + + // update the init log with progress + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte(fmt.Sprintf("> Pulling step images for stage %s...\n", s.Name))) + + // create the steps for the stage + for _, _step := range s.Steps { + // update the container environment with stage name + _step.Environment["VELA_STEP_STAGE"] = s.Name + + logger.Debugf("creating %s step", _step.Name) + // create the step + err := c.CreateStep(ctx, _step) + if err != nil { + return err + } + + logger.Infof("inspecting image for %s step", _step.Name) + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, _step) + if err != nil { + return err + } + + // update the init log with step image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(image) + } + + return nil +} + +// PlanStage prepares the stage for execution. +func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) error { + // update engine logger with stage metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("stage", s.Name) + + logger.Debug("gathering stage dependency tree") + // ensure dependent stages have completed + for _, needs := range s.Needs { + logger.Debugf("looking up dependency %s", needs) + // check if a dependency stage has completed + stageErr, ok := m.Load(needs) + if !ok { // stage not found so we continue + continue + } + + logger.Debugf("waiting for dependency %s", needs) + // wait for the stage channel to close + select { + case <-ctx.Done(): + return fmt.Errorf("errgroup context is done") + case err := <-stageErr.(chan error): + if err != nil { + logger.Errorf("%s stage returned error: %v", needs, err) + return err + } + + continue + } + } + + return nil +} + +// ExecStage runs a stage. +func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) error { + // update engine logger with stage metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("stage", s.Name) + + // close the stage channel at the end + defer func() { + // retrieve the error channel for the current stage + errChan, ok := m.Load(s.Name) + if !ok { + logger.Debugf("error channel for stage %s not found", s.Name) + + return + } + + // close the error channel + close(errChan.(chan error)) + }() + + logger.Debug("starting execution of stage") + // execute the steps for the stage + for _, _step := range s.Steps { + // check if the step should be skipped + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip + if step.Skip(_step, c.build, c.repo) { + continue + } + + logger.Debugf("planning %s step", _step.Name) + // plan the step + err := c.PlanStep(ctx, _step) + if err != nil { + return fmt.Errorf("unable to plan step %s: %w", _step.Name, err) + } + + logger.Infof("executing %s step", _step.Name) + // execute the step + err = c.ExecStep(ctx, _step) + if err != nil { + return fmt.Errorf("unable to exec step %s: %w", _step.Name, err) + } + } + + return nil +} + +// DestroyStage cleans up the stage after execution. +func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { + // update engine logger with stage metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("stage", s.Name) + var err error + + // destroy the steps for the stage + for _, _step := range s.Steps { + logger.Debugf("destroying %s step", _step.Name) + // destroy the step + err = c.DestroyStep(ctx, _step) + if err != nil { + logger.Errorf("unable to destroy step: %v", err) + } + } + + return err +} diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go new file mode 100644 index 00000000..8b7084b5 --- /dev/null +++ b/executor/linux/stage_test.go @@ -0,0 +1,456 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "errors" + "flag" + "net/http/httptest" + "sync" + "testing" + + "github.com/gin-gonic/gin" + "github.com/urfave/cli/v2" + + "github.com/go-vela/compiler/compiler/native" + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/pipeline" +) + +func TestLinux_CreateStage(t *testing.T) { + // setup types + _file := "testdata/build/stages/basic.yml" + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(_file) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", _file, err) + } + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // stage with step container with image not found + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // empty stage + failure: true, + stage: new(pipeline.Stage), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if len(test.stage.Name) > 0 { + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + } + + err = _engine.CreateStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("CreateStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateStage returned err: %v", err) + } + } +} + +func TestLinux_PlanStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + testMap := new(sync.Map) + testMap.Store("foo", make(chan error, 1)) + + tm, _ := testMap.Load("foo") + tm.(chan error) <- nil + close(tm.(chan error)) + + errMap := new(sync.Map) + errMap.Store("foo", make(chan error, 1)) + + em, _ := errMap.Load("foo") + em.(chan error) <- errors.New("bar") + close(em.(chan error)) + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + stageMap *sync.Map + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: new(sync.Map), + }, + { // basic stage with nil stage map + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: testMap, + }, + { // basic stage with error stage map + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: errMap, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) + + if test.failure { + if err == nil { + t.Errorf("PlanStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanStage returned err: %v", err) + } + } +} + +func TestLinux_ExecStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // stage with step container with image not found + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // stage with step container with bad number + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 0, + Pull: "not_present", + }, + }, + }, + }, + } + + // run tests + for _, test := range tests { + stageMap := new(sync.Map) + stageMap.Store("echo", make(chan error, 1)) + + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.ExecStage(context.Background(), test.stage, stageMap) + + if test.failure { + if err == nil { + t.Errorf("ExecStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecStage returned err: %v", err) + } + } +} + +func TestLinux_DestroyStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("DestroyStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyStage returned err: %v", err) + } + } +} diff --git a/executor/linux/step.go b/executor/linux/step.go new file mode 100644 index 00000000..a3200177 --- /dev/null +++ b/executor/linux/step.go @@ -0,0 +1,327 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "fmt" + "io/ioutil" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/step" + "golang.org/x/sync/errgroup" +) + +// CreateStep configures the step for execution. +func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error { + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("step", ctn.Name) + + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + logger.Debug("setting up container") + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + + // create a library step object to facilitate injecting environment as early as possible + // (PlanStep is too late to inject environment vars for the kubernetes runtime). + _step := c.newLibraryStep(ctn) + _step.SetStatus(constants.StatusPending) + + // update the step container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment + err = step.Environment(ctn, c.build, c.repo, _step, c.Version) + if err != nil { + return err + } + + logger.Debug("escaping newlines in secrets") + escapeNewlineSecrets(c.Secrets) + + logger.Debug("injecting secrets") + // inject secrets for container + err = injectSecrets(ctn, c.Secrets) + if err != nil { + return err + } + + logger.Debug("substituting container configuration") + // substitute container configuration + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Substitute + err = ctn.Substitute() + if err != nil { + return fmt.Errorf("unable to substitute container configuration") + } + + return nil +} + +// newLibraryStep creates a library step object. +func (c *client) newLibraryStep(ctn *pipeline.Container) *library.Step { + _step := new(library.Step) + _step.SetName(ctn.Name) + _step.SetNumber(ctn.Number) + _step.SetImage(ctn.Image) + _step.SetStage(ctn.Environment["VELA_STEP_STAGE"]) + _step.SetHost(c.build.GetHost()) + _step.SetRuntime(c.build.GetRuntime()) + _step.SetDistribution(c.build.GetDistribution()) + return _step +} + +// PlanStep prepares the step for execution. +func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { + var err error + + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("step", ctn.Name) + + // create the library step object + _step := c.newLibraryStep(ctn) + _step.SetStatus(constants.StatusRunning) + _step.SetStarted(time.Now().UTC().Unix()) + + logger.Debug("uploading step state") + // send API call to update the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + _step, _, err = c.Vela.Step.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _step) + if err != nil { + return err + } + + // update the step container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment + err = step.Environment(ctn, c.build, c.repo, _step, c.Version) + if err != nil { + return err + } + + // add a step to a map + c.steps.Store(ctn.ID, _step) + + // get the step log here + logger.Debug("retrieve step log") + // send API call to capture the step log + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.GetStep + _log, _, err := c.Vela.Log.GetStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _step.GetNumber()) + if err != nil { + return err + } + + // add a step log to a map + c.stepLogs.Store(ctn.ID, _log) + + return nil +} + +// ExecStep runs a step. +func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("step", ctn.Name) + + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _step, err := step.Load(ctn, &c.steps) + if err != nil { + return err + } + + // defer taking a snapshot of the step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Snapshot + defer func() { step.Snapshot(ctn, c.build, c.Vela, c.logger, c.repo, _step) }() + + logger.Debug("running container") + // run the runtime container + err = c.Runtime.RunContainer(ctx, ctn, c.pipeline) + if err != nil { + return err + } + + // create an error group with the parent context + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + logs, logCtx := errgroup.WithContext(ctx) + + logs.Go(func() error { + logger.Debug("streaming logs for container") + // stream logs from container + err := c.StreamStep(logCtx, ctn) + if err != nil { + logger.Error(err) + } + + return nil + }) + + // do not wait for detached containers + if ctn.Detach { + return nil + } + + logger.Debug("waiting for container") + // wait for the runtime container + err = c.Runtime.WaitContainer(ctx, ctn) + if err != nil { + return err + } + + logger.Debug("inspecting container") + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} + +// StreamStep tails the output for a step. +func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("step", ctn.Name) + + // load the logs for the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadLogs + _log, err := step.LoadLogs(ctn, &c.stepLogs) + if err != nil { + return err + } + + // nolint: dupl // ignore similar code + defer func() { + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + logger.Errorf("unable to tail container output for upload: %v", err) + + return + } + defer rc.Close() + + // read all output from the runtime container + data, err := ioutil.ReadAll(rc) + if err != nil { + logger.Errorf("unable to read container output for upload: %v", err) + + return + } + + // overwrite the existing log with all bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData + _log.SetData(data) + + logger.Debug("uploading logs") + // send API call to update the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + _, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Errorf("unable to upload container logs: %v", err) + } + }() + + logger.Debug("tailing container") + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // set the timeout to the repo timeout + // to ensure the stream is not cut off + c.Vela.SetTimeout(time.Minute * time.Duration(c.repo.GetTimeout())) + + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Stream + _, err = c.Vela.Step.Stream(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, rc) + if err != nil { + logger.Errorf("unable to stream logs: %v", err) + } + + logger.Info("finished streaming logs") + + return nil +} + +// DestroyStep cleans up steps after execution. +func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.logger.WithField("step", ctn.Name) + + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _step, err := step.Load(ctn, &c.steps) + if err != nil { + // create the step from the container + // + // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainer + _step = library.StepFromContainer(ctn) + } + + // defer an upload of the step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Upload + defer func() { step.Upload(ctn, c.build, c.Vela, logger, c.repo, _step) }() + + logger.Debug("inspecting container") + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + logger.Debug("removing container") + // remove the runtime container + err = c.Runtime.RemoveContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go new file mode 100644 index 00000000..314ca550 --- /dev/null +++ b/executor/linux/step_test.go @@ -0,0 +1,515 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package linux + +import ( + "context" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLinux_CreateStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with image not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("CreateStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateStep returned err: %v", err) + } + } +} + +func TestLinux_PlanStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with nil environment + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: nil, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanStep returned err: %v", err) + } + } +} + +func TestLinux_ExecStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // detached step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with image not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.stepLogs.Store(test.container.ID, new(library.Log)) + } + + err = _engine.ExecStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecStep returned err: %v", err) + } + } +} + +func TestLinux_StreamStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + logs *library.Log + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with name not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_notfound", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "notfound", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.stepLogs.Store(test.container.ID, new(library.Log)) + } + + err = _engine.StreamStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("StreamStep returned err: %v", err) + } + } +} + +func TestLinux_DestroyStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with ignoring name not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_ignorenotfound", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "ignorenotfound", + Number: 1, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyStep returned err: %v", err) + } + } +} diff --git a/executor/linux/testdata/build/empty.yml b/executor/linux/testdata/build/empty.yml new file mode 100644 index 00000000..73b314ff --- /dev/null +++ b/executor/linux/testdata/build/empty.yml @@ -0,0 +1 @@ +--- \ No newline at end of file diff --git a/executor/linux/testdata/build/secrets/basic.yml b/executor/linux/testdata/build/secrets/basic.yml new file mode 100644 index 00000000..27a2336a --- /dev/null +++ b/executor/linux/testdata/build/secrets/basic.yml @@ -0,0 +1,23 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foob + origin: + name: vault + environment: + FOO: bar + image: vault:latest + parameters: + foo: bar + pull: true + + \ No newline at end of file diff --git a/executor/linux/testdata/build/secrets/img_ignorenotfound.yml b/executor/linux/testdata/build/secrets/img_ignorenotfound.yml new file mode 100644 index 00000000..99172227 --- /dev/null +++ b/executor/linux/testdata/build/secrets/img_ignorenotfound.yml @@ -0,0 +1,23 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foob + origin: + name: vault + environment: + FOO: bar + image: vault:ignorenotfound + parameters: + foo: bar + pull: true + + \ No newline at end of file diff --git a/executor/linux/testdata/build/secrets/img_notfound.yml b/executor/linux/testdata/build/secrets/img_notfound.yml new file mode 100644 index 00000000..9107fa9e --- /dev/null +++ b/executor/linux/testdata/build/secrets/img_notfound.yml @@ -0,0 +1,23 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foob + origin: + name: vault + environment: + FOO: bar + image: vault:notfound + parameters: + foo: bar + pull: true + + \ No newline at end of file diff --git a/executor/linux/testdata/build/secrets/name_notfound.yml b/executor/linux/testdata/build/secrets/name_notfound.yml new file mode 100644 index 00000000..69178bc3 --- /dev/null +++ b/executor/linux/testdata/build/secrets/name_notfound.yml @@ -0,0 +1,23 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foob + origin: + name: notfound + environment: + FOO: bar + image: vault:latest + parameters: + foo: bar + pull: true + + \ No newline at end of file diff --git a/executor/linux/testdata/build/services/basic.yml b/executor/linux/testdata/build/services/basic.yml new file mode 100644 index 00000000..0c0f8699 --- /dev/null +++ b/executor/linux/testdata/build/services/basic.yml @@ -0,0 +1,18 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:latest + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/services/img_ignorenotfound.yml b/executor/linux/testdata/build/services/img_ignorenotfound.yml new file mode 100644 index 00000000..324248ca --- /dev/null +++ b/executor/linux/testdata/build/services/img_ignorenotfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:ignorenotfound + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/linux/testdata/build/services/img_notfound.yml b/executor/linux/testdata/build/services/img_notfound.yml new file mode 100644 index 00000000..5378fe7f --- /dev/null +++ b/executor/linux/testdata/build/services/img_notfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:notfound + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/linux/testdata/build/services/name_notfound.yml b/executor/linux/testdata/build/services/name_notfound.yml new file mode 100644 index 00000000..3dd1998b --- /dev/null +++ b/executor/linux/testdata/build/services/name_notfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: notfound + environment: + FOO: bar + image: postgres:latest + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/basic.yml b/executor/linux/testdata/build/stages/basic.yml new file mode 100644 index 00000000..f49e1750 --- /dev/null +++ b/executor/linux/testdata/build/stages/basic.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/img_ignorenotfound.yml b/executor/linux/testdata/build/stages/img_ignorenotfound.yml new file mode 100644 index 00000000..e261e316 --- /dev/null +++ b/executor/linux/testdata/build/stages/img_ignorenotfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:ignorenotfound + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/img_notfound.yml b/executor/linux/testdata/build/stages/img_notfound.yml new file mode 100644 index 00000000..1639a4f6 --- /dev/null +++ b/executor/linux/testdata/build/stages/img_notfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:notfound + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/name_notfound.yml b/executor/linux/testdata/build/stages/name_notfound.yml new file mode 100644 index 00000000..69216319 --- /dev/null +++ b/executor/linux/testdata/build/stages/name_notfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: notfound + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/steps/basic.yml b/executor/linux/testdata/build/steps/basic.yml new file mode 100644 index 00000000..10852530 --- /dev/null +++ b/executor/linux/testdata/build/steps/basic.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/steps/img_ignorenotfound.yml b/executor/linux/testdata/build/steps/img_ignorenotfound.yml new file mode 100644 index 00000000..539fac96 --- /dev/null +++ b/executor/linux/testdata/build/steps/img_ignorenotfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:ignorenotfound + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/steps/img_notfound.yml b/executor/linux/testdata/build/steps/img_notfound.yml new file mode 100644 index 00000000..20d1b53a --- /dev/null +++ b/executor/linux/testdata/build/steps/img_notfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:notfound + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/steps/name_notfound.yml b/executor/linux/testdata/build/steps/name_notfound.yml new file mode 100644 index 00000000..735fce7c --- /dev/null +++ b/executor/linux/testdata/build/steps/name_notfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: notfound + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/secret/basic.yml b/executor/linux/testdata/secret/basic.yml new file mode 100644 index 00000000..80b57c5f --- /dev/null +++ b/executor/linux/testdata/secret/basic.yml @@ -0,0 +1,25 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foo + + - name: foob + origin: + name: vault + environment: + FOO: bar + image: vault:latest + parameters: + addr: vault.company.com + pull: true + + \ No newline at end of file diff --git a/executor/linux/testdata/secret/name_notfound.yml b/executor/linux/testdata/secret/name_notfound.yml new file mode 100644 index 00000000..c7e5cdec --- /dev/null +++ b/executor/linux/testdata/secret/name_notfound.yml @@ -0,0 +1,25 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + +secrets: + - name: foo + + - name: foob + origin: + name: notfound + environment: + FOO: bar + image: vault:latest + parameters: + foo: bar + pull: true + + \ No newline at end of file diff --git a/executor/local/api.go b/executor/local/api.go new file mode 100644 index 00000000..0ed25483 --- /dev/null +++ b/executor/local/api.go @@ -0,0 +1,200 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/service" + "github.com/go-vela/worker/internal/step" +) + +// GetBuild gets the current build in execution. +func (c *client) GetBuild() (*library.Build, error) { + // check if the build resource is available + if c.build == nil { + return nil, fmt.Errorf("build resource not found") + } + + return c.build, nil +} + +// GetPipeline gets the current pipeline in execution. +func (c *client) GetPipeline() (*pipeline.Build, error) { + // check if the pipeline resource is available + if c.pipeline == nil { + return nil, fmt.Errorf("pipeline resource not found") + } + + return c.pipeline, nil +} + +// GetRepo gets the current repo in execution. +func (c *client) GetRepo() (*library.Repo, error) { + // check if the repo resource is available + if c.repo == nil { + return nil, fmt.Errorf("repo resource not found") + } + + return c.repo, nil +} + +// CancelBuild cancels the current build in execution. +// nolint: funlen // process of going through steps/services/stages is verbose and could be funcitonalized +func (c *client) CancelBuild() (*library.Build, error) { + // get the current build from the client + b, err := c.GetBuild() + if err != nil { + return nil, err + } + + // set the build status to canceled + b.SetStatus(constants.StatusCanceled) + + // get the current pipeline from the client + pipeline, err := c.GetPipeline() + if err != nil { + return nil, err + } + + // cancel non successful services + // nolint: dupl // false positive, steps/services are different + for _, _service := range pipeline.Services { + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + s, err := service.Load(_service, &c.services) + if err != nil { + // create the library service object + s = new(library.Service) + s.SetName(_service.Name) + s.SetNumber(_service.Number) + s.SetImage(_service.Image) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if service state was not terminal, set it as canceled + switch s.GetStatus() { + // service is in a error state + case constants.StatusError: + break + // service is in a failure state + case constants.StatusFailure: + break + // service is in a killed state + case constants.StatusKilled: + break + // service is in a success state + case constants.StatusSuccess: + break + default: + // update the service with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a service to a map + c.services.Store(_service.ID, s) + } + } + + // cancel non successful steps + // nolint: dupl // false positive, steps/services are different + for _, _step := range pipeline.Steps { + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + s, err := step.Load(_step, &c.steps) + if err != nil { + // create the library step object + s = new(library.Step) + s.SetName(_step.Name) + s.SetNumber(_step.Number) + s.SetImage(_step.Image) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if step state was not terminal, set it as canceled + switch s.GetStatus() { + // step is in a error state + case constants.StatusError: + break + // step is in a failure state + case constants.StatusFailure: + break + // step is in a killed state + case constants.StatusKilled: + break + // step is in a success state + case constants.StatusSuccess: + break + default: + // update the step with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a step to a map + c.steps.Store(_step.ID, s) + } + } + + // cancel non successful stages + for _, _stage := range pipeline.Stages { + // cancel non successful steps for that stage + for _, _step := range _stage.Steps { + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + s, err := step.Load(_step, &c.steps) + if err != nil { + // create the library step object + s = new(library.Step) + s.SetName(_step.Name) + s.SetNumber(_step.Number) + s.SetImage(_step.Image) + s.SetStage(_stage.Name) + s.SetStarted(time.Now().UTC().Unix()) + s.SetHost(c.build.GetHost()) + s.SetRuntime(c.build.GetRuntime()) + s.SetDistribution(c.build.GetDistribution()) + } + + // if stage state was not terminal, set it as canceled + switch s.GetStatus() { + // stage is in a error state + case constants.StatusError: + break + // stage is in a failure state + case constants.StatusFailure: + break + // stage is in a killed state + case constants.StatusKilled: + break + // stage is in a success state + case constants.StatusSuccess: + break + default: + // update the step with a canceled state + s.SetStatus(constants.StatusCanceled) + // add a step to a map + c.steps.Store(_step.ID, s) + } + } + } + + err = c.DestroyBuild(context.Background()) + if err != nil { + fmt.Fprintln(os.Stdout, "unable to destroy build:", err) + } + + return b, nil +} diff --git a/executor/local/api_test.go b/executor/local/api_test.go new file mode 100644 index 00000000..97ebc3ab --- /dev/null +++ b/executor/local/api_test.go @@ -0,0 +1,154 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "reflect" + "testing" +) + +func TestLocal_GetBuild(t *testing.T) { + // setup types + _build := testBuild() + + _engine, err := New( + WithBuild(_build), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetBuild() + + if test.failure { + if err == nil { + t.Errorf("GetBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetBuild returned err: %v", err) + } + + if !reflect.DeepEqual(got, _build) { + t.Errorf("GetBuild is %v, want %v", got, _build) + } + } +} + +func TestLocal_GetPipeline(t *testing.T) { + // setup types + _steps := testSteps() + + _engine, err := New( + WithPipeline(_steps), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetPipeline() + + if test.failure { + if err == nil { + t.Errorf("GetPipeline should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetPipeline returned err: %v", err) + } + + if !reflect.DeepEqual(got, _steps) { + t.Errorf("GetPipeline is %v, want %v", got, _steps) + } + } +} + +func TestLocal_GetRepo(t *testing.T) { + // setup types + _repo := testRepo() + + _engine, err := New( + WithRepo(_repo), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + engine *client + }{ + { + failure: false, + engine: _engine, + }, + { + failure: true, + engine: new(client), + }, + } + + // run tests + for _, test := range tests { + got, err := test.engine.GetRepo() + + if test.failure { + if err == nil { + t.Errorf("GetRepo should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("GetRepo returned err: %v", err) + } + + if !reflect.DeepEqual(got, _repo) { + t.Errorf("GetRepo is %v, want %v", got, _repo) + } + } +} diff --git a/executor/local/build.go b/executor/local/build.go new file mode 100644 index 00000000..0511dacb --- /dev/null +++ b/executor/local/build.go @@ -0,0 +1,417 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "fmt" + "os" + "sync" + "time" + + "golang.org/x/sync/errgroup" + + "github.com/go-vela/types/constants" + "github.com/go-vela/worker/internal/build" + "github.com/go-vela/worker/internal/step" +) + +// CreateBuild configures the build for execution. +func (c *client) CreateBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, nil, c.err, nil, nil) }() + + // update the build fields + c.build.SetStatus(constants.StatusRunning) + c.build.SetStarted(time.Now().UTC().Unix()) + c.build.SetHost(c.Hostname) + c.build.SetDistribution(c.Driver()) + c.build.SetRuntime(c.Runtime.Driver()) + + // setup the runtime build + c.err = c.Runtime.SetupBuild(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to setup build %s: %w", c.pipeline.ID, c.err) + } + + // load the init step from the pipeline + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#LoadInit + c.init, c.err = step.LoadInit(c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to load init step from pipeline: %w", c.err) + } + + // create the step + c.err = c.CreateStep(ctx, c.init) + if c.err != nil { + return fmt.Errorf("unable to create %s step: %w", c.init.Name, c.err) + } + + // plan the step + c.err = c.PlanStep(ctx, c.init) + if c.err != nil { + return fmt.Errorf("unable to plan %s step: %w", c.init.Name, c.err) + } + + return c.err +} + +// PlanBuild prepares the build for execution. +func (c *client) PlanBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, nil, c.err, nil, nil) }() + + // load the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _init, err := step.Load(c.init, &c.steps) + if err != nil { + return err + } + + // defer taking a snapshot of the init step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#SnapshotInit + defer func() { step.SnapshotInit(c.init, c.build, nil, nil, nil, _init, nil) }() + + // create a step pattern for log output + _pattern := fmt.Sprintf(stepPattern, c.init.Name) + + // check if the pipeline provided has stages + if len(c.pipeline.Stages) > 0 { + // create a stage pattern for log output + _pattern = fmt.Sprintf(stagePattern, c.init.Name, c.init.Name) + } + + // create the runtime network for the pipeline + c.err = c.Runtime.CreateNetwork(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to create network: %w", c.err) + } + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Inspecting runtime network...") + + // inspect the runtime network for the pipeline + network, err := c.Runtime.InspectNetwork(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect network: %w", err) + } + + // output the network information to stdout + fmt.Fprintln(os.Stdout, _pattern, string(network)) + + // create the runtime volume for the pipeline + err = c.Runtime.CreateVolume(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to create volume: %w", err) + } + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Inspecting runtime volume...") + + // inspect the runtime volume for the pipeline + volume, err := c.Runtime.InspectVolume(ctx, c.pipeline) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect volume: %w", err) + } + + // output the volume information to stdout + fmt.Fprintln(os.Stdout, _pattern, string(volume)) + + return c.err +} + +// AssembleBuild prepares the containers within a build for execution. +// +// nolint: funlen // ignore function length due to comments +func (c *client) AssembleBuild(ctx context.Context) error { + // defer taking a snapshot of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot + defer func() { build.Snapshot(c.build, nil, c.err, nil, nil) }() + + // load the init step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _init, err := step.Load(c.init, &c.steps) + if err != nil { + return err + } + + // defer an upload of the init step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Upload + defer func() { step.Upload(c.init, c.build, nil, nil, nil, _init) }() + + // create a step pattern for log output + _pattern := fmt.Sprintf(stepPattern, c.init.Name) + + // check if the pipeline provided has stages + if len(c.pipeline.Stages) > 0 { + // create a stage pattern for log output + _pattern = fmt.Sprintf(stagePattern, c.init.Name, c.init.Name) + } + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Pulling service images...") + + // create the services for the pipeline + for _, _service := range c.pipeline.Services { + // TODO: remove this; but we need it for tests + _service.Detach = true + + // create the service + c.err = c.CreateService(ctx, _service) + if c.err != nil { + return fmt.Errorf("unable to create %s service: %w", _service.Name, c.err) + } + + // inspect the service image + image, err := c.Runtime.InspectImage(ctx, _service) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect %s service: %w", _service.Name, err) + } + + // output the image information to stdout + fmt.Fprintln(os.Stdout, _pattern, string(image)) + } + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Pulling stage images...") + + // create the stages for the pipeline + for _, _stage := range c.pipeline.Stages { + // TODO: remove hardcoded reference + // + // nolint: goconst // ignore making a constant for now + if _stage.Name == "init" { + continue + } + + // create the stage + c.err = c.CreateStage(ctx, _stage) + if c.err != nil { + return fmt.Errorf("unable to create %s stage: %w", _stage.Name, c.err) + } + } + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Pulling step images...") + + // create the steps for the pipeline + for _, _step := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + + // create the step + c.err = c.CreateStep(ctx, _step) + if c.err != nil { + return fmt.Errorf("unable to create %s step: %w", _step.Name, c.err) + } + + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, _step) + if err != nil { + c.err = err + return fmt.Errorf("unable to inspect %s step: %w", _step.Name, err) + } + + // output the image information to stdout + fmt.Fprintln(os.Stdout, _pattern, string(image)) + } + + // output a new line for readability to stdout + fmt.Fprintln(os.Stdout, "") + + // assemble runtime build just before any containers execute + c.err = c.Runtime.AssembleBuild(ctx, c.pipeline) + if c.err != nil { + return fmt.Errorf("unable to assemble runtime build %s: %w", c.pipeline.ID, c.err) + } + + return c.err +} + +// ExecBuild runs a pipeline for a build. +func (c *client) ExecBuild(ctx context.Context) error { + // defer an upload of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Upload + defer func() { build.Upload(c.build, nil, c.err, nil, nil) }() + + // execute the services for the pipeline + for _, _service := range c.pipeline.Services { + // plan the service + c.err = c.PlanService(ctx, _service) + if c.err != nil { + return fmt.Errorf("unable to plan service: %w", c.err) + } + + // execute the service + c.err = c.ExecService(ctx, _service) + if c.err != nil { + return fmt.Errorf("unable to execute service: %w", c.err) + } + } + + // execute the steps for the pipeline + for _, _step := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + + // check if the step should be skipped + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip + if step.Skip(_step, c.build, c.repo) { + continue + } + + // plan the step + c.err = c.PlanStep(ctx, _step) + if c.err != nil { + return fmt.Errorf("unable to plan step: %w", c.err) + } + + // execute the step + c.err = c.ExecStep(ctx, _step) + if c.err != nil { + return fmt.Errorf("unable to execute step: %w", c.err) + } + } + + // create an error group with the context for each stage + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + stages, stageCtx := errgroup.WithContext(ctx) + // create a map to track the progress of each stage + stageMap := new(sync.Map) + + // iterate through each stage in the pipeline + for _, _stage := range c.pipeline.Stages { + // TODO: remove hardcoded reference + if _stage.Name == "init" { + continue + } + + // https://golang.org/doc/faq#closures_and_goroutines + stage := _stage + + // create a new channel for each stage in the map + stageMap.Store(stage.Name, make(chan error)) + + // spawn errgroup routine for the stage + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Go + stages.Go(func() error { + // plan the stage + c.err = c.PlanStage(stageCtx, stage, stageMap) + if c.err != nil { + return fmt.Errorf("unable to plan stage: %w", c.err) + } + + // execute the stage + c.err = c.ExecStage(stageCtx, stage, stageMap) + if c.err != nil { + return fmt.Errorf("unable to execute stage: %w", c.err) + } + + return nil + }) + } + + // wait for the stages to complete or return an error + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait + c.err = stages.Wait() + if c.err != nil { + return fmt.Errorf("unable to wait for stages: %v", c.err) + } + + return c.err +} + +// DestroyBuild cleans up the build after execution. +func (c *client) DestroyBuild(ctx context.Context) error { + var err error + + defer func() { + // remove the runtime build for the pipeline + err = c.Runtime.RemoveBuild(ctx, c.pipeline) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy runtime build:", err) + } + }() + + // destroy the steps for the pipeline + for _, _step := range c.pipeline.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + + // destroy the step + err = c.DestroyStep(ctx, _step) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy step:", err) + } + } + + // destroy the stages for the pipeline + for _, _stage := range c.pipeline.Stages { + // TODO: remove hardcoded reference + if _stage.Name == "init" { + continue + } + + // destroy the stage + err = c.DestroyStage(ctx, _stage) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy stage:", err) + } + } + + // destroy the services for the pipeline + for _, _service := range c.pipeline.Services { + // destroy the service + err = c.DestroyService(ctx, _service) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy service:", err) + } + } + + // remove the runtime volume for the pipeline + err = c.Runtime.RemoveVolume(ctx, c.pipeline) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy runtime volume:", err) + } + + // remove the runtime network for the pipeline + err = c.Runtime.RemoveNetwork(ctx, c.pipeline) + if err != nil { + // output the error information to stdout + fmt.Fprintln(os.Stdout, "unable to destroy runtime network:", err) + } + + return err +} diff --git a/executor/local/build_test.go b/executor/local/build_test.go new file mode 100644 index 00000000..527f1748 --- /dev/null +++ b/executor/local/build_test.go @@ -0,0 +1,438 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "flag" + "testing" + + "github.com/go-vela/compiler/compiler/native" + "github.com/urfave/cli/v2" + + "github.com/go-vela/pkg-runtime/runtime/docker" +) + +func TestLocal_CreateBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("CreateBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + } +} + +func TestLocal_PlanBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.PlanBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("PlanBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanBuild returned err: %v", err) + } + } +} + +func TestLocal_AssembleBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with image not found + failure: true, + pipeline: "testdata/build/services/img_notfound.yml", + }, + { // services pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/services/img_ignorenotfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with image not found + failure: true, + pipeline: "testdata/build/steps/img_notfound.yml", + }, + { // steps pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/steps/img_ignorenotfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with image not found + failure: true, + pipeline: "testdata/build/stages/img_notfound.yml", + }, + { // stages pipeline with ignoring image not found + failure: true, + pipeline: "testdata/build/stages/img_ignorenotfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.AssembleBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + } +} + +func TestLocal_ExecBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with image not found + failure: true, + pipeline: "testdata/build/services/img_notfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with image not found + failure: true, + pipeline: "testdata/build/steps/img_notfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with image not found + failure: true, + pipeline: "testdata/build/stages/img_notfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.ExecBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + } + + continue + } + + if err != nil { + t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) + } + } +} + +func TestLocal_DestroyBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + failure bool + pipeline string + }{ + { // basic services pipeline + failure: false, + pipeline: "testdata/build/services/basic.yml", + }, + { // services pipeline with name not found + failure: false, + pipeline: "testdata/build/services/name_notfound.yml", + }, + { // basic steps pipeline + failure: false, + pipeline: "testdata/build/steps/basic.yml", + }, + { // steps pipeline with name not found + failure: false, + pipeline: "testdata/build/steps/name_notfound.yml", + }, + { // basic stages pipeline + failure: false, + pipeline: "testdata/build/stages/basic.yml", + }, + { // stages pipeline with name not found + failure: false, + pipeline: "testdata/build/stages/name_notfound.yml", + }, + } + + // run test + for _, test := range tests { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.DestroyBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("DestroyBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyBuild returned err: %v", err) + } + } +} diff --git a/executor/local/doc.go b/executor/local/doc.go new file mode 100644 index 00000000..0f487a8f --- /dev/null +++ b/executor/local/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package local provides the ability for Vela to +// integrate with the local system. +// +// Usage: +// +// import "github.com/go-vela/worker/executor/local" +package local diff --git a/executor/local/driver.go b/executor/local/driver.go new file mode 100644 index 00000000..e02eb0f1 --- /dev/null +++ b/executor/local/driver.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import "github.com/go-vela/types/constants" + +// Driver outputs the configured executor driver. +func (c *client) Driver() string { + return constants.DriverLocal +} diff --git a/executor/local/driver_test.go b/executor/local/driver_test.go new file mode 100644 index 00000000..23a43c92 --- /dev/null +++ b/executor/local/driver_test.go @@ -0,0 +1,40 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "reflect" + "testing" + + "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/types/constants" +) + +func TestLocal_Driver(t *testing.T) { + // setup types + want := constants.DriverLocal + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _engine, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRuntime(_runtime), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run tes + got := _engine.Driver() + + if !reflect.DeepEqual(got, want) { + t.Errorf("Driver is %v, want %v", got, want) + } +} diff --git a/executor/local/local.go b/executor/local/local.go new file mode 100644 index 00000000..67668744 --- /dev/null +++ b/executor/local/local.go @@ -0,0 +1,52 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "sync" + + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +type ( + // client manages communication with the pipeline resources. + client struct { + Vela *vela.Client + Runtime runtime.Engine + Hostname string + Version string + + // private fields + init *pipeline.Container + build *library.Build + pipeline *pipeline.Build + repo *library.Repo + services sync.Map + steps sync.Map + user *library.User + err error + } +) + +// New returns an Executor implementation that integrates with the local system. +// +// nolint: golint // ignore unexported type as it is intentional +func New(opts ...Opt) (*client, error) { + // create new local client + c := new(client) + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + return c, nil +} diff --git a/executor/local/local_test.go b/executor/local/local_test.go new file mode 100644 index 00000000..b21ed525 --- /dev/null +++ b/executor/local/local_test.go @@ -0,0 +1,220 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLocal_New(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: testSteps(), + }, + { + failure: true, + pipeline: nil, + }, + } + + // run tests + for _, test := range tests { + _, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(test.pipeline), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + } +} + +// testBuild is a test helper function to create a Build +// type with all fields set to a fake value. +func testBuild() *library.Build { + return &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("push"), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("Local"), + } +} + +// testRepo is a test helper function to create a Repo +// type with all fields set to a fake value. +func testRepo() *library.Repo { + return &library.Repo{ + ID: vela.Int64(1), + Org: vela.String("github"), + Name: vela.String("octocat"), + FullName: vela.String("github/octocat"), + Link: vela.String("https://github.com/github/octocat"), + Clone: vela.String("https://github.com/github/octocat.git"), + Branch: vela.String("master"), + Timeout: vela.Int64(60), + Visibility: vela.String("public"), + Private: vela.Bool(false), + Trusted: vela.Bool(false), + Active: vela.Bool(true), + AllowPull: vela.Bool(false), + AllowPush: vela.Bool(true), + AllowDeploy: vela.Bool(false), + AllowTag: vela.Bool(false), + } +} + +// testUser is a test helper function to create a User +// type with all fields set to a fake value. +func testUser() *library.User { + return &library.User{ + ID: vela.Int64(1), + Name: vela.String("octocat"), + Token: vela.String("superSecretToken"), + Hash: vela.String("MzM4N2MzMDAtNmY4Mi00OTA5LWFhZDAtNWIzMTlkNTJkODMy"), + Favorites: vela.Strings([]string{"github/octocat"}), + Active: vela.Bool(true), + Admin: vela.Bool(false), + } +} + +// testSteps is a test helper function to create a steps +// pipeline with fake steps. +func testSteps() *pipeline.Build { + return &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Services: pipeline.ContainerSlice{ + { + ID: "service_github_octocat_1_postgres", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + Steps: pipeline.ContainerSlice{ + { + ID: "step_github_octocat_1_init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + { + ID: "step_github_octocat_1_clone", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.3.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + { + ID: "step_github_octocat_1_echo", + Commands: []string{"echo hello"}, + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + Secrets: pipeline.SecretSlice{ + { + Name: "foo", + Key: "github/octocat/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + { + Name: "foo", + Key: "github/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + { + Name: "foo", + Key: "github/octokitties/foo", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, + } +} diff --git a/executor/local/opts.go b/executor/local/opts.go new file mode 100644 index 00000000..b3e69be2 --- /dev/null +++ b/executor/local/opts.go @@ -0,0 +1,121 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "fmt" + + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// Opt represents a configuration option to initialize the client. +type Opt func(*client) error + +// WithBuild sets the library build in the client. +func WithBuild(b *library.Build) Opt { + return func(c *client) error { + // set the build in the client + c.build = b + + return nil + } +} + +// WithHostname sets the hostname in the client. +func WithHostname(hostname string) Opt { + return func(c *client) error { + // check if a hostname is provided + if len(hostname) == 0 { + // default the hostname to localhost + hostname = "localhost" + } + + // set the hostname in the client + c.Hostname = hostname + + return nil + } +} + +// WithPipeline sets the pipeline build in the client. +func WithPipeline(p *pipeline.Build) Opt { + return func(c *client) error { + // check if the pipeline provided is empty + if p == nil { + return fmt.Errorf("empty pipeline provided") + } + + // set the pipeline in the client + c.pipeline = p + + return nil + } +} + +// WithRepo sets the library repo in the client. +func WithRepo(r *library.Repo) Opt { + return func(c *client) error { + // set the repo in the client + c.repo = r + + return nil + } +} + +// WithRuntime sets the runtime engine in the client. +func WithRuntime(r runtime.Engine) Opt { + return func(c *client) error { + // check if the runtime provided is empty + if r == nil { + return fmt.Errorf("empty runtime provided") + } + + // set the runtime in the client + c.Runtime = r + + return nil + } +} + +// WithUser sets the library user in the client. +func WithUser(u *library.User) Opt { + return func(c *client) error { + // set the user in the client + c.user = u + + return nil + } +} + +// WithVelaClient sets the Vela client in the client. +func WithVelaClient(cli *vela.Client) Opt { + return func(c *client) error { + // set the Vela client in the client + c.Vela = cli + + return nil + } +} + +// WithVersion sets the version in the client. +func WithVersion(version string) Opt { + return func(c *client) error { + // check if a version is provided + if len(version) == 0 { + // default the version + version = "v0.0.0" + } + + // set the version in the client + c.Version = version + + return nil + } +} diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go new file mode 100644 index 00000000..2d5b57ee --- /dev/null +++ b/executor/local/opts_test.go @@ -0,0 +1,297 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLocal_Opt_WithBuild(t *testing.T) { + // setup types + _build := testBuild() + + // setup tests + tests := []struct { + build *library.Build + }{ + { + build: _build, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(test.build), + ) + + if err != nil { + t.Errorf("WithBuild returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.build, _build) { + t.Errorf("WithBuild is %v, want %v", _engine.build, _build) + } + } +} + +func TestLocal_Opt_WithHostname(t *testing.T) { + // setup tests + tests := []struct { + hostname string + want string + }{ + { + hostname: "vela.worker.localhost", + want: "vela.worker.localhost", + }, + { + hostname: "", + want: "localhost", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithHostname(test.hostname), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Hostname, test.want) { + t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) + } + } +} + +func TestLocal_Opt_WithPipeline(t *testing.T) { + // setup types + _steps := testSteps() + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _steps, + }, + { + failure: true, + pipeline: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithPipeline(test.pipeline), + ) + + if test.failure { + if err == nil { + t.Errorf("WithPipeline should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithPipeline returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.pipeline, _steps) { + t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) + } + } +} + +func TestLocal_Opt_WithRepo(t *testing.T) { + // setup types + _repo := testRepo() + + // setup tests + tests := []struct { + repo *library.Repo + }{ + { + repo: _repo, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithRepo(test.repo), + ) + + if err != nil { + t.Errorf("WithRepo returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.repo, _repo) { + t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) + } + } +} + +func TestLocal_Opt_WithRuntime(t *testing.T) { + // setup types + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + runtime runtime.Engine + }{ + { + failure: false, + runtime: _runtime, + }, + { + failure: true, + runtime: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithRuntime(test.runtime), + ) + + if test.failure { + if err == nil { + t.Errorf("WithRuntime should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithRuntime returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.Runtime, _runtime) { + t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) + } + } +} + +func TestLocal_Opt_WithUser(t *testing.T) { + // setup types + _user := testUser() + + // setup tests + tests := []struct { + user *library.User + }{ + { + user: _user, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithUser(test.user), + ) + + if err != nil { + t.Errorf("WithUser returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.user, _user) { + t.Errorf("WithUser is %v, want %v", _engine.user, _user) + } + } +} + +func TestLocal_Opt_WithVelaClient(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + // setup tests + tests := []struct { + client *vela.Client + }{ + { + client: _client, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithVelaClient(test.client), + ) + + if err != nil { + t.Errorf("WithVelaClient returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.Vela, _client) { + t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) + } + } +} + +func TestLocal_Opt_WithVersion(t *testing.T) { + // setup tests + tests := []struct { + version string + want string + }{ + { + version: "v1.0.0", + want: "v1.0.0", + }, + { + version: "", + want: "v0.0.0", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithVersion(test.version), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Version, test.want) { + t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) + } + } +} diff --git a/executor/local/service.go b/executor/local/service.go new file mode 100644 index 00000000..7248502f --- /dev/null +++ b/executor/local/service.go @@ -0,0 +1,165 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "bufio" + "context" + "fmt" + "os" + "time" + + "github.com/go-vela/worker/internal/service" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +// create a service logging pattern. +const servicePattern = "[service: %s]" + +// CreateService configures the service for execution. +func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) error { + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + + // update the service container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Environment + err = service.Environment(ctn, c.build, c.repo, nil, c.Version) + if err != nil { + return err + } + + // substitute container configuration + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Substitute + err = ctn.Substitute() + if err != nil { + return err + } + + return nil +} + +// PlanService prepares the service for execution. +func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { + // update the engine service object + _service := new(library.Service) + _service.SetName(ctn.Name) + _service.SetNumber(ctn.Number) + _service.SetImage(ctn.Image) + _service.SetStatus(constants.StatusRunning) + _service.SetStarted(time.Now().UTC().Unix()) + _service.SetHost(c.build.GetHost()) + _service.SetRuntime(c.build.GetRuntime()) + _service.SetDistribution(c.build.GetDistribution()) + + // update the service container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Environment + err := service.Environment(ctn, c.build, c.repo, _service, c.Version) + if err != nil { + return err + } + + // add a service to a map + c.services.Store(ctn.ID, _service) + + return nil +} + +// ExecService runs a service. +func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error { + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + _service, err := service.Load(ctn, &c.services) + if err != nil { + return err + } + + // defer taking a snapshot of the service + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Snapshot + defer func() { service.Snapshot(ctn, c.build, nil, nil, nil, _service) }() + + // run the runtime container + err = c.Runtime.RunContainer(ctx, ctn, c.pipeline) + if err != nil { + return err + } + + go func() { + // stream logs from container + err := c.StreamService(context.Background(), ctn) + if err != nil { + fmt.Fprintln(os.Stdout, "unable to stream logs for service:", err) + } + }() + + return nil +} + +// StreamService tails the output for a service. +func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // create a service pattern for log output + _pattern := fmt.Sprintf(servicePattern, ctn.Name) + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // ensure we output to stdout + fmt.Fprintln(os.Stdout, _pattern, scanner.Text()) + } + + return scanner.Err() +} + +// DestroyService cleans up services after execution. +func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) error { + // load the service from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Load + _service, err := service.Load(ctn, &c.services) + if err != nil { + // create the service from the container + // + // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainer + _service = library.ServiceFromContainer(ctn) + } + + // defer an upload of the service + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Upload + defer func() { service.Upload(ctn, c.build, nil, nil, nil, _service) }() + + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + // remove the runtime container + err = c.Runtime.RemoveContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} diff --git a/executor/local/service_test.go b/executor/local/service_test.go new file mode 100644 index 00000000..581a1ac2 --- /dev/null +++ b/executor/local/service_test.go @@ -0,0 +1,368 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "testing" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLocal_CreateService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with image not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:notfound", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("CreateService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateService returned err: %v", err) + } + } +} + +func TestLocal_PlanService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanService returned err: %v", err) + } + } +} + +func TestLocal_ExecService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // service container with image not found + failure: true, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:notfound", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + } + + err = _engine.ExecService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecService returned err: %v", err) + } + } +} + +func TestLocal_StreamService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { // empty service container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.StreamService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("StreamService returned err: %v", err) + } + } +} + +func TestLocal_DestroyService(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic service container + failure: false, + container: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyService should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyService returned err: %v", err) + } + } +} diff --git a/executor/local/stage.go b/executor/local/stage.go new file mode 100644 index 00000000..6b807590 --- /dev/null +++ b/executor/local/stage.go @@ -0,0 +1,129 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "fmt" + "os" + "sync" + + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/step" +) + +// create a stage logging pattern. +const stagePattern = "[stage: %s][step: %s]" + +// CreateStage prepares the stage for execution. +func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { + // create a stage pattern for log output + _pattern := fmt.Sprintf(stagePattern, c.init.Name, c.init.Name) + + // output init progress to stdout + fmt.Fprintln(os.Stdout, _pattern, "> Pulling step images for stage", s.Name, "...") + + // create the steps for the stage + for _, _step := range s.Steps { + // update the container environment with stage name + _step.Environment["VELA_STEP_STAGE"] = s.Name + + // create the step + err := c.CreateStep(ctx, _step) + if err != nil { + return err + } + + // inspect the step image + image, err := c.Runtime.InspectImage(ctx, _step) + if err != nil { + return err + } + + // output the image information to stdout + fmt.Fprintln(os.Stdout, _pattern, string(image)) + } + + return nil +} + +// PlanStage prepares the stage for execution. +func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) error { + // ensure dependent stages have completed + for _, needs := range s.Needs { + // check if a dependency stage has completed + stageErr, ok := m.Load(needs) + if !ok { // stage not found so we continue + continue + } + + // wait for the stage channel to close + select { + case <-ctx.Done(): + return fmt.Errorf("errgroup context is done") + case err := <-stageErr.(chan error): + if err != nil { + return err + } + + continue + } + } + + return nil +} + +// ExecStage runs a stage. +func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) error { + // close the stage channel at the end + defer func() { + errChan, ok := m.Load(s.Name) + if !ok { + return + } + + close(errChan.(chan error)) + }() + + // execute the steps for the stage + for _, _step := range s.Steps { + // check if the step should be skipped + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip + if step.Skip(_step, c.build, c.repo) { + continue + } + + // plan the step + err := c.PlanStep(ctx, _step) + if err != nil { + return fmt.Errorf("unable to plan step %s: %w", _step.Name, err) + } + + // execute the step + err = c.ExecStep(ctx, _step) + if err != nil { + return fmt.Errorf("unable to exec step %s: %w", _step.Name, err) + } + } + + return nil +} + +// DestroyStage cleans up the stage after execution. +func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { + var err error + + // destroy the steps for the stage + for _, _step := range s.Steps { + // destroy the step + err = c.DestroyStep(ctx, _step) + if err != nil { + fmt.Fprintln(os.Stdout, "unable to destroy step: ", err) + } + } + + return err +} diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go new file mode 100644 index 00000000..ec1f04c9 --- /dev/null +++ b/executor/local/stage_test.go @@ -0,0 +1,387 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "errors" + "flag" + "sync" + "testing" + + "github.com/urfave/cli/v2" + + "github.com/go-vela/compiler/compiler/native" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/types/pipeline" +) + +func TestLocal_CreateStage(t *testing.T) { + // setup types + _file := "testdata/build/stages/basic.yml" + _build := testBuild() + _repo := testRepo() + _user := testUser() + + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(_file) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", _file, err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // stage with step container with image not found + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.CreateStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("CreateStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateStage returned err: %v", err) + } + } +} + +func TestLocal_PlanStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + testMap := new(sync.Map) + testMap.Store("foo", make(chan error, 1)) + + tm, _ := testMap.Load("foo") + tm.(chan error) <- nil + close(tm.(chan error)) + + errMap := new(sync.Map) + errMap.Store("foo", make(chan error, 1)) + + em, _ := errMap.Load("foo") + em.(chan error) <- errors.New("bar") + close(em.(chan error)) + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + stageMap *sync.Map + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: new(sync.Map), + }, + { // basic stage with nil stage map + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: testMap, + }, + { // basic stage with error stage map + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: errMap, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) + + if test.failure { + if err == nil { + t.Errorf("PlanStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanStage returned err: %v", err) + } + } +} + +func TestLocal_ExecStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + { // stage with step container with image not found + failure: true, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + } + + // run tests + for _, test := range tests { + stageMap := new(sync.Map) + stageMap.Store("echo", make(chan error)) + + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.ExecStage(context.Background(), test.stage, stageMap) + + if test.failure { + if err == nil { + t.Errorf("ExecStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecStage returned err: %v", err) + } + } +} + +func TestLocal_DestroyStage(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + stage *pipeline.Stage + }{ + { // basic stage + failure: false, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("DestroyStage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyStage returned err: %v", err) + } + } +} diff --git a/executor/local/step.go b/executor/local/step.go new file mode 100644 index 00000000..3c5d54a2 --- /dev/null +++ b/executor/local/step.go @@ -0,0 +1,224 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "bufio" + "context" + "fmt" + "os" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/step" +) + +// create a step logging pattern. +const stepPattern = "[step: %s]" + +// CreateStep configures the step for execution. +func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // setup the runtime container + err := c.Runtime.SetupContainer(ctx, ctn) + if err != nil { + return err + } + + // create a library step object to facilitate injecting environment as early as possible + // (PlanStep is too late to inject environment vars for the kubernetes runtime). + _step := c.newLibraryStep(ctn) + _step.SetStatus(constants.StatusPending) + + // update the step container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment + err = step.Environment(ctn, c.build, c.repo, _step, c.Version) + if err != nil { + return err + } + + // substitute container configuration + // + // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Substitute + err = ctn.Substitute() + if err != nil { + return err + } + + return nil +} + +// newLibraryStep creates a library step object. +func (c *client) newLibraryStep(ctn *pipeline.Container) *library.Step { + _step := new(library.Step) + _step.SetName(ctn.Name) + _step.SetNumber(ctn.Number) + _step.SetImage(ctn.Image) + _step.SetStage(ctn.Environment["VELA_STEP_STAGE"]) + _step.SetHost(c.build.GetHost()) + _step.SetRuntime(c.build.GetRuntime()) + _step.SetDistribution(c.build.GetDistribution()) + return _step +} + +// PlanStep prepares the step for execution. +func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { + // create the library step object + _step := c.newLibraryStep(ctn) + _step.SetStatus(constants.StatusRunning) + _step.SetStarted(time.Now().UTC().Unix()) + + // update the step container environment + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Environment + err := step.Environment(ctn, c.build, c.repo, _step, c.Version) + if err != nil { + return err + } + + // add the step to the client map + c.steps.Store(ctn.ID, _step) + + return nil +} + +// ExecStep runs a step. +func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _step, err := step.Load(ctn, &c.steps) + if err != nil { + return err + } + + // defer taking a snapshot of the step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Snapshot + defer func() { step.Snapshot(ctn, c.build, nil, nil, nil, _step) }() + + // run the runtime container + err = c.Runtime.RunContainer(ctx, ctn, c.pipeline) + if err != nil { + return err + } + + go func() { + // stream logs from container + err := c.StreamStep(context.Background(), ctn) + if err != nil { + // TODO: Should this be changed or removed? + fmt.Println(err) + } + }() + + // do not wait for detached containers + if ctn.Detach { + return nil + } + + // wait for the runtime container + err = c.Runtime.WaitContainer(ctx, ctn) + if err != nil { + return err + } + + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} + +// StreamStep tails the output for a step. +func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // tail the runtime container + rc, err := c.Runtime.TailContainer(ctx, ctn) + if err != nil { + return err + } + defer rc.Close() + + // create a step pattern for log output + _pattern := fmt.Sprintf(stepPattern, ctn.Name) + + // check if the container provided is for stages + _stage, ok := ctn.Environment["VELA_STEP_STAGE"] + if ok { + // check if the stage name is set + if len(_stage) > 0 { + // create a stage pattern for log output + _pattern = fmt.Sprintf(stagePattern, _stage, ctn.Name) + } + } + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // ensure we output to stdout + fmt.Fprintln(os.Stdout, _pattern, scanner.Text()) + } + + return scanner.Err() +} + +// DestroyStep cleans up steps after execution. +func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error { + // TODO: remove hardcoded reference + if ctn.Name == "init" { + return nil + } + + // load the step from the client + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Load + _step, err := step.Load(ctn, &c.steps) + if err != nil { + // create the step from the container + // + // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainer + _step = library.StepFromContainer(ctn) + } + + // defer an upload of the step + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Upload + defer func() { step.Upload(ctn, c.build, nil, nil, nil, _step) }() + + // inspect the runtime container + err = c.Runtime.InspectContainer(ctx, ctn) + if err != nil { + return err + } + + // remove the runtime container + err = c.Runtime.RemoveContainer(ctx, ctn) + if err != nil { + return err + } + + return nil +} diff --git a/executor/local/step_test.go b/executor/local/step_test.go new file mode 100644 index 00000000..e6f08ae8 --- /dev/null +++ b/executor/local/step_test.go @@ -0,0 +1,427 @@ +// Copyright (c) 1011 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package local + +import ( + "context" + "testing" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" +) + +func TestLocal_CreateStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with image not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("CreateStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateStep returned err: %v", err) + } + } +} + +func TestLocal_PlanStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.PlanStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("PlanStep returned err: %v", err) + } + } +} + +func TestLocal_ExecStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // detached step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // step container with image not found + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:notfound", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + } + + err = _engine.ExecStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("ExecStep returned err: %v", err) + } + } +} + +func TestLocal_StreamStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // basic stage container + failure: false, + container: &pipeline.Container{ + ID: "github_octocat_1_echo_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"VELA_STEP_STAGE": "foo"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + { // empty step container + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.StreamStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("StreamStep returned err: %v", err) + } + } +} + +func TestLocal_DestroyStep(t *testing.T) { + // setup types + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { // init step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // basic step container + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.DestroyStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyStep should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("DestroyStep returned err: %v", err) + } + } +} diff --git a/executor/local/testdata/build/empty.yml b/executor/local/testdata/build/empty.yml new file mode 100644 index 00000000..73b314ff --- /dev/null +++ b/executor/local/testdata/build/empty.yml @@ -0,0 +1 @@ +--- \ No newline at end of file diff --git a/executor/local/testdata/build/services/basic.yml b/executor/local/testdata/build/services/basic.yml new file mode 100644 index 00000000..0c0f8699 --- /dev/null +++ b/executor/local/testdata/build/services/basic.yml @@ -0,0 +1,18 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:latest + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/services/img_ignorenotfound.yml b/executor/local/testdata/build/services/img_ignorenotfound.yml new file mode 100644 index 00000000..324248ca --- /dev/null +++ b/executor/local/testdata/build/services/img_ignorenotfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:ignorenotfound + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/local/testdata/build/services/img_notfound.yml b/executor/local/testdata/build/services/img_notfound.yml new file mode 100644 index 00000000..5378fe7f --- /dev/null +++ b/executor/local/testdata/build/services/img_notfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: postgres + environment: + FOO: bar + image: postgres:notfound + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/local/testdata/build/services/name_notfound.yml b/executor/local/testdata/build/services/name_notfound.yml new file mode 100644 index 00000000..3dd1998b --- /dev/null +++ b/executor/local/testdata/build/services/name_notfound.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: notfound + environment: + FOO: bar + image: postgres:latest + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/local/testdata/build/stages/basic.yml b/executor/local/testdata/build/stages/basic.yml new file mode 100644 index 00000000..f49e1750 --- /dev/null +++ b/executor/local/testdata/build/stages/basic.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/stages/img_ignorenotfound.yml b/executor/local/testdata/build/stages/img_ignorenotfound.yml new file mode 100644 index 00000000..e261e316 --- /dev/null +++ b/executor/local/testdata/build/stages/img_ignorenotfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:ignorenotfound + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/stages/img_notfound.yml b/executor/local/testdata/build/stages/img_notfound.yml new file mode 100644 index 00000000..1639a4f6 --- /dev/null +++ b/executor/local/testdata/build/stages/img_notfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:notfound + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/stages/name_notfound.yml b/executor/local/testdata/build/stages/name_notfound.yml new file mode 100644 index 00000000..69216319 --- /dev/null +++ b/executor/local/testdata/build/stages/name_notfound.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: notfound + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/steps/basic.yml b/executor/local/testdata/build/steps/basic.yml new file mode 100644 index 00000000..10852530 --- /dev/null +++ b/executor/local/testdata/build/steps/basic.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/steps/img_ignorenotfound.yml b/executor/local/testdata/build/steps/img_ignorenotfound.yml new file mode 100644 index 00000000..539fac96 --- /dev/null +++ b/executor/local/testdata/build/steps/img_ignorenotfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:ignorenotfound + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/steps/img_notfound.yml b/executor/local/testdata/build/steps/img_notfound.yml new file mode 100644 index 00000000..20d1b53a --- /dev/null +++ b/executor/local/testdata/build/steps/img_notfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:notfound + pull: true + \ No newline at end of file diff --git a/executor/local/testdata/build/steps/name_notfound.yml b/executor/local/testdata/build/steps/name_notfound.yml new file mode 100644 index 00000000..735fce7c --- /dev/null +++ b/executor/local/testdata/build/steps/name_notfound.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: notfound + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/setup.go b/executor/setup.go new file mode 100644 index 00000000..bedbd415 --- /dev/null +++ b/executor/setup.go @@ -0,0 +1,159 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "fmt" + "strings" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/worker/executor/linux" + "github.com/go-vela/worker/executor/local" + + "github.com/go-vela/pkg-runtime/runtime" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +// Setup represents the configuration necessary for +// creating a Vela engine capable of integrating +// with a configured executor. +type Setup struct { + // Executor Configuration + + // specifies the executor driver to use + Driver string + // specifies the executor hostname + Hostname string + // specifies the executor version + Version string + // API client for sending requests to Vela + Client *vela.Client + // engine used for creating runtime resources + Runtime runtime.Engine + + // Vela Resource Configuration + + // resource for storing build information in Vela + Build *library.Build + // resource for storing pipeline information in Vela + Pipeline *pipeline.Build + // resource for storing repo information in Vela + Repo *library.Repo + // resource for storing user information in Vela + User *library.User +} + +// Darwin creates and returns a Vela engine capable of +// integrating with a Darwin executor. +func (s *Setup) Darwin() (Engine, error) { + logrus.Trace("creating darwin executor client from setup") + + return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverDarwin) +} + +// Linux creates and returns a Vela engine capable of +// integrating with a Linux executor. +func (s *Setup) Linux() (Engine, error) { + logrus.Trace("creating linux executor client from setup") + + // create new Linux executor engine + // + // https://pkg.go.dev/github.com/go-vela/worker/executor/linux?tab=doc#New + return linux.New( + linux.WithBuild(s.Build), + linux.WithHostname(s.Hostname), + linux.WithPipeline(s.Pipeline), + linux.WithRepo(s.Repo), + linux.WithRuntime(s.Runtime), + linux.WithUser(s.User), + linux.WithVelaClient(s.Client), + linux.WithVersion(s.Version), + ) +} + +// Local creates and returns a Vela engine capable of +// integrating with a local executor. +func (s *Setup) Local() (Engine, error) { + logrus.Trace("creating local executor client from setup") + + // create new Local executor engine + // + // https://pkg.go.dev/github.com/go-vela/worker/executor/local?tab=doc#New + return local.New( + local.WithBuild(s.Build), + local.WithHostname(s.Hostname), + local.WithPipeline(s.Pipeline), + local.WithRepo(s.Repo), + local.WithRuntime(s.Runtime), + local.WithUser(s.User), + local.WithVelaClient(s.Client), + local.WithVersion(s.Version), + ) +} + +// Windows creates and returns a Vela engine capable of +// integrating with a Windows executor. +func (s *Setup) Windows() (Engine, error) { + logrus.Trace("creating windows executor client from setup") + + return nil, fmt.Errorf("unsupported executor driver: %s", constants.DriverWindows) +} + +// Validate verifies the necessary fields for the +// provided configuration are populated correctly. +func (s *Setup) Validate() error { + logrus.Trace("validating executor setup for client") + + // check if an executor driver was provided + if len(s.Driver) == 0 { + return fmt.Errorf("no executor driver provided in setup") + } + + // check if a Vela pipeline was provided + if s.Pipeline == nil { + return fmt.Errorf("no Vela pipeline provided in setup") + } + + // check if a runtime engine was provided + if s.Runtime == nil { + return fmt.Errorf("no runtime engine provided in setup") + } + + // check if the local driver is provided + if strings.EqualFold(constants.DriverLocal, s.Driver) { + // all other fields are not required + // for the local executor + return nil + } + + // check if a Vela client was provided + if s.Client == nil { + return fmt.Errorf("no Vela client provided in setup") + } + + // check if a Vela build was provided + if s.Build == nil { + return fmt.Errorf("no Vela build provided in setup") + } + + // check if a Vela repo was provided + if s.Repo == nil { + return fmt.Errorf("no Vela repo provided in setup") + } + + // check if a Vela user was provided + if s.User == nil { + return fmt.Errorf("no Vela user provided in setup") + } + + // setup is valid + return nil +} diff --git a/executor/setup_test.go b/executor/setup_test.go new file mode 100644 index 00000000..c56496cc --- /dev/null +++ b/executor/setup_test.go @@ -0,0 +1,339 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package executor + +import ( + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/mock/server" + + "github.com/go-vela/worker/executor/linux" + "github.com/go-vela/worker/executor/local" + + "github.com/go-vela/pkg-runtime/runtime/docker" + + "github.com/go-vela/sdk-go/vela" + + "github.com/go-vela/types/constants" +) + +func TestExecutor_Setup_Darwin(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _setup := &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverDarwin, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + } + + got, err := _setup.Darwin() + if err == nil { + t.Errorf("Darwin should have returned err") + } + + if got != nil { + t.Errorf("Darwin is %v, want nil", got) + } +} + +func TestExecutor_Setup_Linux(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want, err := linux.New( + linux.WithBuild(_build), + linux.WithHostname("localhost"), + linux.WithPipeline(_pipeline), + linux.WithRepo(_repo), + linux.WithRuntime(_runtime), + linux.WithUser(_user), + linux.WithVelaClient(_client), + linux.WithVersion("v1.0.0"), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + _setup := &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Hostname: "localhost", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + } + + // run test + got, err := _setup.Linux() + if err != nil { + t.Errorf("Linux returned err: %v", err) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Linux is %v, want %v", got, want) + } +} + +func TestExecutor_Setup_Local(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want, err := local.New( + local.WithBuild(_build), + local.WithHostname("localhost"), + local.WithPipeline(_pipeline), + local.WithRepo(_repo), + local.WithRuntime(_runtime), + local.WithUser(_user), + local.WithVelaClient(_client), + local.WithVersion("v1.0.0"), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + _setup := &Setup{ + Build: _build, + Client: _client, + Driver: "local", + Hostname: "localhost", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", + } + + // run test + got, err := _setup.Local() + if err != nil { + t.Errorf("Local returned err: %v", err) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("Local is %v, want %v", got, want) + } +} + +func TestExecutor_Setup_Windows(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _setup := &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverWindows, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + } + + got, err := _setup.Windows() + if err == nil { + t.Errorf("Windows should have returned err") + } + + if got != nil { + t.Errorf("Windows is %v, want nil", got) + } +} + +func TestExecutor_Setup_Validate(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + setup *Setup + failure bool + }{ + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: false, + }, + { + setup: &Setup{ + Build: nil, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: nil, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: "", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: nil, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: nil, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: nil, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: nil, + }, + failure: true, + }, + } + + // run tests + for _, test := range tests { + err = test.setup.Validate() + + if test.failure { + if err == nil { + t.Errorf("Validate should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Validate returned err: %v", err) + } + } +} diff --git a/go.mod b/go.mod index 48e88967..8d6af872 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,13 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/gin-gonic/gin v1.7.4 + github.com/go-vela/compiler v0.10.0 github.com/go-vela/mock v0.10.0 - github.com/go-vela/pkg-executor v0.10.0 github.com/go-vela/pkg-queue v0.10.0 - github.com/go-vela/pkg-runtime v0.10.0 + github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785 github.com/go-vela/sdk-go v0.10.0 github.com/go-vela/types v0.10.0 + github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index dd3a123b..86a720f7 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= @@ -164,12 +165,10 @@ github.com/go-vela/compiler v0.10.0 h1:dFilpf5A+tiJWibILE2kHnAa+UEFDZgv/9lDwd0+n github.com/go-vela/compiler v0.10.0/go.mod h1:Zq1L6qXsV/h5kWO5A3boGzFWvXk7he6FO2hcMVuSupw= github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= -github.com/go-vela/pkg-executor v0.10.0 h1:7zPysuDj7oi6E056IEkU66KOYA2SIc32Kqgm1lnn0pE= -github.com/go-vela/pkg-executor v0.10.0/go.mod h1:voWCsAoHZb8HUSEcrTGYNHRh1IUBXWlovFVAWnF8xXo= github.com/go-vela/pkg-queue v0.10.0 h1:cxpkyVuX+ZJuF9t7XEQuHOFBa776SNgraEsFpnWI03E= github.com/go-vela/pkg-queue v0.10.0/go.mod h1:ZtkPoazVfpKK/ePdea/2s2LpNWDrc19nqmn1hPI3jxY= -github.com/go-vela/pkg-runtime v0.10.0 h1:ycjK0mSrM+sAwOtENKjKMGMTGkx4xkc/zMA0JIr9T0k= -github.com/go-vela/pkg-runtime v0.10.0/go.mod h1:ffabnvUkIEY/5r1XFep40HdCqrHp4OxmzbbY3W7g6C4= +github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785 h1:VByvQACNppX/P74CfgSr+E0+HuOCMXnDHZYFiF9HdCs= +github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785/go.mod h1:7KV1aAufGNpGbbLLsD7W7z8gc50fXdIK03NPM+SClg8= github.com/go-vela/sdk-go v0.10.0 h1:monESdM738WeY2MKlj0COGK0W/f1PIGwp8K4tClfLlo= github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/types v0.10.0-rc3/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= @@ -266,6 +265,7 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= @@ -312,6 +312,7 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= diff --git a/router/middleware/executor.go b/router/middleware/executor.go index e36027c8..c5f53eb1 100644 --- a/router/middleware/executor.go +++ b/router/middleware/executor.go @@ -7,7 +7,7 @@ package middleware import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/worker/executor" ) // Executors is a middleware function that attaches the diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index 5aa4bcc2..3b558b27 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -11,8 +11,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/types" + "github.com/go-vela/worker/executor" "github.com/sirupsen/logrus" ) diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 18298d8d..cf703562 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -12,12 +12,12 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/executor" ) func TestExecutor_Retrieve(t *testing.T) { diff --git a/router/middleware/executor_test.go b/router/middleware/executor_test.go index 187b2538..7e4d40a0 100644 --- a/router/middleware/executor_test.go +++ b/router/middleware/executor_test.go @@ -12,7 +12,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-executor/executor" + "github.com/go-vela/worker/executor" ) func TestMiddleware_Executors(t *testing.T) { From 6cd4db0f42d65ddb435c9e7890e8e99c535c3958 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 26 Oct 2021 14:50:18 -0500 Subject: [PATCH 204/430] feat(internal): add logic from pkg-runtime (#221) --- go.mod | 1 + internal/image/doc.go | 11 ++ internal/image/image.go | 87 +++++++++++++++ internal/image/image_test.go | 188 +++++++++++++++++++++++++++++++++ internal/volume/doc.go | 11 ++ internal/volume/volume.go | 70 ++++++++++++ internal/volume/volume_test.go | 140 ++++++++++++++++++++++++ 7 files changed, 508 insertions(+) create mode 100644 internal/image/doc.go create mode 100644 internal/image/image.go create mode 100644 internal/image/image_test.go create mode 100644 internal/volume/doc.go create mode 100644 internal/volume/volume.go create mode 100644 internal/volume/volume_test.go diff --git a/go.mod b/go.mod index 8d6af872..d3055291 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 + github.com/docker/distribution v2.7.1+incompatible github.com/gin-gonic/gin v1.7.4 github.com/go-vela/compiler v0.10.0 github.com/go-vela/mock v0.10.0 diff --git a/internal/image/doc.go b/internal/image/doc.go new file mode 100644 index 00000000..d740349f --- /dev/null +++ b/internal/image/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package image provides the ability for Vela to manage +// and manipulate an image provided for a container. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/image" +package image diff --git a/internal/image/image.go b/internal/image/image.go new file mode 100644 index 00000000..6175ff18 --- /dev/null +++ b/internal/image/image.go @@ -0,0 +1,87 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package image + +import ( + "github.com/docker/distribution/reference" +) + +// Parse digests the provided image into a fully +// qualified canonical reference. If an error +// occurs, it will return the provided image. +func Parse(_image string) string { + // parse the image provided into a fully qualified canonical reference + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/internal/image?tab=doc#ParseWithError + _canonical, err := ParseWithError(_image) + if err != nil { + return _image + } + + return _canonical +} + +// ParseWithError digests the provided image into a +// fully qualified canonical reference. If an error +// occurs, it will return the last digested form of +// the image. +func ParseWithError(_image string) (string, error) { + // parse the image provided into a + // named, fully qualified reference + // + // https://pkg.go.dev/github.com/docker/distribution/reference?tab=doc#ParseAnyReference + _reference, err := reference.ParseAnyReference(_image) + if err != nil { + return _image, err + } + + // ensure we have the canonical form of the named reference + // + // https://pkg.go.dev/github.com/docker/distribution/reference?tab=doc#ParseNamed + _canonical, err := reference.ParseNamed(_reference.String()) + if err != nil { + return _reference.String(), err + } + + // ensure the canonical reference has a tag + // + // https://pkg.go.dev/github.com/docker/distribution/reference?tab=doc#TagNameOnly + return reference.TagNameOnly(_canonical).String(), nil +} + +// IsPrivilegedImage digests the provided image with a +// privileged pattern to see if the image meets the criteria +// needed to allow a Docker Socket mount. +func IsPrivilegedImage(image, privileged string) (bool, error) { + // parse the image provided into a + // named, fully qualified reference + // + // https://pkg.go.dev/github.com/docker/distribution/reference?tab=doc#ParseAnyReference + _refImg, err := reference.ParseAnyReference(image) + if err != nil { + return false, err + } + + // ensure we have the canonical form of the named reference + // + // https://pkg.go.dev/github.com/docker/distribution/reference?tab=doc#ParseNamed + _canonical, err := reference.ParseNamed(_refImg.String()) + if err != nil { + return false, err + } + + // add default tag "latest" when tag does not exist + _refImg = reference.TagNameOnly(_canonical) + + // check if the image matches the privileged pattern + // + // https://pkg.go.dev/github.com/docker/distribution/reference#FamiliarMatch + match, err := reference.FamiliarMatch(privileged, _refImg) + if err != nil { + return false, err + } + + return match, nil +} diff --git a/internal/image/image_test.go b/internal/image/image_test.go new file mode 100644 index 00000000..999ba3f3 --- /dev/null +++ b/internal/image/image_test.go @@ -0,0 +1,188 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package image + +import ( + "strings" + "testing" +) + +func TestImage_Parse(t *testing.T) { + // setup tests + tests := []struct { + image string + want string + }{ + { + image: "golang", + want: "docker.io/library/golang:latest", + }, + { + image: "golang:latest", + want: "docker.io/library/golang:latest", + }, + { + image: "library/golang", + want: "docker.io/library/golang:latest", + }, + { + image: "library/golang:1.14", + want: "docker.io/library/golang:1.14", + }, + { + image: "docker.io/library/golang", + want: "docker.io/library/golang:latest", + }, + { + image: "docker.io/library/golang:latest", + want: "docker.io/library/golang:latest", + }, + { + image: "index.docker.io/library/golang", + want: "docker.io/library/golang:latest", + }, + { + image: "index.docker.io/library/golang:latest", + want: "docker.io/library/golang:latest", + }, + { + image: "gcr.io/library/golang", + want: "gcr.io/library/golang:latest", + }, + { + image: "gcr.io/library/golang:latest", + want: "gcr.io/library/golang:latest", + }, + { + image: "!@#$%^&*()", + want: "!@#$%^&*()", + }, + } + + // run tests + for _, test := range tests { + got := Parse(test.image) + + if !strings.EqualFold(got, test.want) { + t.Errorf("Parse is %s want %s", got, test.want) + } + } +} + +func TestImage_ParseWithError(t *testing.T) { + // setup tests + tests := []struct { + failure bool + image string + want string + }{ + { + failure: false, + image: "golang", + want: "docker.io/library/golang:latest", + }, + { + failure: false, + image: "golang:latest", + want: "docker.io/library/golang:latest", + }, + { + failure: false, + image: "golang:1.14", + want: "docker.io/library/golang:1.14", + }, + { + failure: true, + image: "!@#$%^&*()", + want: "!@#$%^&*()", + }, + { + failure: true, + image: "1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a", + want: "sha256:1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a", + }, + } + + // run tests + for _, test := range tests { + got, err := ParseWithError(test.image) + + if test.failure { + if err == nil { + t.Errorf("ParseWithError should have returned err") + } + + if !strings.EqualFold(got, test.want) { + t.Errorf("ParseWithError is %s want %s", got, test.want) + } + + continue + } + + if err != nil { + t.Errorf("ParseWithError returned err: %v", err) + } + + if !strings.EqualFold(got, test.want) { + t.Errorf("ParseWithError is %s want %s", got, test.want) + } + } +} + +func TestImage_IsPrivilegedImage(t *testing.T) { + // setup tests + tests := []struct { + name string + image string + pattern string + want bool + }{ + { + name: "test privileged image without tag", + image: "docker.company.com/foo/bar", + pattern: "docker.company.com/foo/bar", + want: true, + }, + { + name: "test privileged image with tag", + image: "docker.company.com/foo/bar:v0.1.0", + pattern: "docker.company.com/foo/bar", + want: true, + }, + { + name: "test privileged image with tag", + image: "docker.company.com/foo/bar", + pattern: "docker.company.com/foo/bar:v0.1.0", + want: false, + }, + { + name: "test privileged with bad image", + image: "!@#$%^&*()", + pattern: "docker.company.com/foo/bar", + want: false, + }, + { + name: "test privileged with bad pattern", + image: "docker.company.com/foo/bar", + pattern: "!@#$%^&*()", + want: false, + }, + { + name: "test privileged with on extended path image", + image: "docker.company.com/foo/bar", + pattern: "docker.company.com/foo", + want: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + got, _ := IsPrivilegedImage(test.image, test.pattern) + if got != test.want { + t.Errorf("IsPrivilegedImage is %v want %v", got, test.want) + } + }) + } +} diff --git a/internal/volume/doc.go b/internal/volume/doc.go new file mode 100644 index 00000000..e1f59b80 --- /dev/null +++ b/internal/volume/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package volume provides the ability for Vela to manage +// and manipulate a volume provided for a container. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/volume" +package volume diff --git a/internal/volume/volume.go b/internal/volume/volume.go new file mode 100644 index 00000000..d2f531ea --- /dev/null +++ b/internal/volume/volume.go @@ -0,0 +1,70 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package volume + +import ( + "fmt" + "strings" +) + +// Volume represents the volume definition used +// to create volumes for a container. +type Volume struct { + Source string `json:"source,omitempty"` + Destination string `json:"destination,omitempty"` + AccessMode string `json:"access_mode,omitempty"` +} + +// Parse digests the provided volume into a fully +// qualified volume reference. If an error +// occurs, it will return a nil volume. +func Parse(_volume string) *Volume { + // parse the image provided into a fully qualified canonical reference + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/internal/image?tab=doc#ParseWithError + v, err := ParseWithError(_volume) + if err != nil { + return nil + } + + return v +} + +// ParseWithError digests the provided volume into a +// fully qualified volume reference. If an error +// occurs, it will return a nil volume and the +// produced error. +func ParseWithError(_volume string) (*Volume, error) { + // split each slice element into source, destination and access mode + parts := strings.Split(_volume, ":") + + switch len(parts) { + case 1: + // return the read-only volume with the same source and destination + return &Volume{ + Source: parts[0], + Destination: parts[0], + AccessMode: "ro", + }, nil + // nolint: gomnd // ignore magic number + case 2: + // return the read-only volume with different source and destination + return &Volume{ + Source: parts[0], + Destination: parts[1], + AccessMode: "ro", + }, nil + // nolint: gomnd // ignore magic number + case 3: + // return the full volume with source, destination and access mode + return &Volume{ + Source: parts[0], + Destination: parts[1], + AccessMode: parts[2], + }, nil + default: + return nil, fmt.Errorf("volume %s requires at least 1, but no more than 2, `:`", _volume) + } +} diff --git a/internal/volume/volume_test.go b/internal/volume/volume_test.go new file mode 100644 index 00000000..f1fa9f22 --- /dev/null +++ b/internal/volume/volume_test.go @@ -0,0 +1,140 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package volume + +import ( + "reflect" + "testing" +) + +func TestVolume_Parse(t *testing.T) { + // setup tests + tests := []struct { + volume string + want *Volume + }{ + { + volume: "/foo", + want: &Volume{ + Source: "/foo", + Destination: "/foo", + AccessMode: "ro", + }, + }, + { + volume: "/foo:/bar", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "ro", + }, + }, + { + volume: "/foo:/bar:ro", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "ro", + }, + }, + { + volume: "/foo:/bar:rw", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "rw", + }, + }, + { + volume: "/foo:/bar:/foo:bar", + want: nil, + }, + } + + // run tests + for _, test := range tests { + got := Parse(test.volume) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Parse is %v, want %v", got, test.want) + } + } +} + +func TestImage_ParseWithError(t *testing.T) { + // setup tests + tests := []struct { + failure bool + volume string + want *Volume + }{ + { + failure: false, + volume: "/foo", + want: &Volume{ + Source: "/foo", + Destination: "/foo", + AccessMode: "ro", + }, + }, + { + failure: false, + volume: "/foo:/bar", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "ro", + }, + }, + { + failure: false, + volume: "/foo:/bar:ro", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "ro", + }, + }, + { + failure: false, + volume: "/foo:/bar:rw", + want: &Volume{ + Source: "/foo", + Destination: "/bar", + AccessMode: "rw", + }, + }, + { + failure: true, + volume: "/foo:/bar:/foo:bar", + want: nil, + }, + } + + // run tests + for _, test := range tests { + got, err := ParseWithError(test.volume) + + if test.failure { + if err == nil { + t.Errorf("ParseWithError should have returned err") + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("ParseWithError is %s want %s", got, test.want) + } + + continue + } + + if err != nil { + t.Errorf("ParseWithError returned err: %v", err) + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("ParseWithError is %v, want %v", got, test.want) + } + } +} From 69c1ccada2288910b1d76497f51ac29489ad5c61 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 27 Oct 2021 11:02:38 -0500 Subject: [PATCH 205/430] feat(runtime): add logic from pkg-runtime (#222) --- cmd/vela-worker/exec.go | 4 +- cmd/vela-worker/flags.go | 2 +- cmd/vela-worker/run.go | 2 +- cmd/vela-worker/validate.go | 2 +- cmd/vela-worker/worker.go | 2 +- executor/context_test.go | 2 +- executor/executor_test.go | 2 +- executor/linux/build_test.go | 2 +- executor/linux/driver_test.go | 2 +- executor/linux/linux.go | 2 +- executor/linux/linux_test.go | 2 +- executor/linux/opts.go | 2 +- executor/linux/opts_test.go | 4 +- executor/linux/secret_test.go | 2 +- executor/linux/service_test.go | 2 +- executor/linux/stage_test.go | 2 +- executor/linux/step_test.go | 2 +- executor/local/build_test.go | 2 +- executor/local/driver_test.go | 2 +- executor/local/local.go | 2 +- executor/local/local_test.go | 2 +- executor/local/opts.go | 2 +- executor/local/opts_test.go | 4 +- executor/local/service_test.go | 2 +- executor/local/stage_test.go | 2 +- executor/local/step_test.go | 2 +- executor/setup.go | 2 +- executor/setup_test.go | 2 +- go.mod | 12 +- go.sum | 5 - router/middleware/executor/executor_test.go | 2 +- runtime/context.go | 67 +++ runtime/context_test.go | 142 +++++ runtime/doc.go | 17 + runtime/docker/build.go | 45 ++ runtime/docker/build_test.go | 154 +++++ runtime/docker/container.go | 355 ++++++++++++ runtime/docker/container_test.go | 389 +++++++++++++ runtime/docker/doc.go | 11 + runtime/docker/docker.go | 109 ++++ runtime/docker/docker_test.go | 117 ++++ runtime/docker/driver.go | 12 + runtime/docker/driver_test.go | 29 + runtime/docker/image.go | 92 +++ runtime/docker/image_test.go | 64 +++ runtime/docker/network.go | 110 ++++ runtime/docker/network_test.go | 132 +++++ runtime/docker/opts.go | 36 ++ runtime/docker/opts_test.go | 74 +++ runtime/docker/volume.go | 150 +++++ runtime/docker/volume_test.go | 132 +++++ runtime/engine.go | 92 +++ runtime/flags.go | 70 +++ runtime/kubernetes/build.go | 171 ++++++ runtime/kubernetes/build_test.go | 226 ++++++++ runtime/kubernetes/container.go | 382 ++++++++++++ runtime/kubernetes/container_test.go | 336 +++++++++++ runtime/kubernetes/doc.go | 11 + runtime/kubernetes/driver.go | 12 + runtime/kubernetes/driver_test.go | 29 + runtime/kubernetes/image.go | 67 +++ runtime/kubernetes/image_test.go | 48 ++ runtime/kubernetes/kubernetes.go | 130 +++++ runtime/kubernetes/kubernetes_test.go | 316 ++++++++++ runtime/kubernetes/network.go | 124 ++++ runtime/kubernetes/network_test.go | 132 +++++ runtime/kubernetes/opts.go | 67 +++ runtime/kubernetes/opts_test.go | 163 ++++++ runtime/kubernetes/testdata/config | 18 + runtime/kubernetes/testdata/config_empty | 0 runtime/kubernetes/volume.go | 174 ++++++ runtime/kubernetes/volume_test.go | 136 +++++ runtime/runtime.go | 50 ++ runtime/runtime_test.go | 63 ++ runtime/setup.go | 89 +++ runtime/setup_test.go | 91 +++ runtime/testdata/config | 18 + runtime/testdata/large.yml | 605 ++++++++++++++++++++ runtime/testdata/stages.yml | 13 + runtime/testdata/steps.yml | 32 ++ 80 files changed, 5945 insertions(+), 38 deletions(-) create mode 100644 runtime/context.go create mode 100644 runtime/context_test.go create mode 100644 runtime/doc.go create mode 100644 runtime/docker/build.go create mode 100644 runtime/docker/build_test.go create mode 100644 runtime/docker/container.go create mode 100644 runtime/docker/container_test.go create mode 100644 runtime/docker/doc.go create mode 100644 runtime/docker/docker.go create mode 100644 runtime/docker/docker_test.go create mode 100644 runtime/docker/driver.go create mode 100644 runtime/docker/driver_test.go create mode 100644 runtime/docker/image.go create mode 100644 runtime/docker/image_test.go create mode 100644 runtime/docker/network.go create mode 100644 runtime/docker/network_test.go create mode 100644 runtime/docker/opts.go create mode 100644 runtime/docker/opts_test.go create mode 100644 runtime/docker/volume.go create mode 100644 runtime/docker/volume_test.go create mode 100644 runtime/engine.go create mode 100644 runtime/flags.go create mode 100644 runtime/kubernetes/build.go create mode 100644 runtime/kubernetes/build_test.go create mode 100644 runtime/kubernetes/container.go create mode 100644 runtime/kubernetes/container_test.go create mode 100644 runtime/kubernetes/doc.go create mode 100644 runtime/kubernetes/driver.go create mode 100644 runtime/kubernetes/driver_test.go create mode 100644 runtime/kubernetes/image.go create mode 100644 runtime/kubernetes/image_test.go create mode 100644 runtime/kubernetes/kubernetes.go create mode 100644 runtime/kubernetes/kubernetes_test.go create mode 100644 runtime/kubernetes/network.go create mode 100644 runtime/kubernetes/network_test.go create mode 100644 runtime/kubernetes/opts.go create mode 100644 runtime/kubernetes/opts_test.go create mode 100644 runtime/kubernetes/testdata/config create mode 100644 runtime/kubernetes/testdata/config_empty create mode 100644 runtime/kubernetes/volume.go create mode 100644 runtime/kubernetes/volume_test.go create mode 100644 runtime/runtime.go create mode 100644 runtime/runtime_test.go create mode 100644 runtime/setup.go create mode 100644 runtime/setup_test.go create mode 100644 runtime/testdata/config create mode 100644 runtime/testdata/large.yml create mode 100644 runtime/testdata/stages.yml create mode 100644 runtime/testdata/steps.yml diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index b0986742..c2166e8e 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -8,8 +8,8 @@ import ( "context" "time" - "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/version" "github.com/sirupsen/logrus" @@ -27,7 +27,7 @@ func (w *Worker) exec(index int) error { // setup the runtime // - // https://pkg.go.dev/github.com/go-vela/pkg-runtime/runtime?tab=doc#New + // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#New w.Runtime, err = runtime.New(w.Config.Runtime) if err != nil { return err diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index e47d0b30..38696c2e 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -8,8 +8,8 @@ import ( "time" "github.com/go-vela/pkg-queue/queue" - "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/runtime" "github.com/urfave/cli/v2" ) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 6574c62c..e81f2bf5 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -11,8 +11,8 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/pkg-queue/queue" - "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 36116a16..ab42a971 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -72,7 +72,7 @@ func (w *Worker) Validate() error { // verify the runtime configuration // - // https://godoc.org/github.com/go-vela/pkg-runtime/runtime#Setup.Validate + // https://godoc.org/github.com/go-vela/worker/runtime#Setup.Validate err = w.Config.Runtime.Validate() if err != nil { return err diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index d05af002..20b25e7d 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -9,9 +9,9 @@ import ( "time" "github.com/go-vela/pkg-queue/queue" - "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/runtime" ) type ( diff --git a/executor/context_test.go b/executor/context_test.go index cb98e237..4ccee9a6 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -16,7 +16,7 @@ import ( "github.com/go-vela/worker/executor/linux" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" ) diff --git a/executor/executor_test.go b/executor/executor_test.go index ad55ff88..8995ca6f 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -16,7 +16,7 @@ import ( "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index ad937865..0cc4a4b0 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-vela/mock/server" "github.com/urfave/cli/v2" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go index a1e826b3..02b60e25 100644 --- a/executor/linux/driver_test.go +++ b/executor/linux/driver_test.go @@ -11,9 +11,9 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/constants" + "github.com/go-vela/worker/runtime/docker" ) func TestLinux_Driver(t *testing.T) { diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 80d020e8..fea5eeea 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -7,7 +7,7 @@ package linux import ( "sync" - "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 073ce616..c6541bde 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/mock/server" "github.com/go-vela/types" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 179cafdd..8dcd266b 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -7,7 +7,7 @@ package linux import ( "fmt" - "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 1894e0d6..4e25e2fd 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -13,8 +13,8 @@ import ( "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index a1bcd3b6..a9eed01e 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -17,7 +17,7 @@ import ( "github.com/go-vela/compiler/compiler/native" "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 5b39eba7..bec3f492 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 8b7084b5..469ffc27 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -18,7 +18,7 @@ import ( "github.com/go-vela/compiler/compiler/native" "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 314ca550..e5dd7a89 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/local/build_test.go b/executor/local/build_test.go index 527f1748..f1249bb8 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-vela/compiler/compiler/native" "github.com/urfave/cli/v2" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" ) func TestLocal_CreateBuild(t *testing.T) { diff --git a/executor/local/driver_test.go b/executor/local/driver_test.go index 23a43c92..4f19c178 100644 --- a/executor/local/driver_test.go +++ b/executor/local/driver_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/types/constants" + "github.com/go-vela/worker/runtime/docker" ) func TestLocal_Driver(t *testing.T) { diff --git a/executor/local/local.go b/executor/local/local.go index 67668744..801b7ce8 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -7,10 +7,10 @@ package local import ( "sync" - "github.com/go-vela/pkg-runtime/runtime" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime" ) type ( diff --git a/executor/local/local_test.go b/executor/local/local_test.go index b21ed525..0d000e1d 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/local/opts.go b/executor/local/opts.go index b3e69be2..27e63129 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -7,7 +7,7 @@ package local import ( "fmt" - "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index 2d5b57ee..6fa5f1d7 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -13,8 +13,8 @@ import ( "github.com/go-vela/mock/server" - "github.com/go-vela/pkg-runtime/runtime" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/executor/local/service_test.go b/executor/local/service_test.go index 581a1ac2..e3e1c784 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -8,7 +8,7 @@ import ( "context" "testing" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index ec1f04c9..0f10daca 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -15,7 +15,7 @@ import ( "github.com/go-vela/compiler/compiler/native" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/pipeline" ) diff --git a/executor/local/step_test.go b/executor/local/step_test.go index e6f08ae8..6d94dbc2 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -8,7 +8,7 @@ import ( "context" "testing" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" diff --git a/executor/setup.go b/executor/setup.go index bedbd415..112b6214 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" - "github.com/go-vela/pkg-runtime/runtime" + "github.com/go-vela/worker/runtime" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" diff --git a/executor/setup_test.go b/executor/setup_test.go index c56496cc..c39b5d33 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -16,7 +16,7 @@ import ( "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" - "github.com/go-vela/pkg-runtime/runtime/docker" + "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" diff --git a/go.mod b/go.mod index d3055291..7aeba04d 100644 --- a/go.mod +++ b/go.mod @@ -4,18 +4,28 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 + github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 github.com/docker/distribution v2.7.1+incompatible + github.com/docker/docker v20.10.9+incompatible + github.com/docker/go-units v0.4.0 + github.com/fatih/color v1.10.0 // indirect github.com/gin-gonic/gin v1.7.4 github.com/go-vela/compiler v0.10.0 github.com/go-vela/mock v0.10.0 github.com/go-vela/pkg-queue v0.10.0 - github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785 github.com/go-vela/sdk-go v0.10.0 github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/hashicorp/go-hclog v0.10.0 // indirect github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + gotest.tools/v3 v3.0.3 + k8s.io/api v0.22.2 + k8s.io/apimachinery v0.22.2 + k8s.io/client-go v0.22.2 ) diff --git a/go.sum b/go.sum index 86a720f7..cf5d2ff6 100644 --- a/go.sum +++ b/go.sum @@ -167,8 +167,6 @@ github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= github.com/go-vela/pkg-queue v0.10.0 h1:cxpkyVuX+ZJuF9t7XEQuHOFBa776SNgraEsFpnWI03E= github.com/go-vela/pkg-queue v0.10.0/go.mod h1:ZtkPoazVfpKK/ePdea/2s2LpNWDrc19nqmn1hPI3jxY= -github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785 h1:VByvQACNppX/P74CfgSr+E0+HuOCMXnDHZYFiF9HdCs= -github.com/go-vela/pkg-runtime v0.10.1-0.20211025172651-7d29320dd785/go.mod h1:7KV1aAufGNpGbbLLsD7W7z8gc50fXdIK03NPM+SClg8= github.com/go-vela/sdk-go v0.10.0 h1:monESdM738WeY2MKlj0COGK0W/f1PIGwp8K4tClfLlo= github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/types v0.10.0-rc3/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= @@ -351,13 +349,11 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -522,7 +518,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index cf703562..516ebe8f 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -12,12 +12,12 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-runtime/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor" + "github.com/go-vela/worker/runtime/docker" ) func TestExecutor_Retrieve(t *testing.T) { diff --git a/runtime/context.go b/runtime/context.go new file mode 100644 index 00000000..f85d972d --- /dev/null +++ b/runtime/context.go @@ -0,0 +1,67 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "context" + + "github.com/gin-gonic/gin" +) + +// key defines the key type for storing +// the runtime Engine in the context. +const key = "runtime" + +// FromContext retrieves the runtime Engine from the context.Context. +func FromContext(c context.Context) Engine { + // get runtime value from context.Context + v := c.Value(key) + if v == nil { + return nil + } + + // cast runtime value to expected Engine type + e, ok := v.(Engine) + if !ok { + return nil + } + + return e +} + +// FromGinContext retrieves the runtime Engine from the gin.Context. +func FromGinContext(c *gin.Context) Engine { + // get runtime value from gin.Context + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Context.Get + v, ok := c.Get(key) + if !ok { + return nil + } + + // cast runtime value to expected Engine type + e, ok := v.(Engine) + if !ok { + return nil + } + + return e +} + +// WithContext inserts the runtime Engine into the context.Context. +func WithContext(c context.Context, e Engine) context.Context { + // set the runtime Engine in the context.Context + // + // nolint: golint,staticcheck // ignore using string with context value + return context.WithValue(c, key, e) +} + +// WithGinContext inserts the runtime Engine into the gin.Context. +func WithGinContext(c *gin.Context, e Engine) { + // set the runtime Engine in the gin.Context + // + // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Context.Set + c.Set(key, e) +} diff --git a/runtime/context_test.go b/runtime/context_test.go new file mode 100644 index 00000000..1ae77b45 --- /dev/null +++ b/runtime/context_test.go @@ -0,0 +1,142 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "context" + "reflect" + "testing" + + "github.com/gin-gonic/gin" + + "github.com/go-vela/types/constants" +) + +func TestRuntime_FromContext(t *testing.T) { + // setup types + _engine, err := New(&Setup{ + Driver: constants.DriverDocker, + }) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + context context.Context + want Engine + }{ + { + // nolint: golint,staticcheck // ignore using string with context value + context: context.WithValue(context.Background(), key, _engine), + want: _engine, + }, + { + context: context.Background(), + want: nil, + }, + { + // nolint: golint,staticcheck // ignore using string with context value + context: context.WithValue(context.Background(), key, "foo"), + want: nil, + }, + } + + // run tests + for _, test := range tests { + got := FromContext(test.context) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromContext is %v, want %v", got, test.want) + } + } +} + +func TestRuntime_FromGinContext(t *testing.T) { + // setup types + _engine, err := New(&Setup{ + Driver: constants.DriverDocker, + }) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + context *gin.Context + value interface{} + want Engine + }{ + { + context: new(gin.Context), + value: _engine, + want: _engine, + }, + { + context: new(gin.Context), + value: nil, + want: nil, + }, + { + context: new(gin.Context), + value: "foo", + want: nil, + }, + } + + // run tests + for _, test := range tests { + if test.value != nil { + test.context.Set(key, test.value) + } + + got := FromGinContext(test.context) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromGinContext is %v, want %v", got, test.want) + } + } +} + +func TestRuntime_WithContext(t *testing.T) { + // setup types + _engine, err := New(&Setup{ + Driver: constants.DriverDocker, + }) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // nolint: golint,staticcheck // ignore using string with context value + want := context.WithValue(context.Background(), key, _engine) + + // run test + got := WithContext(context.Background(), _engine) + + if !reflect.DeepEqual(got, want) { + t.Errorf("WithContext is %v, want %v", got, want) + } +} + +func TestRuntime_WithGinContext(t *testing.T) { + // setup types + _engine, err := New(&Setup{ + Driver: constants.DriverDocker, + }) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + want := new(gin.Context) + want.Set(key, _engine) + + // run test + got := new(gin.Context) + WithGinContext(got, _engine) + + if !reflect.DeepEqual(got, want) { + t.Errorf("WithGinContext is %v, want %v", got, want) + } +} diff --git a/runtime/doc.go b/runtime/doc.go new file mode 100644 index 00000000..a0024770 --- /dev/null +++ b/runtime/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package runtime provides the ability for Vela to +// integrate with different supported Runtime +// environments. +// +// Currently the following runtimes are supported: +// +// * Docker - https://docker.io/ +// * Kubernetes - https://kubernetes.io/ +// +// Usage: +// +// import "github.com/go-vela/worker/runtime" +package runtime diff --git a/runtime/docker/build.go b/runtime/docker/build.go new file mode 100644 index 00000000..a468bc67 --- /dev/null +++ b/runtime/docker/build.go @@ -0,0 +1,45 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +// InspectBuild displays details about the pod for the init step. +// This is a no-op for docker. +func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("no-op: inspecting build for pipeline %s", b.ID) + + return []byte{}, nil +} + +// SetupBuild prepares the pipeline build. +// This is a no-op for docker. +func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("no-op: setting up for build %s", b.ID) + + return nil +} + +// AssembleBuild finalizes pipeline build setup. +// This is a no-op for docker. +func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("no-op: assembling build %s", b.ID) + + return nil +} + +// RemoveBuild deletes (kill, remove) the pipeline build metadata. +// This is a no-op for docker. +func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("no-op: removing build %s", b.ID) + + return nil +} diff --git a/runtime/docker/build_test.go b/runtime/docker/build_test.go new file mode 100644 index 00000000..4ac26f25 --- /dev/null +++ b/runtime/docker/build_test.go @@ -0,0 +1,154 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_InspectBuild(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectBuild returned err: %v", err) + } + } +} + +func TestDocker_SetupBuild(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + } + + // run tests + for _, test := range tests { + err = _engine.SetupBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("SetupBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("SetupBuild returned err: %v", err) + } + } +} + +func TestDocker_AssembleBuild(t *testing.T) { + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + err = _engine.AssembleBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + } +} + +func TestDocker_RemoveBuild(t *testing.T) { + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + err = _engine.RemoveBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveBuild returned err: %v", err) + } + } +} diff --git a/runtime/docker/container.go b/runtime/docker/container.go new file mode 100644 index 00000000..fafb53fe --- /dev/null +++ b/runtime/docker/container.go @@ -0,0 +1,355 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "fmt" + "io" + "strings" + + "github.com/go-vela/types/constants" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + docker "github.com/docker/docker/client" + "github.com/docker/docker/pkg/stdcopy" + + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/image" + + "github.com/sirupsen/logrus" +) + +// InspectContainer inspects the pipeline container. +func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("inspecting container %s", ctn.ID) + + // send API call to inspect the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerInspect + container, err := c.Docker.ContainerInspect(ctx, ctn.ID) + if err != nil { + return err + } + + // capture the container exit code + // + // https://godoc.org/github.com/docker/docker/api/types#ContainerState + ctn.ExitCode = container.State.ExitCode + + return nil +} + +// RemoveContainer deletes (kill, remove) the pipeline container. +func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("removing container %s", ctn.ID) + + // send API call to inspect the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerInspect + container, err := c.Docker.ContainerInspect(ctx, ctn.ID) + if err != nil { + return err + } + + // if the container is paused, restarting or running + // + // https://godoc.org/github.com/docker/docker/api/types#ContainerState + if container.State.Paused || + container.State.Restarting || + container.State.Running { + // send API call to kill the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerKill + err := c.Docker.ContainerKill(ctx, ctn.ID, "SIGKILL") + if err != nil { + return err + } + } + + // create options for removing container + // + // https://godoc.org/github.com/docker/docker/api/types#ContainerRemoveOptions + opts := types.ContainerRemoveOptions{ + Force: true, + RemoveLinks: false, + RemoveVolumes: true, + } + + // send API call to remove the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerRemove + err = c.Docker.ContainerRemove(ctx, ctn.ID, opts) + if err != nil { + return err + } + + return nil +} + +// RunContainer creates and starts the pipeline container. +// +// nolint: lll // ignore long line length due to variable names +func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { + logrus.Tracef("running container %s", ctn.ID) + + // allocate new container config from pipeline container + containerConf := ctnConfig(ctn) + // allocate new host config with volume data + hostConf := hostConfig(b.ID, ctn.Ulimits, c.config.Volumes) + // allocate new network config with container name + networkConf := netConfig(b.ID, ctn.Name) + + // -------------------- Start of TODO: -------------------- + // + // Remove the below code once the mounting issue with Kaniko is + // resolved to allow mounting private cert bundles with Vela. + // + // This code is required due to a known bug in Kaniko: + // + // * https://github.com/go-vela/community/issues/253 + + // check if the pipeline container image contains + // the key words "kaniko" and "vela" + // + // this is a soft check for the Vela Kaniko plugin + if strings.Contains(ctn.Image, "kaniko") && + strings.Contains(ctn.Image, "vela") { + // iterate through the list of host mounts provided + for i, mount := range hostConf.Mounts { + // check if the source path or target path + // for the mount contains "/etc/ssl/certs" + // + // this is a soft check for mounting private cert bundles + if strings.Contains(mount.Source, "/etc/ssl/certs") || + strings.Contains(mount.Target, "/etc/ssl/certs") { + // remove the private cert bundle mount from the host config + hostConf.Mounts = append(hostConf.Mounts[:i], hostConf.Mounts[i+1:]...) + } + } + } + // + // -------------------- End of TODO: -------------------- + + // check if the container pull policy is on_start + if strings.EqualFold(ctn.Pull, constants.PullOnStart) { + // send API call to create the image + err := c.CreateImage(ctx, ctn) + if err != nil { + return err + } + } + + // check if the image is allowed to run privileged + for _, pattern := range c.config.Images { + privileged, err := image.IsPrivilegedImage(ctn.Image, pattern) + if err != nil { + return err + } + + if privileged { + hostConf.Privileged = true + } + } + + // send API call to create the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerCreate + _, err := c.Docker.ContainerCreate( + ctx, + containerConf, + hostConf, + networkConf, + nil, + ctn.ID, + ) + if err != nil { + return err + } + + // create options for starting container + // + // https://godoc.org/github.com/docker/docker/api/types#ContainerStartOptions + opts := types.ContainerStartOptions{} + + // send API call to start the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerStart + err = c.Docker.ContainerStart(ctx, ctn.ID, opts) + if err != nil { + return err + } + + return nil +} + +// SetupContainer prepares the image for the pipeline container. +func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("setting up for container %s", ctn.ID) + + // handle the container pull policy + switch ctn.Pull { + case constants.PullAlways: + // send API call to create the image + return c.CreateImage(ctx, ctn) + case constants.PullNotPresent: + // handled further down in this function + break + case constants.PullNever: + fallthrough + case constants.PullOnStart: + fallthrough + default: + logrus.Tracef("skipping setup for container %s due to pull policy %s", ctn.ID, ctn.Pull) + + return nil + } + + // parse image from container + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/image#ParseWithError + _image, err := image.ParseWithError(ctn.Image) + if err != nil { + return err + } + + // check if the container image exists on the host + // + // https://godoc.org/github.com/docker/docker/client#Client.ImageInspectWithRaw + _, _, err = c.Docker.ImageInspectWithRaw(ctx, _image) + if err == nil { + return nil + } + + // if the container image does not exist on the host + // we attempt to capture it for executing the pipeline + // + // https://godoc.org/github.com/docker/docker/client#IsErrNotFound + if docker.IsErrNotFound(err) { + // send API call to create the image + return c.CreateImage(ctx, ctn) + } + + return err +} + +// TailContainer captures the logs for the pipeline container. +// +// nolint: lll // ignore long line length due to variable names +func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { + logrus.Tracef("tailing output for container %s", ctn.ID) + + // create options for capturing container logs + // + // https://godoc.org/github.com/docker/docker/api/types#ContainerLogsOptions + opts := types.ContainerLogsOptions{ + Follow: true, + ShowStdout: true, + ShowStderr: true, + Details: false, + Timestamps: false, + } + + // send API call to capture the container logs + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerLogs + logs, err := c.Docker.ContainerLogs(ctx, ctn.ID, opts) + if err != nil { + return nil, err + } + + // create in-memory pipe for capturing logs + rc, wc := io.Pipe() + + // capture all stdout and stderr logs + go func() { + logrus.Tracef("copying logs for container %s", ctn.ID) + + // copy container stdout and stderr logs to our in-memory pipe + // + // https://godoc.org/github.com/docker/docker/pkg/stdcopy#StdCopy + _, err := stdcopy.StdCopy(wc, wc, logs) + if err != nil { + logrus.Errorf("unable to copy logs for container: %v", err) + } + + // close logs buffer + logs.Close() + + // close in-memory pipe write closer + wc.Close() + }() + + return rc, nil +} + +// WaitContainer blocks until the pipeline container completes. +func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("waiting for container %s", ctn.ID) + + // send API call to wait for the container completion + // + // https://godoc.org/github.com/docker/docker/client#Client.ContainerWait + wait, errC := c.Docker.ContainerWait(ctx, ctn.ID, container.WaitConditionNotRunning) + + select { + case <-wait: + case err := <-errC: + return err + } + + return nil +} + +// ctnConfig is a helper function to +// generate the container config. +func ctnConfig(ctn *pipeline.Container) *container.Config { + logrus.Tracef("Creating container configuration for step %s", ctn.ID) + + // create container config object + // + // https://godoc.org/github.com/docker/docker/api/types/container#Config + config := &container.Config{ + Image: image.Parse(ctn.Image), + WorkingDir: ctn.Directory, + AttachStdin: false, + AttachStdout: true, + AttachStderr: true, + Tty: false, + OpenStdin: false, + StdinOnce: false, + ArgsEscaped: false, + } + + // check if the environment is provided + if len(ctn.Environment) > 0 { + // iterate through each element in the container environment + for k, v := range ctn.Environment { + // add key/value environment to container config + config.Env = append(config.Env, fmt.Sprintf("%s=%s", k, v)) + } + } + + // check if the entrypoint is provided + if len(ctn.Entrypoint) > 0 { + // add entrypoint to container config + config.Entrypoint = ctn.Entrypoint + } + + // check if the commands are provided + if len(ctn.Commands) > 0 { + // add commands to container config + config.Cmd = ctn.Commands + } + + // check if the user is present + if len(ctn.User) > 0 { + // add user to container config + config.User = ctn.User + } + + return config +} diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go new file mode 100644 index 00000000..24fb4063 --- /dev/null +++ b/runtime/docker/container_test.go @@ -0,0 +1,389 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_InspectContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + err = _engine.InspectContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("InspectContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectContainer returned err: %v", err) + } + } +} + +func TestDocker_RemoveContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: true, + container: new(pipeline.Container), + }, + { + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_ignorenotfound", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "ignorenotfound", + Number: 2, + Pull: "always", + }, + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("RemoveContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveContainer returned err: %v", err) + } + } +} + +func TestDocker_RunContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + container *pipeline.Container + volumes []string + }{ + { + failure: false, + pipeline: _pipeline, + container: _container, + }, + { + failure: false, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "alpine:latest", + Name: "echo", + Number: 2, + Pull: "always", + }, + }, + { + failure: false, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "target/vela-docker:latest", + Name: "echo", + Number: 2, + Pull: "always", + }, + }, + { + failure: false, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "target/vela-kaniko:latest", + Name: "echo", + Number: 2, + Pull: "always", + }, + volumes: []string{"/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:rw"}, + }, + { + failure: true, + pipeline: _pipeline, + container: new(pipeline.Container), + }, + { + failure: true, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_ignorenotfound", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "ignorenotfound", + Number: 2, + Pull: "always", + }, + }, + { + failure: true, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_ignorenotfound", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "ignorenotfound", + Number: 2, + Pull: "always", + User: "foo", + }, + }, + } + + // run tests + for _, test := range tests { + if len(test.volumes) > 0 { + _engine.config.Volumes = test.volumes + } + + err = _engine.RunContainer(context.Background(), test.container, test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RunContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RunContainer returned err: %v", err) + } + } +} + +func TestDocker_SetupContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "not_present", + }, + }, + { + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:ignorenotfound", + Name: "clone", + Number: 2, + Pull: "not_present", + }, + }, + { + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:notfound", + Name: "clone", + Number: 2, + Pull: "always", + }, + }, + { + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:notfound", + Name: "clone", + Number: 2, + Pull: "not_present", + }, + }, + } + + // run tests + for _, test := range tests { + err = _engine.SetupContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("SetupContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("SetupContainer returned err: %v", err) + } + } +} + +func TestDocker_TailContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.TailContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("TailContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("TailContainer returned err: %v", err) + } + } +} + +func TestDocker_WaitContainer(t *testing.T) { + // setup Docker + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: true, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + err = _engine.WaitContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("WaitContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WaitContainer returned err: %v", err) + } + } +} diff --git a/runtime/docker/doc.go b/runtime/docker/doc.go new file mode 100644 index 00000000..78dfe7b0 --- /dev/null +++ b/runtime/docker/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package docker provides the ability for Vela to +// integrate with Docker as a runtime environment. +// +// Usage: +// +// import "github.com/go-vela/worker/runtime/docker" +package docker diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go new file mode 100644 index 00000000..8f18dc42 --- /dev/null +++ b/runtime/docker/docker.go @@ -0,0 +1,109 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + docker "github.com/docker/docker/client" + + mock "github.com/go-vela/mock/docker" +) + +// nolint: godot // ignore comment ending in a list +// +// Version represents the supported Docker API version for the mock. +// +// The Docker API version is pinned to ensure compatibility between the +// Docker API and client. The goal is to maintain n-1 compatibility. +// +// The maximum supported Docker API version for the client is here: +// +// https://docs.docker.com/engine/api/#api-version-matrix +// +// For example (use the compatibility matrix above for reference): +// +// * the Docker version of v20.10 has a maximum API version of v1.41 +// * to maintain n-1, the API version is pinned to v1.40 +const Version = "v1.40" + +type config struct { + // specifies a list of privileged images to use for the Docker client + Images []string + // specifies a list of host volumes to use for the Docker client + Volumes []string +} + +type client struct { + config *config + // https://godoc.org/github.com/docker/docker/client#CommonAPIClient + Docker docker.CommonAPIClient +} + +// New returns an Engine implementation that +// integrates with a Docker runtime. +// +// nolint: golint // ignore returning unexported client +func New(opts ...ClientOpt) (*client, error) { + // create new Docker client + c := new(client) + + // create new fields + c.config = new(config) + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + // create new Docker client from environment + // + // https://godoc.org/github.com/docker/docker/client#NewClientWithOpts + _docker, err := docker.NewClientWithOpts(docker.FromEnv) + if err != nil { + return nil, err + } + + // pin version to ensure we know what Docker API version we're using + // + // typically this would be inherited from the host environment + // but this ensures the version of client being used + // + // https://godoc.org/github.com/docker/docker/client#WithVersion + _ = docker.WithVersion(Version)(_docker) + + // set the Docker client in the runtime client + c.Docker = _docker + + return c, nil +} + +// NewMock returns an Engine implementation that +// integrates with a mock Docker runtime. +// +// This function is intended for running tests only. +// +// nolint: golint // ignore returning unexported client +func NewMock(opts ...ClientOpt) (*client, error) { + // create new Docker runtime client + c, err := New(opts...) + if err != nil { + return nil, err + } + + // create Docker client from the mock client + // + // https://pkg.go.dev/github.com/go-vela/mock/docker#New + _docker, err := mock.New() + if err != nil { + return nil, err + } + + // set the Docker client in the runtime client + c.Docker = _docker + + return c, nil +} diff --git a/runtime/docker/docker_test.go b/runtime/docker/docker_test.go new file mode 100644 index 00000000..ba5d9c89 --- /dev/null +++ b/runtime/docker/docker_test.go @@ -0,0 +1,117 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "testing" + + "github.com/go-vela/types/pipeline" + + "gotest.tools/v3/env" +) + +func TestDocker_New(t *testing.T) { + // setup tests + tests := []struct { + failure bool + envs map[string]string + }{ + { + failure: false, + envs: map[string]string{}, + }, + { + failure: true, + envs: map[string]string{ + "DOCKER_CERT_PATH": "invalid/path", + }, + }, + } + + // defer env cleanup + defer env.PatchAll(t, nil)() + + // run tests + for _, test := range tests { + // patch environment for tests + env.PatchAll(t, test.envs) + + _, err := New( + WithPrivilegedImages([]string{"alpine"}), + WithHostVolumes([]string{"/foo/bar.txt:/foo/bar.txt"}), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + } +} + +// setup global variables used for testing. +var ( + _container = &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "always", + } + + _pipeline = &pipeline.Build{ + Version: "1", + ID: "github_octocat_1", + Services: pipeline.ContainerSlice{ + { + ID: "service_github_octocat_1_postgres", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + }, + }, + Steps: pipeline.ContainerSlice{ + { + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + { + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + { + ID: "step_github_octocat_1_echo", + Commands: []string{"echo hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + } +) diff --git a/runtime/docker/driver.go b/runtime/docker/driver.go new file mode 100644 index 00000000..52e037d4 --- /dev/null +++ b/runtime/docker/driver.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import "github.com/go-vela/types/constants" + +// Driver outputs the configured runtime driver. +func (c *client) Driver() string { + return constants.DriverDocker +} diff --git a/runtime/docker/driver_test.go b/runtime/docker/driver_test.go new file mode 100644 index 00000000..3ed51c78 --- /dev/null +++ b/runtime/docker/driver_test.go @@ -0,0 +1,29 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "reflect" + "testing" + + "github.com/go-vela/types/constants" +) + +func TestDocker_Driver(t *testing.T) { + // setup types + want := constants.DriverDocker + + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // run tes + got := _engine.Driver() + + if !reflect.DeepEqual(got, want) { + t.Errorf("Driver is %v, want %v", got, want) + } +} diff --git a/runtime/docker/image.go b/runtime/docker/image.go new file mode 100644 index 00000000..43f8d816 --- /dev/null +++ b/runtime/docker/image.go @@ -0,0 +1,92 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "fmt" + "io" + "os" + "strings" + + "github.com/docker/docker/api/types" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/image" + + "github.com/sirupsen/logrus" +) + +// CreateImage creates the pipeline container image. +func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("creating image for container %s", ctn.ID) + + // parse image from container + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/image#ParseWithError + _image, err := image.ParseWithError(ctn.Image) + if err != nil { + return err + } + + // create options for pulling image + // + // https://godoc.org/github.com/docker/docker/api/types#ImagePullOptions + opts := types.ImagePullOptions{} + + // send API call to pull the image for the container + // + // https://godoc.org/github.com/docker/docker/client#Client.ImagePull + reader, err := c.Docker.ImagePull(ctx, _image, opts) + if err != nil { + return err + } + + defer reader.Close() + + // copy output from image pull to standard output + _, err = io.Copy(os.Stdout, reader) + if err != nil { + return err + } + + return nil +} + +// InspectImage inspects the pipeline container image. +func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { + logrus.Tracef("inspecting image for container %s", ctn.ID) + + // create output for inspecting image + output := []byte( + fmt.Sprintf("$ docker image inspect %s\n", ctn.Image), + ) + + // parse image from container + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/image#ParseWithError + _image, err := image.ParseWithError(ctn.Image) + if err != nil { + return output, err + } + + // check if the container pull policy is on start + if strings.EqualFold(ctn.Pull, constants.PullOnStart) { + return []byte( + fmt.Sprintf("skipped for container %s due to pull policy %s\n", ctn.ID, ctn.Pull), + ), nil + } + + // send API call to inspect the image + // + // https://godoc.org/github.com/docker/docker/client#Client.ImageInspectWithRaw + i, _, err := c.Docker.ImageInspectWithRaw(ctx, _image) + if err != nil { + return output, err + } + + // add new line to end of bytes + return append(output, []byte(i.ID+"\n")...), nil +} diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go new file mode 100644 index 00000000..cefa0757 --- /dev/null +++ b/runtime/docker/image_test.go @@ -0,0 +1,64 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_InspectImage(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: true, + container: new(pipeline.Container), + }, + { + failure: true, + container: &pipeline.Container{ + ID: "step_github_octocat_1_clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:notfound", + Name: "clone", + Number: 2, + Pull: "always", + }, + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectImage(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("InspectImage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectImage returned err: %v", err) + } + } +} diff --git a/runtime/docker/network.go b/runtime/docker/network.go new file mode 100644 index 00000000..090adb28 --- /dev/null +++ b/runtime/docker/network.go @@ -0,0 +1,110 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/network" + + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +// CreateNetwork creates the pipeline network. +func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("creating network for pipeline %s", b.ID) + + // create options for creating network + // + // https://godoc.org/github.com/docker/docker/api/types#NetworkCreate + opts := types.NetworkCreate{ + Driver: "bridge", + } + + // send API call to create the network + // + // https://godoc.org/github.com/docker/docker/client#Client.NetworkCreate + _, err := c.Docker.NetworkCreate(ctx, b.ID, opts) + if err != nil { + return err + } + + return nil +} + +// InspectNetwork inspects the pipeline network. +func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("inspecting network for pipeline %s", b.ID) + + // create options for inspecting network + // + // https://godoc.org/github.com/docker/docker/api/types#NetworkInspectOptions + opts := types.NetworkInspectOptions{} + + // create output for inspecting network + output := []byte( + fmt.Sprintf("$ docker network inspect %s\n", b.ID), + ) + + // send API call to inspect the network + // + // https://godoc.org/github.com/docker/docker/client#Client.NetworkInspect + n, err := c.Docker.NetworkInspect(ctx, b.ID, opts) + if err != nil { + return output, err + } + + // convert network type NetworkResource to bytes with pretty print + // + // https://godoc.org/github.com/docker/docker/api/types#NetworkResource + network, err := json.MarshalIndent(n, "", " ") + if err != nil { + return output, err + } + + // add new line to end of bytes + return append(output, append(network, "\n"...)...), nil +} + +// RemoveNetwork deletes the pipeline network. +func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("removing network for pipeline %s", b.ID) + + // send API call to remove the network + // + // https://godoc.org/github.com/docker/docker/client#Client.NetworkRemove + err := c.Docker.NetworkRemove(ctx, b.ID) + if err != nil { + return err + } + + return nil +} + +// netConfig is a helper function to generate +// the network config for a container. +func netConfig(id, alias string) *network.NetworkingConfig { + endpoints := make(map[string]*network.EndpointSettings) + + // set pipeline id for endpoint with alias + // + // https://godoc.org/github.com/docker/docker/api/types/network#EndpointSettings + endpoints[id] = &network.EndpointSettings{ + NetworkID: id, + Aliases: []string{alias}, + } + + // return network config with configured endpoints + // + // https://godoc.org/github.com/docker/docker/api/types/network#NetworkingConfig + return &network.NetworkingConfig{ + EndpointsConfig: endpoints, + } +} diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go new file mode 100644 index 00000000..9b8bbe56 --- /dev/null +++ b/runtime/docker/network_test.go @@ -0,0 +1,132 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_CreateNetwork(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + err = _engine.CreateNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("CreateNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateNetwork returned err: %v", err) + } + } +} + +func TestDocker_InspectNetwork(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectNetwork returned err: %v", err) + } + } +} + +func TestDocker_RemoveNetwork(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveNetwork returned err: %v", err) + } + } +} diff --git a/runtime/docker/opts.go b/runtime/docker/opts.go new file mode 100644 index 00000000..33dad050 --- /dev/null +++ b/runtime/docker/opts.go @@ -0,0 +1,36 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "github.com/sirupsen/logrus" +) + +// ClientOpt represents a configuration option to initialize the runtime client. +type ClientOpt func(*client) error + +// WithPrivilegedImages sets the Docker privileged images in the runtime client. +func WithPrivilegedImages(images []string) ClientOpt { + logrus.Trace("configuring privileged images in docker runtime client") + + return func(c *client) error { + // set the runtime privileged images in the docker client + c.config.Images = images + + return nil + } +} + +// WithHostVolumes sets the Docker host volumes in the runtime client. +func WithHostVolumes(volumes []string) ClientOpt { + logrus.Trace("configuring host volumes in docker runtime client") + + return func(c *client) error { + // set the runtime host volumes in the docker client + c.config.Volumes = volumes + + return nil + } +} diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go new file mode 100644 index 00000000..5970a293 --- /dev/null +++ b/runtime/docker/opts_test.go @@ -0,0 +1,74 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "reflect" + "testing" +) + +func TestDocker_ClientOpt_WithPrivilegedImages(t *testing.T) { + // setup tests + tests := []struct { + images []string + want []string + }{ + { + images: []string{"alpine", "golang"}, + want: []string{"alpine", "golang"}, + }, + { + images: []string{}, + want: []string{}, + }, + } + + // run tests + for _, test := range tests { + _service, err := New( + WithPrivilegedImages(test.images), + ) + + if err != nil { + t.Errorf("WithPrivilegedImages returned err: %v", err) + } + + if !reflect.DeepEqual(_service.config.Images, test.want) { + t.Errorf("WithPrivilegedImages is %v, want %v", _service.config.Images, test.want) + } + } +} + +func TestDocker_ClientOpt_WithHostVolumes(t *testing.T) { + // setup tests + tests := []struct { + volumes []string + want []string + }{ + { + volumes: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, + want: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, + }, + { + volumes: []string{}, + want: []string{}, + }, + } + + // run tests + for _, test := range tests { + _service, err := New( + WithHostVolumes(test.volumes), + ) + + if err != nil { + t.Errorf("WithHostVolumes returned err: %v", err) + } + + if !reflect.DeepEqual(_service.config.Volumes, test.want) { + t.Errorf("WithHostVolumes is %v, want %v", _service.config.Volumes, test.want) + } + } +} diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go new file mode 100644 index 00000000..357162da --- /dev/null +++ b/runtime/docker/volume.go @@ -0,0 +1,150 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/mount" + "github.com/docker/docker/api/types/volume" + "github.com/docker/go-units" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + vol "github.com/go-vela/worker/internal/volume" + + "github.com/sirupsen/logrus" +) + +// CreateVolume creates the pipeline volume. +func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("creating volume for pipeline %s", b.ID) + + // create options for creating volume + // + // https://godoc.org/github.com/docker/docker/api/types/volume#VolumeCreateBody + opts := volume.VolumeCreateBody{ + Name: b.ID, + Driver: "local", + } + + // send API call to create the volume + // + // https://godoc.org/github.com/docker/docker/client#Client.VolumeCreate + _, err := c.Docker.VolumeCreate(ctx, opts) + if err != nil { + return err + } + + return nil +} + +// InspectVolume inspects the pipeline volume. +func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("inspecting volume for pipeline %s", b.ID) + + // create output for inspecting volume + output := []byte( + fmt.Sprintf("$ docker volume inspect %s\n", b.ID), + ) + + // send API call to inspect the volume + // + // https://godoc.org/github.com/docker/docker/client#Client.VolumeInspect + v, err := c.Docker.VolumeInspect(ctx, b.ID) + if err != nil { + return output, err + } + + // convert volume type Volume to bytes with pretty print + // + // https://godoc.org/github.com/docker/docker/api/types#Volume + volume, err := json.MarshalIndent(v, "", " ") + if err != nil { + return output, err + } + + // add new line to end of bytes + return append(output, append(volume, "\n"...)...), nil +} + +// RemoveVolume deletes the pipeline volume. +func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("removing volume for pipeline %s", b.ID) + + // send API call to remove the volume + // + // https://godoc.org/github.com/docker/docker/client#Client.VolumeRemove + err := c.Docker.VolumeRemove(ctx, b.ID, true) + if err != nil { + return err + } + + return nil +} + +// hostConfig is a helper function to generate the host config +// with Ulimit and volume specifications for a container. +func hostConfig(id string, ulimits pipeline.UlimitSlice, volumes []string) *container.HostConfig { + logrus.Tracef("creating mount for default volume %s", id) + + // create default mount for pipeline volume + mounts := []mount.Mount{ + { + Type: mount.TypeVolume, + Source: id, + Target: constants.WorkspaceMount, + }, + } + + resources := container.Resources{} + // iterate through all ulimits provided + + for _, v := range ulimits { + resources.Ulimits = append(resources.Ulimits, &units.Ulimit{ + Name: v.Name, + Hard: v.Hard, + Soft: v.Soft, + }) + } + + // check if other volumes were provided + if len(volumes) > 0 { + // iterate through all volumes provided + for _, v := range volumes { + logrus.Tracef("creating mount for volume %s", v) + + // parse the volume provided + _volume, err := vol.ParseWithError(v) + if err != nil { + logrus.Error(err) + } + + // add the volume to the set of mounts + mounts = append(mounts, mount.Mount{ + Type: mount.TypeBind, + Source: _volume.Source, + Target: _volume.Destination, + ReadOnly: _volume.AccessMode == "ro", + }) + } + } + + // https://godoc.org/github.com/docker/docker/api/types/container#HostConfig + return &container.HostConfig{ + // https://godoc.org/github.com/docker/docker/api/types/container#LogConfig + LogConfig: container.LogConfig{ + Type: "json-file", + }, + Privileged: false, + // https://godoc.org/github.com/docker/docker/api/types/mount#Mount + Mounts: mounts, + // https://pkg.go.dev/github.com/docker/docker/api/types/container#Resources.Ulimits + Resources: resources, + } +} diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go new file mode 100644 index 00000000..6219b651 --- /dev/null +++ b/runtime/docker/volume_test.go @@ -0,0 +1,132 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestDocker_CreateVolume(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + err = _engine.CreateVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("CreateVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateVolume returned err: %v", err) + } + } +} + +func TestDocker_InspectVolume(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectVolume returned err: %v", err) + } + } +} + +func TestDocker_RemoveVolume(t *testing.T) { + // setup types + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _pipeline, + }, + { + failure: true, + pipeline: new(pipeline.Build), + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveVolume returned err: %v", err) + } + } +} diff --git a/runtime/engine.go b/runtime/engine.go new file mode 100644 index 00000000..6f57d0e9 --- /dev/null +++ b/runtime/engine.go @@ -0,0 +1,92 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "context" + "io" + + "github.com/go-vela/types/pipeline" +) + +// Engine represents the interface for Vela integrating +// with the different supported Runtime environments. +type Engine interface { + + // Engine Interface Functions + + // Driver defines a function that outputs + // the configured runtime driver. + Driver() string + + // Build Engine Interface Functions + + // InspectBuild defines a function that + // displays details about the build for the init step. + InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) + // SetupBuild defines a function that + // prepares the pipeline build. + SetupBuild(context.Context, *pipeline.Build) error + // AssembleBuild defines a function that + // finalizes pipeline build setup. + AssembleBuild(context.Context, *pipeline.Build) error + // RemoveBuild defines a function that deletes + // (kill, remove) the pipeline build metadata. + RemoveBuild(context.Context, *pipeline.Build) error + + // Container Engine Interface Functions + + // InspectContainer defines a function that inspects + // the pipeline container. + InspectContainer(context.Context, *pipeline.Container) error + // RemoveContainer defines a function that deletes + // (kill, remove) the pipeline container. + RemoveContainer(context.Context, *pipeline.Container) error + // RunContainer defines a function that creates + // and starts the pipeline container. + RunContainer(context.Context, *pipeline.Container, *pipeline.Build) error + // SetupContainer defines a function that prepares + // the image for the pipeline container. + SetupContainer(context.Context, *pipeline.Container) error + // TailContainer defines a function that captures + // the logs on the pipeline container. + TailContainer(context.Context, *pipeline.Container) (io.ReadCloser, error) + // WaitContainer defines a function that blocks + // until the pipeline container completes. + WaitContainer(context.Context, *pipeline.Container) error + + // Image Engine Interface Functions + + // CreateImage defines a function that + // creates the pipeline container image. + CreateImage(context.Context, *pipeline.Container) error + // InspectImage defines a function that + // inspects the pipeline container image. + InspectImage(context.Context, *pipeline.Container) ([]byte, error) + + // Network Engine Interface Functions + + // CreateNetwork defines a function that + // creates the pipeline network. + CreateNetwork(context.Context, *pipeline.Build) error + // InspectNetwork defines a function that + // inspects the pipeline network. + InspectNetwork(context.Context, *pipeline.Build) ([]byte, error) + // RemoveNetwork defines a function that + // deletes the pipeline network. + RemoveNetwork(context.Context, *pipeline.Build) error + + // Volume Engine Interface Functions + + // CreateVolume defines a function that + // creates the pipeline volume. + CreateVolume(context.Context, *pipeline.Build) error + // InspectVolume defines a function that + // inspects the pipeline volume. + InspectVolume(context.Context, *pipeline.Build) ([]byte, error) + // RemoveVolume defines a function that + // deletes the pipeline volume. + RemoveVolume(context.Context, *pipeline.Build) error +} diff --git a/runtime/flags.go b/runtime/flags.go new file mode 100644 index 00000000..1565d0ea --- /dev/null +++ b/runtime/flags.go @@ -0,0 +1,70 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "github.com/go-vela/types/constants" + + "github.com/urfave/cli/v2" +) + +// Flags represents all supported command line +// interface (CLI) flags for the runtime. +// +// https://pkg.go.dev/github.com/urfave/cli?tab=doc#Flag +var Flags = []cli.Flag{ + + // Logging Flags + + &cli.StringFlag{ + EnvVars: []string{"VELA_LOG_FORMAT", "RUNTIME_LOG_FORMAT"}, + FilePath: "/vela/runtime/log_format", + Name: "runtime.log.format", + Usage: "format of logs to output", + Value: "json", + }, + &cli.StringFlag{ + EnvVars: []string{"VELA_LOG_LEVEL", "RUNTIME_LOG_LEVEL"}, + FilePath: "/vela/runtime/log_level", + Name: "runtime.log.level", + Usage: "level of logs to output", + Value: "info", + }, + + // Runtime Flags + + &cli.StringFlag{ + EnvVars: []string{"VELA_RUNTIME_DRIVER", "RUNTIME_DRIVER"}, + FilePath: "/vela/runtime/driver", + Name: "runtime.driver", + Usage: "driver to be used for the runtime", + Value: constants.DriverDocker, + }, + &cli.StringFlag{ + EnvVars: []string{"VELA_RUNTIME_CONFIG", "RUNTIME_CONFIG"}, + FilePath: "/vela/runtime/config", + Name: "runtime.config", + Usage: "path to configuration file for the runtime", + }, + &cli.StringFlag{ + EnvVars: []string{"VELA_RUNTIME_NAMESPACE", "RUNTIME_NAMESPACE"}, + FilePath: "/vela/runtime/namespace", + Name: "runtime.namespace", + Usage: "namespace to use for the runtime (only used by kubernetes)", + }, + &cli.StringSliceFlag{ + EnvVars: []string{"VELA_RUNTIME_PRIVILEGED_IMAGES", "RUNTIME_PRIVILEGED_IMAGES"}, + FilePath: "/vela/runtime/privileged_images", + Name: "runtime.privileged-images", + Usage: "list of images allowed to run in privileged mode for the runtime", + Value: cli.NewStringSlice("target/vela-docker"), + }, + &cli.StringSliceFlag{ + EnvVars: []string{"VELA_RUNTIME_VOLUMES", "RUNTIME_VOLUMES"}, + FilePath: "/vela/runtime/volumes", + Name: "runtime.volumes", + Usage: "list of host volumes to mount for the runtime", + }, +} diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go new file mode 100644 index 00000000..42fbd1bc --- /dev/null +++ b/runtime/kubernetes/build.go @@ -0,0 +1,171 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/go-vela/types/pipeline" + + "github.com/buildkite/yaml" + "github.com/sirupsen/logrus" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InspectBuild displays details about the pod for the init step. +func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("inspecting build pod for pipeline %s", b.ID) + + output := []byte(fmt.Sprintf("> Inspecting pod for pipeline %s", b.ID)) + + // TODO: The environment gets populated in AssembleBuild, after InspectBuild runs. + // But, we should make sure that secrets can't be leaked here anyway. + buildOutput, err := yaml.Marshal(c.Pod) + if err != nil { + return []byte{}, fmt.Errorf("unable to serialize pod: %w", err) + } + + output = append(output, buildOutput...) + + // TODO: make other k8s Inspect* funcs no-ops (prefer this method): + // InspectVolume, InspectImage, InspectNetwork + return output, nil +} + +// SetupBuild prepares the pod metadata for the pipeline build. +func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("setting up for build %s", b.ID) + + // create the object metadata for the pod + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1?tab=doc#ObjectMeta + c.Pod.ObjectMeta = metav1.ObjectMeta{ + Name: b.ID, + Labels: map[string]string{"pipeline": b.ID}, + } + + // TODO: Vela admin defined worker-specific: + // NodeSelector, Tolerations, Affinity, AutomountServiceAccountToken + + // create the restart policy for the pod + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#RestartPolicy + c.Pod.Spec.RestartPolicy = v1.RestartPolicyNever + + return nil +} + +// AssembleBuild finalizes the pipeline build setup. +// This creates the pod in kubernetes for the pipeline build. +// After creation, image is the only container field we can edit in kubernetes. +// So, all environment, volume, and other container metadata must be setup +// before running AssembleBuild. +func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("assembling build %s", b.ID) + var err error + + // last minute Environment setup + for _, _service := range b.Services { + err = c.setupContainerEnvironment(_service) + if err != nil { + return err + } + } + for _, _stage := range b.Stages { + // TODO: remove hardcoded reference + if _stage.Name == "init" { + continue + } + for _, _step := range _stage.Steps { + err = c.setupContainerEnvironment(_step) + if err != nil { + return err + } + } + } + for _, _step := range b.Steps { + // TODO: remove hardcoded reference + if _step.Name == "init" { + continue + } + err = c.setupContainerEnvironment(_step) + if err != nil { + return err + } + } + for _, _secret := range b.Secrets { + if _secret.Origin.Empty() { + continue + } + err = c.setupContainerEnvironment(_secret.Origin) + if err != nil { + return err + } + } + + // If the api call to create the pod fails, the pod might + // partially exist. So, set this first to make sure all + // remnants get deleted. + c.createdPod = true + + logrus.Infof("creating pod %s", c.Pod.ObjectMeta.Name) + // send API call to create the pod + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + _, err = c.Kubernetes.CoreV1(). + Pods(c.config.Namespace). + Create(context.Background(), c.Pod, metav1.CreateOptions{}) + if err != nil { + return err + } + + return nil +} + +// RemoveBuild deletes (kill, remove) the pipeline build metadata. +// This deletes the kubernetes pod. +func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("removing build %s", b.ID) + + if !c.createdPod { + // nothing to do + return nil + } + + // create variables for the delete options + // + // This is necessary because the delete options + // expect all values to be passed by reference. + var ( + period = int64(0) + policy = metav1.DeletePropagationForeground + ) + + // create options for removing the pod + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1?tab=doc#DeleteOptions + opts := metav1.DeleteOptions{ + GracePeriodSeconds: &period, + // https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1?tab=doc#DeletionPropagation + PropagationPolicy: &policy, + } + + logrus.Infof("removing pod %s", c.Pod.ObjectMeta.Name) + // send API call to delete the pod + err := c.Kubernetes.CoreV1(). + Pods(c.config.Namespace). + Delete(context.Background(), c.Pod.ObjectMeta.Name, opts) + if err != nil { + return err + } + + c.Pod = &v1.Pod{} + c.createdPod = false + + return nil +} diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go new file mode 100644 index 00000000..63f6e3f6 --- /dev/null +++ b/runtime/kubernetes/build_test.go @@ -0,0 +1,226 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" + + v1 "k8s.io/api/core/v1" +) + +func TestKubernetes_InspectBuild(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectBuild returned err: %v", err) + } + } +} + +func TestKubernetes_SetupBuild(t *testing.T) { + // setup types + _engine, err := NewMock(&v1.Pod{}) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + err = _engine.SetupBuild(context.Background(), test.pipeline) + + // this does not test the resulting pod spec (ie no tests for ObjectMeta, RestartPolicy) + + if test.failure { + if err == nil { + t.Errorf("SetupBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("SetupBuild returned err: %v", err) + } + } +} + +func TestKubernetes_AssembleBuild(t *testing.T) { + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + // k8sPod is the pod that the mock Kubernetes client will return + k8sPod *v1.Pod + // enginePod is the pod under construction in the Runtime Engine + enginePod *v1.Pod + }{ + { + failure: false, + pipeline: _stages, + k8sPod: &v1.Pod{}, + enginePod: _stagesPod, + }, + { + failure: false, + pipeline: _steps, + k8sPod: &v1.Pod{}, + enginePod: _pod, + }, + { + failure: true, + pipeline: _stages, + k8sPod: _stagesPod, + enginePod: _stagesPod, + }, + { + failure: true, + pipeline: _steps, + k8sPod: _pod, + enginePod: _pod, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock(test.k8sPod) + _engine.Pod = test.enginePod + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + err = _engine.AssembleBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + } +} + +func TestKubernetes_RemoveBuild(t *testing.T) { + // setup tests + tests := []struct { + failure bool + createdPod bool + pipeline *pipeline.Build + pod *v1.Pod + }{ + { + failure: false, + createdPod: true, + pipeline: _stages, + pod: _pod, + }, + { + failure: false, + createdPod: true, + pipeline: _steps, + pod: _pod, + }, + { + failure: false, + createdPod: false, + pipeline: _stages, + pod: &v1.Pod{}, + }, + { + failure: false, + pipeline: _steps, + pod: &v1.Pod{}, + createdPod: false, + }, + { + failure: true, + pipeline: _stages, + pod: &v1.Pod{}, + createdPod: true, + }, + { + failure: true, + pipeline: _steps, + pod: &v1.Pod{}, + createdPod: true, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + _engine.createdPod = test.createdPod + + err = _engine.RemoveBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveBuild should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveBuild returned err: %v", err) + } + } +} diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go new file mode 100644 index 00000000..d0e2d8c0 --- /dev/null +++ b/runtime/kubernetes/container.go @@ -0,0 +1,382 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "bufio" + "context" + "fmt" + "io" + "io/ioutil" + "strings" + "time" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/image" + + "github.com/sirupsen/logrus" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" +) + +// InspectContainer inspects the pipeline container. +func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("inspecting container %s", ctn.ID) + + // create options for getting the container + opts := metav1.GetOptions{} + + // send API call to capture the container + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + pod, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Get( + context.Background(), + c.Pod.ObjectMeta.Name, + opts, + ) + if err != nil { + return err + } + + // iterate through each container in the pod + for _, cst := range pod.Status.ContainerStatuses { + // check if the container has a matching ID + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerStatus + if !strings.EqualFold(cst.Name, ctn.ID) { + // skip container if it's not a matching ID + continue + } + + // set the step exit code + ctn.ExitCode = int(cst.State.Terminated.ExitCode) + + break + } + + return nil +} + +// RemoveContainer deletes (kill, remove) the pipeline container. +// This is a no-op for kubernetes. RemoveBuild handles deleting the pod. +func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("no-op: removing container %s", ctn.ID) + + return nil +} + +// RunContainer creates and starts the pipeline container. +// +// nolint: lll // ignore long line length +func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { + logrus.Tracef("running container %s", ctn.ID) + // parse image from step + _image, err := image.ParseWithError(ctn.Image) + if err != nil { + return err + } + + // set the pod container image to the parsed step image + // (-1 to convert to 0-based index, -1 for init which isn't a container) + c.Pod.Spec.Containers[ctn.Number-2].Image = _image + + // send API call to patch the pod with the new container image + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + _, err = c.Kubernetes.CoreV1().Pods(c.config.Namespace).Patch( + context.Background(), + c.Pod.ObjectMeta.Name, + types.StrategicMergePatchType, + []byte(fmt.Sprintf(imagePatch, ctn.ID, _image)), + metav1.PatchOptions{}, + ) + if err != nil { + return err + } + + return nil +} + +// SetupContainer prepares the image for the pipeline container. +func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("setting up for container %s", ctn.ID) + + // create the container object for the pod + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#Container + container := v1.Container{ + Name: ctn.ID, + // create the container with the kubernetes/pause image + // + // This is done due to the nature of how containers are + // executed inside the pod. Kubernetes will attempt to + // start and run all containers in the pod at once. We + // want to control the execution of the containers + // inside the pod so we use the pause image as the + // default for containers, and then sequentially patch + // the containers with the proper image. + // + // https://hub.docker.com/r/kubernetes/pause + Image: image.Parse("kubernetes/pause:latest"), + Env: []v1.EnvVar{}, + Stdin: false, + StdinOnce: false, + TTY: false, + WorkingDir: ctn.Directory, + } + + // handle the container pull policy (This cannot be updated like the image can) + switch ctn.Pull { + case constants.PullAlways: + // set the pod container pull policy to always + container.ImagePullPolicy = v1.PullAlways + case constants.PullNever: + // set the pod container pull policy to never + container.ImagePullPolicy = v1.PullNever + case constants.PullOnStart: + // set the pod container pull policy to always + // + // if the pipeline container image should be pulled on start, than + // we force Kubernetes to pull the image on start with the always + // pull policy for the pod container + container.ImagePullPolicy = v1.PullAlways + case constants.PullNotPresent: + fallthrough + default: + // default the pod container pull policy to if not present + container.ImagePullPolicy = v1.PullIfNotPresent + } + + // fill in the VolumeMounts including workspaceMount + volumeMounts, err := c.setupVolumeMounts(ctx, ctn) + if err != nil { + return err + } + container.VolumeMounts = volumeMounts + + // check if the image is allowed to run privileged + for _, pattern := range c.config.Images { + privileged, err := image.IsPrivilegedImage(ctn.Image, pattern) + if err != nil { + return err + } + + container.SecurityContext = &v1.SecurityContext{ + Privileged: &privileged, + } + } + + // TODO: add SecurityContext options (runAsUser, runAsNonRoot, sysctls) + + // Executor.CreateBuild extends the environment AFTER calling Runtime.SetupBuild. + // So, configure the environment as late as possible (just before pod creation). + + // check if the entrypoint is provided + if len(ctn.Entrypoint) > 0 { + // add entrypoint to container config + container.Args = ctn.Entrypoint + } + + // check if the commands are provided + if len(ctn.Commands) > 0 { + // add commands to container config + container.Args = append(container.Args, ctn.Commands...) + } + + // add the container definition to the pod spec + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec + c.Pod.Spec.Containers = append(c.Pod.Spec.Containers, container) + + return nil +} + +// setupContainerEnvironment adds env vars to the Pod spec for a container. +// Call this just before pod creation to capture as many env changes as possible. +func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { + logrus.Tracef("setting up environment for container %s", ctn.ID) + + // get the matching container spec + // (-1 to convert to 0-based index, -1 for injected init container) + container := &c.Pod.Spec.Containers[ctn.Number-2] + if !strings.EqualFold(container.Name, ctn.ID) { + return fmt.Errorf("wrong container! got %s instead of %s", container.Name, ctn.ID) + } + + // check if the environment is provided + if len(ctn.Environment) > 0 { + // iterate through each element in the container environment + for k, v := range ctn.Environment { + // add key/value environment to container config + container.Env = append(container.Env, v1.EnvVar{Name: k, Value: v}) + } + } + return nil +} + +// TailContainer captures the logs for the pipeline container. +// +// nolint: lll // ignore long line length due to variable names +func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { + logrus.Tracef("tailing output for container %s", ctn.ID) + + // create object to store container logs + var logs io.ReadCloser + + // create function for periodically capturing + // the logs from the container with backoff + logsFunc := func() (bool, error) { + // create options for capturing the logs from the container + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodLogOptions + opts := &v1.PodLogOptions{ + Container: ctn.ID, + Follow: true, + // steps can exit quickly, and might be gone before + // log tailing has started, so we need to request + // logs for previously exited containers as well. + // Pods get deleted after job completion, and names for + // pod+container don't get reused. So, previous + // should only retrieve logs for the current build step. + Previous: true, + Timestamps: false, + } + + // send API call to capture stream of container logs + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodExpansion + // -> + // https://pkg.go.dev/k8s.io/client-go/rest?tab=doc#Request.Stream + stream, err := c.Kubernetes.CoreV1(). + Pods(c.config.Namespace). + GetLogs(c.Pod.ObjectMeta.Name, opts). + Stream(context.Background()) + if err != nil { + logrus.Errorf("%v", err) + return false, nil + } + + // create temporary reader to ensure logs are available + reader := bufio.NewReader(stream) + + // peek at container logs from the stream + // + // nolint: gomnd // ignore magic number + bytes, err := reader.Peek(5) + if err != nil { + // skip so we resend API call to capture stream + return false, nil + } + + // check if we have container logs from the stream + if len(bytes) > 0 { + // set the logs to the reader + logs = ioutil.NopCloser(reader) + return true, nil + } + + // no logs are available + return false, nil + } + + // create backoff object for capturing the logs + // from the container with periodic backoff + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#Backoff + backoff := wait.Backoff{ + Duration: 1 * time.Second, + Factor: 2.0, + Jitter: 0.25, + Steps: 10, + Cap: 2 * time.Minute, + } + + logrus.Tracef("capturing logs with exponential backoff for container %s", ctn.ID) + // perform the function to capture logs with periodic backoff + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#ExponentialBackoff + err := wait.ExponentialBackoff(backoff, logsFunc) + if err != nil { + return nil, err + } + + return logs, nil +} + +// WaitContainer blocks until the pipeline container completes. +func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("waiting for container %s", ctn.ID) + + // create label selector for watching the pod + selector := fmt.Sprintf("pipeline=%s", c.Pod.ObjectMeta.Name) + + // create options for watching the container + opts := metav1.ListOptions{ + LabelSelector: selector, + Watch: true, + } + + // send API call to capture channel for watching the container + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + // -> + // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface + watch, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Watch(context.Background(), opts) + if err != nil { + return err + } + + for { + // capture new result from the channel + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface + result := <-watch.ResultChan() + + // convert the object from the result to a pod + pod, ok := result.Object.(*v1.Pod) + if !ok { + return fmt.Errorf("unable to watch pod %s", c.Pod.ObjectMeta.Name) + } + + // check if the pod is in a pending state + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodStatus + if pod.Status.Phase == v1.PodPending { + // skip pod if it's in a pending state + continue + } + + // iterate through each container in the pod + for _, cst := range pod.Status.ContainerStatuses { + // check if the container has a matching ID + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerStatus + if !strings.EqualFold(cst.Name, ctn.ID) { + // skip container if it's not a matching ID + continue + } + + // check if the container is in a terminated state + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerState + if cst.State.Terminated == nil { + // skip container if it's not in a terminated state + break + } + + // check if the container has a terminated state reason + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerStateTerminated + if len(cst.State.Terminated.Reason) > 0 { + // break watching the container as it's complete + return nil + } + } + } +} diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go new file mode 100644 index 00000000..aef5249c --- /dev/null +++ b/runtime/kubernetes/container_test.go @@ -0,0 +1,336 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/kubernetes/fake" + testcore "k8s.io/client-go/testing" +) + +func TestKubernetes_InspectContainer(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: false, + container: new(pipeline.Container), + }, + } + + // run tests + for _, test := range tests { + err = _engine.InspectContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("InspectContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectContainer returned err: %v", err) + } + } +} + +func TestKubernetes_RemoveContainer(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("RemoveContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveContainer returned err: %v", err) + } + } +} + +func TestKubernetes_RunContainer(t *testing.T) { + // TODO: include VolumeMounts? + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + pipeline *pipeline.Build + pod *v1.Pod + volumes []string + }{ + { + failure: false, + container: _container, + pipeline: _stages, + pod: _pod, + }, + { + failure: false, + container: _container, + pipeline: _steps, + pod: _pod, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + if len(test.volumes) > 0 { + _engine.config.Volumes = test.volumes + } + + err = _engine.RunContainer(context.Background(), test.container, test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RunContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RunContainer returned err: %v", err) + } + } +} + +func TestKubernetes_SetupContainer(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + { + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "alpine:latest", + Name: "echo", + Number: 2, + Pull: "always", + }, + }, + { + failure: false, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "target/vela-docker:latest", + Name: "echo", + Number: 2, + Pull: "always", + }, + }, + } + + // run tests + for _, test := range tests { + err = _engine.SetupContainer(context.Background(), test.container) + + // this does not test the resulting pod spec (ie no tests for ImagePullPolicy, VolumeMounts) + + if test.failure { + if err == nil { + t.Errorf("SetupContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("SetupContainer returned err: %v", err) + } + } +} + +// TODO: implement this once they resolve the bug +// +// https://github.com/kubernetes/kubernetes/issues/84203 +func TestKubernetes_TailContainer(t *testing.T) { + // Unfortunately, we can't implement this test using + // the native Kubernetes fake. This is because there + // is a bug in that code where an "empty" request is + // always returned when calling the GetLogs function. + // + // https://github.com/kubernetes/kubernetes/issues/84203 + // fixed in k8s.io/client-go v0.19.0; we already have v0.22.2 +} + +func TestKubernetes_WaitContainer(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // create a new fake kubernetes client + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset + _kubernetes := fake.NewSimpleClientset(_pod) + + // create a new fake watcher + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#NewFake + _watch := watch.NewFake() + + // create a new watch reactor with the fake watcher + // + // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#DefaultWatchReactor + reactor := testcore.DefaultWatchReactor(_watch, nil) + + // add watch reactor to beginning of the client chain + // + // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#Fake.PrependWatchReactor + _kubernetes.PrependWatchReactor("pods", reactor) + + // overwrite the mock kubernetes client + _engine.Kubernetes = _kubernetes + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + object runtime.Object + }{ + { + failure: false, + container: _container, + object: _pod, + }, + { + failure: false, + container: _container, + object: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "github-octocat-1", + Namespace: "test", + Labels: map[string]string{ + "pipeline": "github-octocat-1", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Pod", + }, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-echo", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }, + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }, + }, + }, + }, + }, + { + failure: true, + container: _container, + object: new(v1.PodTemplate), + }, + } + + // run tests + for _, test := range tests { + go func() { + // simulate adding a pod to the watcher + _watch.Add(test.object) + }() + + err := _engine.WaitContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("WaitContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WaitContainer returned err: %v", err) + } + } +} diff --git a/runtime/kubernetes/doc.go b/runtime/kubernetes/doc.go new file mode 100644 index 00000000..b9bf7b5d --- /dev/null +++ b/runtime/kubernetes/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package kubernetes provides the ability for Vela to +// integrate with Kubernetes as a runtime environment. +// +// Usage: +// +// import "github.com/go-vela/worker/runtime/kubernetes" +package kubernetes diff --git a/runtime/kubernetes/driver.go b/runtime/kubernetes/driver.go new file mode 100644 index 00000000..216e2d55 --- /dev/null +++ b/runtime/kubernetes/driver.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import "github.com/go-vela/types/constants" + +// Driver outputs the configured runtime driver. +func (c *client) Driver() string { + return constants.DriverKubernetes +} diff --git a/runtime/kubernetes/driver_test.go b/runtime/kubernetes/driver_test.go new file mode 100644 index 00000000..2010ff45 --- /dev/null +++ b/runtime/kubernetes/driver_test.go @@ -0,0 +1,29 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "reflect" + "testing" + + "github.com/go-vela/types/constants" +) + +func TestKubernetes_Driver(t *testing.T) { + // setup types + want := constants.DriverKubernetes + + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // run tes + got := _engine.Driver() + + if !reflect.DeepEqual(got, want) { + t.Errorf("Driver is %v, want %v", got, want) + } +} diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go new file mode 100644 index 00000000..1a123131 --- /dev/null +++ b/runtime/kubernetes/image.go @@ -0,0 +1,67 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +const imagePatch = ` +{ + "spec": { + "containers": [ + { + "name": "%s", + "image": "%s" + } + ] + } +} +` + +// CreateImage creates the pipeline container image. +func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error { + logrus.Tracef("creating image for container %s", ctn.ID) + + return nil +} + +// InspectImage inspects the pipeline container image. +func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { + logrus.Tracef("inspecting image for container %s", ctn.ID) + + // TODO: consider updating this command + // + // create output for inspecting image + output := []byte( + // nolint: lll // ignore line length due to string formatting with parameters + fmt.Sprintf("$ kubectl get pod -o=jsonpath='{.spec.containers[%d].image}' %s\n", ctn.Number, ctn.ID), + ) + + // check if the container pull policy is on start + if strings.EqualFold(ctn.Pull, constants.PullOnStart) { + return []byte( + fmt.Sprintf("skipped for container %s due to pull policy %s\n", ctn.ID, ctn.Pull), + ), nil + } + + // marshal the image information from the container + // (-1 to convert to 0-based index, -1 for init which isn't a container) + image, err := json.MarshalIndent(c.Pod.Spec.Containers[ctn.Number-2].Image, "", " ") + if err != nil { + return output, err + } + + // add new line to end of bytes + return append(output, append(image, "\n"...)...), nil +} diff --git a/runtime/kubernetes/image_test.go b/runtime/kubernetes/image_test.go new file mode 100644 index 00000000..78c9cf7a --- /dev/null +++ b/runtime/kubernetes/image_test.go @@ -0,0 +1,48 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestKubernetes_InspectImage(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectImage(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("InspectImage should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectImage returned err: %v", err) + } + } +} diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go new file mode 100644 index 00000000..d406830f --- /dev/null +++ b/runtime/kubernetes/kubernetes.go @@ -0,0 +1,130 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/fake" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" +) + +type config struct { + // specifies the config file to use for the Kubernetes client + File string + // specifies the namespace to use for the Kubernetes client + Namespace string + // specifies a list of privileged images to use for the Kubernetes client + Images []string + // specifies a list of host volumes to use for the Kubernetes client + Volumes []string +} + +type client struct { + config *config + // https://pkg.go.dev/k8s.io/client-go/kubernetes#Interface + Kubernetes kubernetes.Interface + // https://pkg.go.dev/k8s.io/api/core/v1#Pod + Pod *v1.Pod + // commonVolumeMounts includes workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) + commonVolumeMounts []v1.VolumeMount + // indicates when the pod has been created in kubernetes + createdPod bool +} + +// New returns an Engine implementation that +// integrates with a Kubernetes runtime. +// +// nolint: golint // ignore returning unexported client +func New(opts ...ClientOpt) (*client, error) { + // create new Kubernetes client + c := &client{} + + // create new fields + c.config = &config{} + c.Pod = &v1.Pod{} + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + // use the current context in kubeconfig + // + // when no kube config is provided create InClusterConfig + // else use out of cluster config option + var ( + config *rest.Config + err error + ) + if c.config.File == "" { + // https://pkg.go.dev/k8s.io/client-go/rest?tab=doc#InClusterConfig + config, err = rest.InClusterConfig() + if err != nil { + logrus.Error("VELA_RUNTIME_CONFIG not defined and failed to create kubernetes InClusterConfig!") + return nil, err + } + } else { + // https://pkg.go.dev/k8s.io/client-go/tools/clientcmd?tab=doc#BuildConfigFromFlags + config, err = clientcmd.BuildConfigFromFlags("", c.config.File) + if err != nil { + return nil, err + } + } + + // creates Kubernetes client from configuration + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes?tab=doc#NewForConfig + _kubernetes, err := kubernetes.NewForConfig(config) + if err != nil { + return nil, err + } + + // set the Kubernetes client in the runtime client + c.Kubernetes = _kubernetes + + return c, nil +} + +// NewMock returns an Engine implementation that +// integrates with a Kubernetes runtime. +// +// This function is intended for running tests only. +// +// nolint: golint // ignore returning unexported client +func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { + // create new Kubernetes client + c := &client{} + + // create new fields + c.config = &config{} + c.Pod = &v1.Pod{} + + // set the Kubernetes namespace in the runtime client + c.config.Namespace = "test" + + // set the Kubernetes pod in the runtime client + c.Pod = _pod + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + // set the Kubernetes fake client in the runtime client + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset + c.Kubernetes = fake.NewSimpleClientset(c.Pod) + + return c, nil +} diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go new file mode 100644 index 00000000..9027085b --- /dev/null +++ b/runtime/kubernetes/kubernetes_test.go @@ -0,0 +1,316 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "testing" + + "github.com/go-vela/types/pipeline" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestKubernetes_New(t *testing.T) { + // setup tests + tests := []struct { + failure bool + namespace string + path string + }{ + { + failure: false, + namespace: "test", + path: "testdata/config", + }, + { + failure: true, + namespace: "test", + path: "testdata/config_empty", + }, + // An empty path implies that we are running in kubernetes, + // so we should use InClusterConfig. Tests, however, do not + // run in kubernetes, so we would need a way to mock the + // return value of rest.InClusterConfig(), but how? + //{ + // failure: false, + // namespace: "test", + // path: "", + //}, + } + + // run tests + for _, test := range tests { + _, err := New( + WithConfigFile(test.path), + WithNamespace(test.namespace), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + } +} + +// setup global variables used for testing. +var ( + _container = &pipeline.Container{ + ID: "step-github-octocat-1-clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "always", + } + + _pod = &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "github-octocat-1", + Namespace: "test", + Labels: map[string]string{ + "pipeline": "github-octocat-1", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Pod", + }, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }, + { + Name: "step-github-octocat-1-echo", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }, + }, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "step-github-octocat-1-clone", + Image: "target/vela-git:v0.4.0", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "step-github-octocat-1-echo", + Image: "alpine:latest", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "service-github-octocat-1-postgres", + Image: "postgres:12-alpine", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + }, + HostAliases: []v1.HostAlias{ + { + IP: "127.0.0.1", + Hostnames: []string{ + "postgres.local", + "echo.local", + }, + }, + }, + Volumes: []v1.Volume{ + { + Name: "github-octocat-1", + VolumeSource: v1.VolumeSource{ + EmptyDir: &v1.EmptyDirVolumeSource{}, + }, + }, + }, + }, + } + + _stages = &pipeline.Build{ + Version: "1", + ID: "github-octocat-1", + Services: pipeline.ContainerSlice{ + { + ID: "service-github-octocat-1-postgres", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 4, + Ports: []string{"5432:5432"}, + }, + }, + Stages: pipeline.StageSlice{ + { + Name: "init", + Steps: pipeline.ContainerSlice{ + { + ID: "step-github-octocat-1-init-init", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, + }, + { + Name: "clone", + Needs: []string{"init"}, + Steps: pipeline.ContainerSlice{ + { + ID: "step-github-octocat-1-clone-clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + }, + }, + { + Name: "echo", + Needs: []string{"clone"}, + Steps: pipeline.ContainerSlice{ + { + ID: "step-github-octocat-1-echo-echo", + Commands: []string{"echo hello"}, + Detach: true, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + }, + }, + } + + _steps = &pipeline.Build{ + Version: "1", + ID: "github-octocat-1", + Services: pipeline.ContainerSlice{ + { + ID: "service-github-octocat-1-postgres", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 4, + Ports: []string{"5432:5432"}, + }, + }, + Steps: pipeline.ContainerSlice{ + { + ID: "step-github-octocat-1-init", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + { + ID: "step-github-octocat-1-clone", + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/vela-git:v0.4.0", + Name: "clone", + Number: 2, + Pull: "always", + }, + { + ID: "step-github-octocat-1-echo", + Commands: []string{"echo hello"}, + Detach: true, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 3, + Pull: "always", + }, + }, + } + + _stagesPod = &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "github-octocat-1", + Namespace: "test", + Labels: map[string]string{ + "pipeline": "github-octocat-1", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Pod", + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "step-github-octocat-1-clone-clone", + Image: "target/vela-git:v0.4.0", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "step-github-octocat-1-echo-echo", + Image: "alpine:latest", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "service-github-octocat-1-postgres", + Image: "postgres:12-alpine", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + }, + HostAliases: []v1.HostAlias{ + { + IP: "127.0.0.1", + Hostnames: []string{ + "postgres.local", + "echo.local", + }, + }, + }, + Volumes: []v1.Volume{ + { + Name: "github-octocat-1", + VolumeSource: v1.VolumeSource{ + EmptyDir: &v1.EmptyDirVolumeSource{}, + }, + }, + }, + }, + } +) diff --git a/runtime/kubernetes/network.go b/runtime/kubernetes/network.go new file mode 100644 index 00000000..a481aefb --- /dev/null +++ b/runtime/kubernetes/network.go @@ -0,0 +1,124 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "encoding/json" + "fmt" + + v1 "k8s.io/api/core/v1" + + "github.com/go-vela/types/pipeline" + + "github.com/sirupsen/logrus" +) + +// CreateNetwork creates the pipeline network. +func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("creating network for pipeline %s", b.ID) + + // nolint: lll // ignore long line length due to link + // create the network for the pod + // + // This is done due to the nature of how networking works inside the + // pod. Each container inside the pod shares the same network IP and + // port space. This allows them to communicate with each other via + // localhost. However, to keep the runtime behavior consistent, + // Vela adds DNS entries for each container that requires it. + // + // More info: + // * https://kubernetes.io/docs/concepts/workloads/pods/pod/ + // * https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#HostAlias + network := v1.HostAlias{ + IP: "127.0.0.1", + Hostnames: []string{}, + } + + // iterate through all services in the pipeline + for _, service := range b.Services { + // create the host entry for the pod container aliases + host := fmt.Sprintf("%s.local", service.Name) + + // add the host entry to the pod container aliases + network.Hostnames = append(network.Hostnames, host) + } + + // iterate through all steps in the pipeline + for _, step := range b.Steps { + // skip all steps not running in detached mode + if !step.Detach { + continue + } + + // create the host entry for the pod container aliases + host := fmt.Sprintf("%s.local", step.Name) + + // add the host entry to the pod container aliases + network.Hostnames = append(network.Hostnames, host) + } + + // iterate through all stages in the pipeline + for _, stage := range b.Stages { + // iterate through all steps in each stage + for _, step := range stage.Steps { + // skip all steps not running in detached mode + if !step.Detach { + continue + } + + // create the host entry for the pod container aliases + host := fmt.Sprintf("%s.local", step.Name) + + // add the host entry to the pod container aliases + network.Hostnames = append(network.Hostnames, host) + } + } + + // add the network definition to the pod spec + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec + c.Pod.Spec.HostAliases = append(c.Pod.Spec.HostAliases, network) + + return nil +} + +// InspectNetwork inspects the pipeline network. +func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("inspecting network for pipeline %s", b.ID) + + // TODO: consider updating this command + // + // create output for inspecting volume + output := []byte( + fmt.Sprintf("$ kubectl get pod -o=jsonpath='{.spec.hostAliases}' %s\n", b.ID), + ) + + // marshal the network information from the pod + network, err := json.MarshalIndent(c.Pod.Spec.HostAliases, "", " ") + if err != nil { + return output, err + } + + return append(output, append(network, "\n"...)...), nil +} + +// RemoveNetwork deletes the pipeline network. +// +// Currently, this is comparable to a no-op because in Kubernetes the +// network lives and dies with the pod it's attached to. However, Vela +// uses it to cleanup the network definition for the pod. +func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("removing network for pipeline %s", b.ID) + + // remove the network definition from the pod spec + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec + c.Pod.Spec.HostAliases = []v1.HostAlias{} + + return nil +} diff --git a/runtime/kubernetes/network_test.go b/runtime/kubernetes/network_test.go new file mode 100644 index 00000000..2428da27 --- /dev/null +++ b/runtime/kubernetes/network_test.go @@ -0,0 +1,132 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" +) + +func TestKubernetes_CreateNetwork(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + err := _engine.CreateNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("CreateNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateNetwork returned err: %v", err) + } + } +} + +func TestKubernetes_InspectNetwork(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + _, err = _engine.InspectNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectNetwork returned err: %v", err) + } + } +} + +func TestKubernetes_RemoveNetwork(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveNetwork(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveNetwork should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveNetwork returned err: %v", err) + } + } +} diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go new file mode 100644 index 00000000..b30d2f05 --- /dev/null +++ b/runtime/kubernetes/opts.go @@ -0,0 +1,67 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "fmt" + + "github.com/sirupsen/logrus" +) + +// ClientOpt represents a configuration option to initialize the runtime client. +type ClientOpt func(*client) error + +// WithConfigFile sets the Kubernetes config file in the runtime client. +func WithConfigFile(file string) ClientOpt { + logrus.Trace("configuring config file in kubernetes runtime client") + + return func(c *client) error { + // set the runtime config file in the kubernetes client + c.config.File = file + + return nil + } +} + +// WithNamespace sets the Kubernetes namespace in the runtime client. +func WithNamespace(namespace string) ClientOpt { + logrus.Trace("configuring namespace in kubernetes runtime client") + + return func(c *client) error { + // check if the namespace provided is empty + if len(namespace) == 0 { + return fmt.Errorf("no Kubernetes namespace provided") + } + + // set the runtime namespace in the kubernetes client + c.config.Namespace = namespace + + return nil + } +} + +// WithPrivilegedImages sets the Kubernetes privileged images in the runtime client. +func WithPrivilegedImages(images []string) ClientOpt { + logrus.Trace("configuring privileged images in kubernetes runtime client") + + return func(c *client) error { + // set the runtime privileged images in the kubernetes client + c.config.Images = images + + return nil + } +} + +// WithHostVolumes sets the Kubernetes host volumes in the runtime client. +func WithHostVolumes(volumes []string) ClientOpt { + logrus.Trace("configuring host volumes in kubernetes runtime client") + + return func(c *client) error { + // set the runtime host volumes in the kubernetes client + c.config.Volumes = volumes + + return nil + } +} diff --git a/runtime/kubernetes/opts_test.go b/runtime/kubernetes/opts_test.go new file mode 100644 index 00000000..45a149c1 --- /dev/null +++ b/runtime/kubernetes/opts_test.go @@ -0,0 +1,163 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "reflect" + "testing" +) + +func TestKubernetes_ClientOpt_WithConfigFile(t *testing.T) { + // setup tests + tests := []struct { + failure bool + file string + want string + }{ + { + failure: false, + file: "testdata/config", + want: "testdata/config", + }, + { + failure: true, + file: "", + want: "", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile(test.file), + ) + + if test.failure { + if err == nil { + t.Errorf("WithConfigFile should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithConfigFile returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.File, test.want) { + t.Errorf("WithConfigFile is %v, want %v", _engine.config.File, test.want) + } + } +} + +func TestKubernetes_ClientOpt_WithNamespace(t *testing.T) { + // setup tests + tests := []struct { + failure bool + namespace string + want string + }{ + { + failure: false, + namespace: "foo", + want: "foo", + }, + { + failure: true, + namespace: "", + want: "", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile("testdata/config"), + WithNamespace(test.namespace), + ) + + if test.failure { + if err == nil { + t.Errorf("WithNamespace should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithNamespace returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.Namespace, test.want) { + t.Errorf("WithNamespace is %v, want %v", _engine.config.Namespace, test.want) + } + } +} + +func TestKubernetes_ClientOpt_WithHostVolumes(t *testing.T) { + // setup tests + tests := []struct { + volumes []string + want []string + }{ + { + volumes: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, + want: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, + }, + { + volumes: []string{}, + want: []string{}, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile("testdata/config"), + WithHostVolumes(test.volumes), + ) + + if err != nil { + t.Errorf("WithHostVolumes returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.Volumes, test.want) { + t.Errorf("WithHostVolumes is %v, want %v", _engine.config.Volumes, test.want) + } + } +} + +func TestKubernetes_ClientOpt_WithPrivilegedImages(t *testing.T) { + // setup tests + tests := []struct { + images []string + want []string + }{ + { + images: []string{"alpine", "golang"}, + want: []string{"alpine", "golang"}, + }, + { + images: []string{}, + want: []string{}, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile("testdata/config"), + WithPrivilegedImages(test.images), + ) + + if err != nil { + t.Errorf("WithPrivilegedImages returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.Images, test.want) { + t.Errorf("WithPrivilegedImages is %v, want %v", _engine.config.Images, test.want) + } + } +} diff --git a/runtime/kubernetes/testdata/config b/runtime/kubernetes/testdata/config new file mode 100644 index 00000000..ec9cdfd9 --- /dev/null +++ b/runtime/kubernetes/testdata/config @@ -0,0 +1,18 @@ +apiVersion: v1 +clusters: +- cluster: + server: https://localhost:443 + name: foo +contexts: +- context: + cluster: foo + namespace: test + user: foo + name: foo +current-context: foo +kind: Config +preferences: {} +users: +- name: foo + user: + token: somerandomstringqwerty \ No newline at end of file diff --git a/runtime/kubernetes/testdata/config_empty b/runtime/kubernetes/testdata/config_empty new file mode 100644 index 00000000..e69de29b diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go new file mode 100644 index 00000000..974c2a8d --- /dev/null +++ b/runtime/kubernetes/volume.go @@ -0,0 +1,174 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + v1 "k8s.io/api/core/v1" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + vol "github.com/go-vela/worker/internal/volume" + + "github.com/sirupsen/logrus" +) + +// CreateVolume creates the pipeline volume. +func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("creating volume for pipeline %s", b.ID) + + // create the workspace volume for the pod + // + // This is done due to the nature of how volumes works inside + // the pod. Each container inside the pod can access and use + // the same volume. This allows them to share this volume + // throughout the life of the pod. However, to keep the + // runtime behavior consistent, Vela uses an emtpyDir volume + // because that volume only exists for the life + // of the pod. + // + // More info: + // * https://kubernetes.io/docs/concepts/workloads/pods/pod/ + // * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#Volume + workspaceVolume := v1.Volume{ + Name: b.ID, + VolumeSource: v1.VolumeSource{ + EmptyDir: &v1.EmptyDirVolumeSource{}, + }, + } + + // create the workspace volumeMount for the pod + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#VolumeMount + workspaceVolumeMount := v1.VolumeMount{ + Name: b.ID, + MountPath: constants.WorkspaceMount, + } + + // add the volume definition to the pod spec + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec + c.Pod.Spec.Volumes = append(c.Pod.Spec.Volumes, workspaceVolume) + + // save the volumeMount to add to each of the containers in the pod spec later + c.commonVolumeMounts = append(c.commonVolumeMounts, workspaceVolumeMount) + + // check if global host volumes were provided (VELA_RUNTIME_VOLUMES) + if len(c.config.Volumes) > 0 { + // iterate through all volumes provided + for k, v := range c.config.Volumes { + // parse the volume provided + _volume := vol.Parse(v) + _volumeName := fmt.Sprintf("%s_%d", b.ID, k) + + // add the volume to the set of pod volumes + c.Pod.Spec.Volumes = append(c.Pod.Spec.Volumes, v1.Volume{ + Name: _volumeName, + VolumeSource: v1.VolumeSource{ + HostPath: &v1.HostPathVolumeSource{ + Path: _volume.Source, + }, + }, + }) + + // save the volumeMounts for later addition to each container's mounts + c.commonVolumeMounts = append(c.commonVolumeMounts, v1.VolumeMount{ + Name: _volumeName, + MountPath: _volume.Destination, + }) + } + } + + // TODO: extend c.config.Volumes to include container-specific volumes (container.Volumes) + + return nil +} + +// InspectVolume inspects the pipeline volume. +func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { + logrus.Tracef("inspecting volume for pipeline %s", b.ID) + + // TODO: consider updating this command + // + // create output for inspecting volume + output := []byte( + fmt.Sprintf("$ kubectl get pod -o=jsonpath='{.spec.volumes}' %s\n", b.ID), + ) + + // marshal the volume information from the pod + volume, err := json.MarshalIndent(c.Pod.Spec.Volumes, "", " ") + if err != nil { + return nil, err + } + + return append(output, append(volume, "\n"...)...), nil +} + +// RemoveVolume deletes the pipeline volume. +// +// Currently, this is comparable to a no-op because in Kubernetes the +// volume lives and dies with the pod it's attached to. However, Vela +// uses it to cleanup the volume definition for the pod. +func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { + logrus.Tracef("removing volume for pipeline %s", b.ID) + + // remove the volume definition from the pod spec + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec + c.Pod.Spec.Volumes = []v1.Volume{} + + return nil +} + +// setupVolumeMounts generates the VolumeMounts for a given container. +// nolint:unparam // keep signature similar to Engine interface methods despite unused ctx and err +func (c *client) setupVolumeMounts(ctx context.Context, ctn *pipeline.Container) ( + volumeMounts []v1.VolumeMount, + err error, +) { + logrus.Tracef("setting up VolumeMounts for container %s", ctn.ID) + + // add workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) + volumeMounts = append(volumeMounts, c.commonVolumeMounts...) + + // -------------------- Start of TODO: -------------------- + // + // Remove the below code once the mounting issue with Kaniko is + // resolved to allow mounting private cert bundles with Vela. + // + // This code is required due to a known bug in Kaniko: + // + // * https://github.com/go-vela/community/issues/253 + + // check if the pipeline container image contains + // the key words "kaniko" and "vela" + // + // this is a soft check for the Vela Kaniko plugin + if strings.Contains(ctn.Image, "kaniko") && + strings.Contains(ctn.Image, "vela") { + // iterate through the list of host mounts provided + for i, mount := range volumeMounts { + // check if the path for the mount contains "/etc/ssl/certs" + // + // this is a soft check for mounting private cert bundles + if strings.Contains(mount.MountPath, "/etc/ssl/certs") { + // remove the private cert bundle mount from the host config + volumeMounts = append(volumeMounts[:i], volumeMounts[i+1:]...) + } + } + } + // + // -------------------- End of TODO: -------------------- + + // TODO: extend volumeMounts based on ctn.Volumes + + return volumeMounts, nil +} diff --git a/runtime/kubernetes/volume_test.go b/runtime/kubernetes/volume_test.go new file mode 100644 index 00000000..0821a26b --- /dev/null +++ b/runtime/kubernetes/volume_test.go @@ -0,0 +1,136 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "testing" + + "github.com/go-vela/types/pipeline" + + v1 "k8s.io/api/core/v1" +) + +func TestKubernetes_CreateVolume(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + err = _engine.CreateVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("CreateVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("CreateVolume returned err: %v", err) + } + } +} + +func TestKubernetes_InspectVolume(t *testing.T) { + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + pod *v1.Pod + }{ + { + failure: false, + pipeline: _stages, + pod: _pod, + }, + { + failure: false, + pipeline: _steps, + pod: _pod, + }, + } + + // run tests + for _, test := range tests { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _, err = _engine.InspectVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("InspectVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("InspectVolume returned err: %v", err) + } + } +} + +func TestKubernetes_RemoveVolume(t *testing.T) { + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + pipeline *pipeline.Build + }{ + { + failure: false, + pipeline: _stages, + }, + { + failure: false, + pipeline: _steps, + }, + } + + // run tests + for _, test := range tests { + err = _engine.RemoveVolume(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("RemoveVolume should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("RemoveVolume returned err: %v", err) + } + } +} diff --git a/runtime/runtime.go b/runtime/runtime.go new file mode 100644 index 00000000..8bcb182e --- /dev/null +++ b/runtime/runtime.go @@ -0,0 +1,50 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "fmt" + + "github.com/go-vela/types/constants" + + "github.com/sirupsen/logrus" +) + +// nolint: godot // ignore period at end for comment ending in a list +// +// New creates and returns a Vela engine capable of +// integrating with the configured runtime. +// +// Currently the following runtimes are supported: +// +// * docker +// * kubernetes +func New(s *Setup) (Engine, error) { + // validate the setup being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#Setup.Validate + err := s.Validate() + if err != nil { + return nil, err + } + + logrus.Debug("creating runtime engine from setup") + // process the runtime driver being provided + switch s.Driver { + case constants.DriverDocker: + // handle the Docker runtime driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#Setup.Docker + return s.Docker() + case constants.DriverKubernetes: + // handle the Kubernetes runtime driver being provided + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#Setup.Kubernetes + return s.Kubernetes() + default: + // handle an invalid runtime driver being provided + return nil, fmt.Errorf("invalid runtime driver provided: %s", s.Driver) + } +} diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go new file mode 100644 index 00000000..ba0f4a56 --- /dev/null +++ b/runtime/runtime_test.go @@ -0,0 +1,63 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "testing" + + "github.com/go-vela/types/constants" +) + +func TestRuntime_New(t *testing.T) { + // setup tests + tests := []struct { + failure bool + setup *Setup + }{ + { + failure: false, + setup: &Setup{ + Driver: constants.DriverDocker, + }, + }, + { + failure: false, + setup: &Setup{ + Driver: constants.DriverKubernetes, + Namespace: "docker", + ConfigFile: "testdata/config", + }, + }, + { + failure: true, + setup: &Setup{ + Driver: "invalid", + }, + }, + { + failure: true, + setup: &Setup{ + Driver: "", + }, + }, + } + + // run tests + for _, test := range tests { + _, err := New(test.setup) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("New returned err: %v", err) + } + } +} diff --git a/runtime/setup.go b/runtime/setup.go new file mode 100644 index 00000000..e4f6ac0b --- /dev/null +++ b/runtime/setup.go @@ -0,0 +1,89 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "fmt" + + "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" + + "github.com/go-vela/types/constants" + + "github.com/sirupsen/logrus" +) + +// Setup represents the configuration necessary for +// creating a Vela engine capable of integrating +// with a configured runtime environment. +type Setup struct { + // Runtime Configuration + + // specifies the driver to use for the runtime client + Driver string + // specifies the path to a configuration file to use for the runtime client + ConfigFile string + // specifies a list of host volumes to use for the runtime client + HostVolumes []string + // specifies the namespace to use for the runtime client (only used by kubernetes) + Namespace string + // specifies a list of privileged images to use for the runtime client + PrivilegedImages []string +} + +// Docker creates and returns a Vela engine capable of +// integrating with a Docker runtime environment. +func (s *Setup) Docker() (Engine, error) { + logrus.Trace("creating docker runtime client from setup") + + // create new Docker runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/docker?tab=doc#New + return docker.New( + docker.WithHostVolumes(s.HostVolumes), + docker.WithPrivilegedImages(s.PrivilegedImages), + ) +} + +// Kubernetes creates and returns a Vela engine capable of +// integrating with a Kubernetes runtime environment. +func (s *Setup) Kubernetes() (Engine, error) { + logrus.Trace("creating kubernetes runtime client from setup") + + // create new Kubernetes runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/kubernetes?tab=doc#New + return kubernetes.New( + kubernetes.WithConfigFile(s.ConfigFile), + kubernetes.WithHostVolumes(s.HostVolumes), + kubernetes.WithNamespace(s.Namespace), + kubernetes.WithPrivilegedImages(s.PrivilegedImages), + ) +} + +// Validate verifies the necessary fields for the +// provided configuration are populated correctly. +func (s *Setup) Validate() error { + logrus.Trace("validating runtime setup for client") + + // check if a runtime driver was provided + if len(s.Driver) == 0 { + return fmt.Errorf("no runtime driver provided") + } + + // process the secret driver being provided + switch s.Driver { + case constants.DriverDocker: + break + case constants.DriverKubernetes: + // check if a runtime namespace was provided + if len(s.Namespace) == 0 { + return fmt.Errorf("no runtime namespace provided") + } + } + + // setup is valid + return nil +} diff --git a/runtime/setup_test.go b/runtime/setup_test.go new file mode 100644 index 00000000..3966472a --- /dev/null +++ b/runtime/setup_test.go @@ -0,0 +1,91 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package runtime + +import ( + "testing" + + "github.com/go-vela/types/constants" +) + +func TestRuntime_Setup_Docker(t *testing.T) { + // setup types + _setup := &Setup{ + Driver: constants.DriverDocker, + } + + // run test + _, err := _setup.Docker() + if err != nil { + t.Errorf("Docker returned err: %v", err) + } +} + +func TestRuntime_Setup_Kubernetes(t *testing.T) { + // setup types + _setup := &Setup{ + Driver: constants.DriverKubernetes, + ConfigFile: "testdata/config", + Namespace: "docker", + } + + // run test + _, err := _setup.Kubernetes() + if err != nil { + t.Errorf("Kubernetes returned err: %v", err) + } +} + +func TestRuntime_Validate(t *testing.T) { + // setup types + tests := []struct { + failure bool + setup *Setup + want error + }{ + { + failure: false, + setup: &Setup{ + Driver: constants.DriverDocker, + }, + }, + { + failure: false, + setup: &Setup{ + Driver: constants.DriverKubernetes, + Namespace: "docker", + }, + }, + { + failure: true, + setup: &Setup{ + Driver: "", + }, + }, + { + failure: true, + setup: &Setup{ + Driver: constants.DriverKubernetes, + }, + }, + } + + // run tests + for _, test := range tests { + err := test.setup.Validate() + + if test.failure { + if err == nil { + t.Errorf("Validate should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("Validate returned err: %v", err) + } + } +} diff --git a/runtime/testdata/config b/runtime/testdata/config new file mode 100644 index 00000000..ec9cdfd9 --- /dev/null +++ b/runtime/testdata/config @@ -0,0 +1,18 @@ +apiVersion: v1 +clusters: +- cluster: + server: https://localhost:443 + name: foo +contexts: +- context: + cluster: foo + namespace: test + user: foo + name: foo +current-context: foo +kind: Config +preferences: {} +users: +- name: foo + user: + token: somerandomstringqwerty \ No newline at end of file diff --git a/runtime/testdata/large.yml b/runtime/testdata/large.yml new file mode 100644 index 00000000..b760122e --- /dev/null +++ b/runtime/testdata/large.yml @@ -0,0 +1,605 @@ +version: "1" + +metadata: + template: false + +steps: + - name: echo_1 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_2 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_3 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_4 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_5 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_6 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_7 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_8 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_9 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_10 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_11 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_12 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_13 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_14 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_15 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_16 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_17 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_18 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_19 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_20 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_21 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_22 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_23 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_24 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_25 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_26 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_27 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_28 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_29 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_30 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_31 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_32 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_33 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_34 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_35 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_36 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_37 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_38 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_39 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_40 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_41 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_42 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_43 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_44 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_45 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_46 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_47 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_48 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_49 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_50 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_51 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_52 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_53 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_54 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_55 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_56 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_57 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_58 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_59 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_60 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_61 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_62 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_63 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_64 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_65 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_66 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_67 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_68 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_69 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_70 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_71 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_72 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_73 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_74 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_75 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_76 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_77 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_78 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_79 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_80 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_81 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_82 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_83 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_84 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_85 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_86 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_87 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_88 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_89 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_90 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_91 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_92 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_93 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_94 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_95 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_96 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_97 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_98 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_99 + commands: + - echo hello + image: alpine:latest + pull: true + + - name: echo_100 + commands: + - echo hello + image: alpine:latest + pull: true diff --git a/runtime/testdata/stages.yml b/runtime/testdata/stages.yml new file mode 100644 index 00000000..75c143c2 --- /dev/null +++ b/runtime/testdata/stages.yml @@ -0,0 +1,13 @@ +--- +version: "1" + +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true diff --git a/runtime/testdata/steps.yml b/runtime/testdata/steps.yml new file mode 100644 index 00000000..1410a03c --- /dev/null +++ b/runtime/testdata/steps.yml @@ -0,0 +1,32 @@ +--- +version: "1" + +steps: + - name: git-test + image: target/vela-git:latest + pull: true + parameters: + path: hello-world + ref: refs/heads/master + remote: https://github.com/octocat/hello-world.git + sha: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d + + # sleep testing waiting step + - name: sleep + commands: | + secs=30 + while [ $secs -gt 0 ]; do + echo "$secs" + sleep 1 + : $((secs--)) + done + image: alpine:latest + pull: true + + # exit testing inspect step + - name: exit + commands: + - exit 1 + image: alpine:latest + pull: true + From 7d5ab074a2c8e667e1b3a6d07cc973eb3893047a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Oct 2021 13:41:22 -0500 Subject: [PATCH 206/430] fix(deps): update module github.com/docker/docker to v20.10.10 (#226) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7aeba04d..1a3a2487 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 github.com/docker/distribution v2.7.1+incompatible - github.com/docker/docker v20.10.9+incompatible + github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/fatih/color v1.10.0 // indirect github.com/gin-gonic/gin v1.7.4 diff --git a/go.sum b/go.sum index cf5d2ff6..ebb3c2d5 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,9 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.9+incompatible h1:JlsVnETOjM2RLQa0Cc1XCIspUdXW3Zenq9P54uXBm6k= github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= +github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= From fe2ebdfc8f8d8ea02f97b05fd6c03bd9322ee78c Mon Sep 17 00:00:00 2001 From: Neal Date: Wed, 27 Oct 2021 14:44:51 -0500 Subject: [PATCH 207/430] refactor: update queue packge to get from server (#225) Co-authored-by: Neal Coleman --- cmd/vela-worker/flags.go | 2 +- cmd/vela-worker/operate.go | 4 +- cmd/vela-worker/run.go | 2 +- cmd/vela-worker/validate.go | 2 +- cmd/vela-worker/worker.go | 2 +- go.mod | 8 +- go.sum | 266 +++++++++++++++++++++++++++++++++--- 7 files changed, 258 insertions(+), 28 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 38696c2e..585664e5 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -7,7 +7,7 @@ package main import ( "time" - "github.com/go-vela/pkg-queue/queue" + "github.com/go-vela/server/queue" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 9e713504..75372d12 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -8,7 +8,7 @@ import ( "context" "time" - "github.com/go-vela/pkg-queue/queue" + "github.com/go-vela/server/queue" "github.com/go-vela/types/library" "github.com/sirupsen/logrus" @@ -75,7 +75,7 @@ func (w *Worker) operate(ctx context.Context) error { // setup the queue // - // https://pkg.go.dev/github.com/go-vela/pkg-queue/queue?tab=doc#New + // https://pkg.go.dev/github.com/go-vela/server/queue?tab=doc#New w.Queue, err = queue.New(w.Config.Queue) if err != nil { return err diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index e81f2bf5..74af6be5 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -10,7 +10,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/pkg-queue/queue" + "github.com/go-vela/server/queue" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index ab42a971..3c9a46b0 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -64,7 +64,7 @@ func (w *Worker) Validate() error { // verify the queue configuration // - // https://godoc.org/github.com/go-vela/pkg-queue/queue#Setup.Validate + // https://godoc.org/github.com/go-vela/server/queue#Setup.Validate err := w.Config.Queue.Validate() if err != nil { return err diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 20b25e7d..434fba22 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -8,8 +8,8 @@ import ( "net/url" "time" - "github.com/go-vela/pkg-queue/queue" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/queue" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" ) diff --git a/go.mod b/go.mod index 1a3a2487..b45304a3 100644 --- a/go.mod +++ b/go.mod @@ -8,17 +8,13 @@ require ( github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 - github.com/fatih/color v1.10.0 // indirect github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/compiler v0.10.0 + github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 github.com/go-vela/mock v0.10.0 - github.com/go-vela/pkg-queue v0.10.0 github.com/go-vela/sdk-go v0.10.0 + github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 - github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.2.0 // indirect - github.com/hashicorp/go-hclog v0.10.0 // indirect github.com/joho/godotenv v1.4.0 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index ebb3c2d5..7e2cbfa7 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -44,6 +45,8 @@ github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWO github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= 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/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -51,8 +54,10 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030I github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -69,15 +74,24 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.15.1 h1:Fw+ixAJPmKhCLBqDwHlTDqxUxp0xjEwXczEpt1B6r7k= github.com/alicebob/miniredis/v2 v2.15.1/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= +github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.40.54/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= +github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -85,15 +99,31 @@ github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20200709052629-daa8e1ccc0bc/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -103,6 +133,7 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -113,6 +144,7 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -124,8 +156,11 @@ github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= +github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -135,12 +170,15 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= +github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -160,20 +198,25 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-vela/compiler v0.10.0 h1:dFilpf5A+tiJWibILE2kHnAa+UEFDZgv/9lDwd0+n84= -github.com/go-vela/compiler v0.10.0/go.mod h1:Zq1L6qXsV/h5kWO5A3boGzFWvXk7he6FO2hcMVuSupw= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 h1:EQ7Ur57cJbb5ZWyxMYqaaALfTLrKU0aaQRZOQSoqoOM= +github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0/go.mod h1:dJyDHQuwXsyQUkiXpcjbcXxpuQnf3qvA9G+0kPciTQc= github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= -github.com/go-vela/pkg-queue v0.10.0 h1:cxpkyVuX+ZJuF9t7XEQuHOFBa776SNgraEsFpnWI03E= -github.com/go-vela/pkg-queue v0.10.0/go.mod h1:ZtkPoazVfpKK/ePdea/2s2LpNWDrc19nqmn1hPI3jxY= github.com/go-vela/sdk-go v0.10.0 h1:monESdM738WeY2MKlj0COGK0W/f1PIGwp8K4tClfLlo= github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= -github.com/go-vela/types v0.10.0-rc3/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc h1:+XzSlp2yx0wGo8lXCDW/OZeXDrEIKjSMET+y+mfwaGQ= +github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc/go.mod h1:cQ2+RvV9Q/z4l681/UZqCXJVnAvTbDpFpR9/HNp5JTM= github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= github.com/go-vela/types v0.10.0/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -208,6 +251,7 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -225,8 +269,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v39 v39.1.0 h1:1vf4gM0D1e+Df2HMxaYC3+o9+Huj3ywGTtWc3VVYaDA= -github.com/google/go-github/v39 v39.1.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= +github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= +github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -246,8 +290,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.4/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/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/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= @@ -260,16 +304,48 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= -github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE= +github.com/hashicorp/vault/api v1.2.0/go.mod h1:dAjw0T5shMnrfH7Q/Mst+LrcTKvStZBVs1PICEDpUqY= +github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= +github.com/hashicorp/vault/sdk v0.2.1/go.mod h1:WfUiO1vYzfBkz1TmoE4ZGU7HD0T0Cl/rZwaxjBkgN4U= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= @@ -278,6 +354,49 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -290,39 +409,63 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -346,31 +489,46 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= @@ -379,23 +537,36 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= 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/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -407,13 +578,16 @@ github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -421,12 +595,15 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 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/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= +github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5 h1:MCfT24H3f//U5+UCrZp1/riVO3B50BovxtDiNn0XKkk= +github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 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= @@ -437,26 +614,46 @@ github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBU github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= 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= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.starlark.net v0.0.0-20210901212718-87f333178d59 h1:F8ArBy9n1l7HE1JjzOIYqweEqoUlywy5+L3bR0tIa9g= -go.starlark.net v0.0.0-20210901212718-87f333178d59/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3 h1:oBcONsksxvpeodDrLjiMDaKHXKAVVfAydhe/792CE/o= +go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 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= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -491,6 +688,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -502,7 +700,9 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -515,6 +715,7 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -543,22 +744,28 @@ 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 h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/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-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -581,6 +788,7 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -604,14 +812,18 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -620,6 +832,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 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-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/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= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -627,8 +840,11 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -636,6 +852,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -657,6 +874,8 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -718,10 +937,13 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 h1:bFFRpT+e8JJVY7lMMfvezL1ZIwqiwmPl2bsE2yx4HqM= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -745,6 +967,7 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -753,12 +976,17 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8X gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -772,6 +1000,12 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/postgres v1.1.2/go.mod h1:/AGV0zvqF3mt9ZtzLzQmXWQ/5vr+1V1TyHZGZVjzmwI= +gorm.io/driver/sqlite v1.1.6/go.mod h1:W8LmC/6UvVbHKah0+QOC7Ja66EaZXHwUTjgXY8YNWX8= +gorm.io/gorm v1.21.15/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.21.16/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= From 292fd5778ccf8978dd8240a306e2d0f105ef01fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Oct 2021 09:09:24 -0500 Subject: [PATCH 208/430] fix(deps): update deps (patch) (#227) Co-authored-by: Renovate Bot --- go.mod | 8 ++++---- go.sum | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index b45304a3..c82769c4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gin-gonic/gin v1.7.4 github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 github.com/go-vela/mock v0.10.0 - github.com/go-vela/sdk-go v0.10.0 + github.com/go-vela/sdk-go v0.10.1 github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 @@ -21,7 +21,7 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.0.3 - k8s.io/api v0.22.2 - k8s.io/apimachinery v0.22.2 - k8s.io/client-go v0.22.2 + k8s.io/api v0.22.3 + k8s.io/apimachinery v0.22.3 + k8s.io/client-go v0.22.3 ) diff --git a/go.sum b/go.sum index 7e2cbfa7..6dcd0384 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,9 @@ github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 h1:EQ7Ur57cJbb github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0/go.mod h1:dJyDHQuwXsyQUkiXpcjbcXxpuQnf3qvA9G+0kPciTQc= github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= -github.com/go-vela/sdk-go v0.10.0 h1:monESdM738WeY2MKlj0COGK0W/f1PIGwp8K4tClfLlo= github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= +github.com/go-vela/sdk-go v0.10.1 h1:p/vKSHafLAJVGX64LMQchswd76NU0+NI6TAXC1ZCfH8= +github.com/go-vela/sdk-go v0.10.1/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc h1:+XzSlp2yx0wGo8lXCDW/OZeXDrEIKjSMET+y+mfwaGQ= github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc/go.mod h1:cQ2+RvV9Q/z4l681/UZqCXJVnAvTbDpFpR9/HNp5JTM= github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= @@ -1016,12 +1017,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw= -k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8= -k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk= +k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4= +k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs= k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/client-go v0.22.2 h1:DaSQgs02aCC1QcwUdkKZWOeaVsQjYvWv8ZazcZ6JcHc= -k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U= +k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk= +k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/client-go v0.22.3 h1:6onkOSc+YNdwq5zXE0wFXicq64rrym+mXwHu/CPVGO4= +k8s.io/client-go v0.22.3/go.mod h1:ElDjYf8gvZsKDYexmsmnMQ0DYO8W9RwBjfQ1PI53yow= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= From 0f81aee219c91d97d3479b1bcaea2ceffd2d3fcd Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 29 Oct 2021 12:37:02 -0500 Subject: [PATCH 209/430] refactor: update compiler package to get from server (#228) --- executor/linux/build_test.go | 2 +- executor/linux/secret_test.go | 2 +- executor/linux/stage_test.go | 2 +- executor/local/build_test.go | 2 +- executor/local/stage_test.go | 2 +- go.mod | 3 +-- go.sum | 9 ++++----- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 0cc4a4b0..7ab2416a 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -10,8 +10,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/compiler/compiler/native" "github.com/go-vela/mock/server" + "github.com/go-vela/server/compiler/native" "github.com/urfave/cli/v2" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index a9eed01e..8bfb7c80 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -14,8 +14,8 @@ import ( "github.com/gin-gonic/gin" "github.com/urfave/cli/v2" - "github.com/go-vela/compiler/compiler/native" "github.com/go-vela/mock/server" + "github.com/go-vela/server/compiler/native" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 469ffc27..0672389b 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" "github.com/urfave/cli/v2" - "github.com/go-vela/compiler/compiler/native" "github.com/go-vela/mock/server" + "github.com/go-vela/server/compiler/native" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/local/build_test.go b/executor/local/build_test.go index f1249bb8..5643e1c1 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -9,7 +9,7 @@ import ( "flag" "testing" - "github.com/go-vela/compiler/compiler/native" + "github.com/go-vela/server/compiler/native" "github.com/urfave/cli/v2" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index 0f10daca..676f83b6 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -13,7 +13,7 @@ import ( "github.com/urfave/cli/v2" - "github.com/go-vela/compiler/compiler/native" + "github.com/go-vela/server/compiler/native" "github.com/go-vela/worker/runtime/docker" diff --git a/go.mod b/go.mod index c82769c4..0d2101c0 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 github.com/go-vela/mock v0.10.0 github.com/go-vela/sdk-go v0.10.1 - github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc + github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index 6dcd0384..e28c7bac 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.15.1 h1:Fw+ixAJPmKhCLBqDwHlTDqxUxp0xjEwXczEpt1B6r7k= -github.com/alicebob/miniredis/v2 v2.15.1/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.16.0 h1:ALkyFg7bSTEd1Mkrb4ppq4fnwjklA59dVtIehXCUZkU= +github.com/alicebob/miniredis/v2 v2.16.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -203,15 +203,14 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0 h1:EQ7Ur57cJbb5ZWyxMYqaaALfTLrKU0aaQRZOQSoqoOM= github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0/go.mod h1:dJyDHQuwXsyQUkiXpcjbcXxpuQnf3qvA9G+0kPciTQc= github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/sdk-go v0.10.1 h1:p/vKSHafLAJVGX64LMQchswd76NU0+NI6TAXC1ZCfH8= github.com/go-vela/sdk-go v0.10.1/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= -github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc h1:+XzSlp2yx0wGo8lXCDW/OZeXDrEIKjSMET+y+mfwaGQ= -github.com/go-vela/server v0.10.2-0.20211027160636-eb9f75c560bc/go.mod h1:cQ2+RvV9Q/z4l681/UZqCXJVnAvTbDpFpR9/HNp5JTM= +github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f h1:V9BUiWTN5DddiWBZ+m7hg7gF4aLudhznr6T2cWZHqB0= +github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f/go.mod h1:zBKgcYoDFATxGLshdFDoYUdTvFYejUNB0e8UBNE6gBg= github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= github.com/go-vela/types v0.10.0/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= From ce0770e120db7df758e9f10eb46e4293545361a6 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 29 Oct 2021 12:48:54 -0500 Subject: [PATCH 210/430] feat(mock): add logic from go-vela/mock (#229) Co-authored-by: Kelly Merrick --- go.mod | 1 + mock/doc.go | 11 + mock/docker/config.go | 59 ++++ mock/docker/container.go | 532 ++++++++++++++++++++++++++++++++++++ mock/docker/distribution.go | 30 ++ mock/docker/doc.go | 12 + mock/docker/docker.go | 43 +++ mock/docker/image.go | 256 +++++++++++++++++ mock/docker/mock.go | 112 ++++++++ mock/docker/network.go | 188 +++++++++++++ mock/docker/node.go | 62 +++++ mock/docker/plugin.go | 109 ++++++++ mock/docker/secret.go | 71 +++++ mock/docker/service.go | 106 +++++++ mock/docker/swarm.go | 89 ++++++ mock/docker/system.go | 72 +++++ mock/docker/volume.go | 184 +++++++++++++ mock/mock.go | 5 + runtime/docker/docker.go | 4 +- 19 files changed, 1944 insertions(+), 2 deletions(-) create mode 100644 mock/doc.go create mode 100644 mock/docker/config.go create mode 100644 mock/docker/container.go create mode 100644 mock/docker/distribution.go create mode 100644 mock/docker/doc.go create mode 100644 mock/docker/docker.go create mode 100644 mock/docker/image.go create mode 100644 mock/docker/mock.go create mode 100644 mock/docker/network.go create mode 100644 mock/docker/node.go create mode 100644 mock/docker/plugin.go create mode 100644 mock/docker/secret.go create mode 100644 mock/docker/service.go create mode 100644 mock/docker/swarm.go create mode 100644 mock/docker/system.go create mode 100644 mock/docker/volume.go create mode 100644 mock/mock.go diff --git a/go.mod b/go.mod index 0d2101c0..d8ba8a1d 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 + github.com/opencontainers/image-spec v1.0.1 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 diff --git a/mock/doc.go b/mock/doc.go new file mode 100644 index 00000000..b301891e --- /dev/null +++ b/mock/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package mock provides a collection of mock +// packages used for a Vela worker. +// +// Usage: +// +// import "github.com/go-vela/worker/mock" +package mock diff --git a/mock/docker/config.go b/mock/docker/config.go new file mode 100644 index 00000000..6ccbc2bf --- /dev/null +++ b/mock/docker/config.go @@ -0,0 +1,59 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/client" +) + +// ConfigService implements all the config +// related functions for the Docker mock. +type ConfigService struct{} + +// ConfigCreate is a helper function to simulate +// a mocked call to create a config for a +// Docker swarm cluster. +func (c *ConfigService) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { + return types.ConfigCreateResponse{}, nil +} + +// ConfigInspectWithRaw is a helper function to simulate +// a mocked call to inspect a config for a Docker swarm +// cluster and return the raw body received from the API. +func (c *ConfigService) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error) { + return swarm.Config{}, nil, nil +} + +// ConfigList is a helper function to simulate +// a mocked call to list the configs for a +// Docker swarm cluster. +func (c *ConfigService) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + return nil, nil +} + +// ConfigRemove is a helper function to simulate +// a mocked call to remove a config for a +// Docker swarm cluster. +func (c *ConfigService) ConfigRemove(ctx context.Context, id string) error { return nil } + +// ConfigUpdate is a helper function to simulate +// a mocked call to update a config for a +// Docker swarm cluster. +func (c *ConfigService) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { + return nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// ImageService satisfies the ImageAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#ConfigAPIClient +var _ client.ConfigAPIClient = (*ConfigService)(nil) diff --git a/mock/docker/container.go b/mock/docker/container.go new file mode 100644 index 00000000..773b7259 --- /dev/null +++ b/mock/docker/container.go @@ -0,0 +1,532 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "strings" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/client" + "github.com/docker/docker/errdefs" + "github.com/docker/docker/pkg/stdcopy" + "github.com/docker/docker/pkg/stringid" + v1 "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ContainerService implements all the container +// related functions for the Docker mock. +type ContainerService struct{} + +// ContainerAttach is a helper function to simulate +// a mocked call to attach a connection to a +// Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerAttach +func (c *ContainerService) ContainerAttach(ctx context.Context, ctn string, options types.ContainerAttachOptions) (types.HijackedResponse, error) { + return types.HijackedResponse{}, nil +} + +// ContainerCommit is a helper function to simulate +// a mocked call to apply changes to a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerCommit +func (c *ContainerService) ContainerCommit(ctx context.Context, ctn string, options types.ContainerCommitOptions) (types.IDResponse, error) { + return types.IDResponse{}, nil +} + +// ContainerCreate is a helper function to simulate +// a mocked call to create a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerCreate +func (c *ContainerService) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, p *v1.Platform, ctn string) (container.ContainerCreateCreatedBody, error) { + // verify a container was provided + if len(ctn) == 0 { + return container.ContainerCreateCreatedBody{}, + errors.New("no container provided") + } + + // check if the container is notfound and + // check if the notfound should be ignored + if strings.Contains(ctn, "notfound") && + !strings.Contains(ctn, "ignorenotfound") { + return container.ContainerCreateCreatedBody{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // check if the container is not-found and + // check if the not-found should be ignored + if strings.Contains(ctn, "not-found") && + !strings.Contains(ctn, "ignore-not-found") { + return container.ContainerCreateCreatedBody{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // check if the image is not found + if strings.Contains(config.Image, "notfound") || + strings.Contains(config.Image, "not-found") { + return container.ContainerCreateCreatedBody{}, + errdefs.NotFound( + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", config.Image), + ) + } + + // create response object to return + response := container.ContainerCreateCreatedBody{ + ID: stringid.GenerateRandomID(), + } + + return response, nil +} + +// ContainerDiff is a helper function to simulate +// a mocked call to show the differences in the +// filesystem between two Docker containers. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerDiff +func (c *ContainerService) ContainerDiff(ctx context.Context, ctn string) ([]container.ContainerChangeResponseItem, error) { + return nil, nil +} + +// ContainerExecAttach is a helper function to simulate +// a mocked call to attach a connection to a process +// running inside a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExecAttach +func (c *ContainerService) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) { + return types.HijackedResponse{}, nil +} + +// ContainerExecCreate is a helper function to simulate +// a mocked call to create a process to run inside a +// Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExecCreate +func (c *ContainerService) ContainerExecCreate(ctx context.Context, ctn string, config types.ExecConfig) (types.IDResponse, error) { + return types.IDResponse{}, nil +} + +// ContainerExecInspect is a helper function to simulate +// a mocked call to inspect a process running inside a +// Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExecInspect +func (c *ContainerService) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) { + return types.ContainerExecInspect{}, nil +} + +// ContainerExecResize is a helper function to simulate +// a mocked call to resize the tty for a process running +// inside a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExecResize +func (c *ContainerService) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { + return nil +} + +// ContainerExecStart is a helper function to simulate +// a mocked call to start a process inside a Docker +// container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExecStart +func (c *ContainerService) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error { + return nil +} + +// ContainerExport is a helper function to simulate +// a mocked call to expore the contents of a Docker +// container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerExport +func (c *ContainerService) ContainerExport(ctx context.Context, ctn string) (io.ReadCloser, error) { + return nil, nil +} + +// ContainerInspect is a helper function to simulate +// a mocked call to inspect a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerInspect +func (c *ContainerService) ContainerInspect(ctx context.Context, ctn string) (types.ContainerJSON, error) { + // verify a container was provided + if len(ctn) == 0 { + return types.ContainerJSON{}, errors.New("no container provided") + } + + // check if the container is notfound and + // check if the notfound should be ignored + if strings.Contains(ctn, "notfound") && + !strings.Contains(ctn, "ignorenotfound") { + return types.ContainerJSON{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // check if the container is not-found and + // check if the not-found should be ignored + if strings.Contains(ctn, "not-found") && + !strings.Contains(ctn, "ignore-not-found") { + return types.ContainerJSON{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // create response object to return + response := types.ContainerJSON{ + ContainerJSONBase: &types.ContainerJSONBase{ + ID: stringid.GenerateRandomID(), + Image: "alpine:latest", + Name: ctn, + State: &types.ContainerState{Running: true}, + }, + Config: &container.Config{ + Image: "alpine:latest", + }, + } + + return response, nil +} + +// ContainerInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker container and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerInspectWithRaw +func (c *ContainerService) ContainerInspectWithRaw(ctx context.Context, ctn string, getSize bool) (types.ContainerJSON, []byte, error) { + // verify a container was provided + if len(ctn) == 0 { + return types.ContainerJSON{}, nil, errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || + strings.Contains(ctn, "not-found") { + return types.ContainerJSON{}, + nil, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // create response object to return + response := types.ContainerJSON{ + ContainerJSONBase: &types.ContainerJSONBase{ + ID: stringid.GenerateRandomID(), + Image: "alpine:latest", + Name: ctn, + State: &types.ContainerState{Running: true}, + }, + Config: &container.Config{ + Image: "alpine:latest", + }, + } + + // marshal response into raw bytes + b, err := json.Marshal(response) + if err != nil { + return types.ContainerJSON{}, nil, err + } + + return response, b, nil +} + +// ContainerKill is a helper function to simulate +// a mocked call to kill a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerKill +func (c *ContainerService) ContainerKill(ctx context.Context, ctn, signal string) error { + // verify a container was provided + if len(ctn) == 0 { + return errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || + strings.Contains(ctn, "not-found") { + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + return nil +} + +// ContainerList is a helper function to simulate +// a mocked call to list Docker containers. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerList +func (c *ContainerService) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { + return nil, nil +} + +// ContainerLogs is a helper function to simulate +// a mocked call to capture the logs from a +// Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerLogs +func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, options types.ContainerLogsOptions) (io.ReadCloser, error) { + // verify a container was provided + if len(ctn) == 0 { + return nil, errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || + strings.Contains(ctn, "not-found") { + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + return nil, errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + // create response object to return + response := new(bytes.Buffer) + + // write stdout logs to response buffer + _, err := stdcopy. + NewStdWriter(response, stdcopy.Stdout). + Write([]byte("hello to stdout from github.com/go-vela/worker/mock/docker")) + if err != nil { + return nil, err + } + + // write stderr logs to response buffer + _, err = stdcopy. + NewStdWriter(response, stdcopy.Stderr). + Write([]byte("hello to stderr from github.com/go-vela/worker/mock/docker")) + if err != nil { + return nil, err + } + + return ioutil.NopCloser(response), nil +} + +// ContainerPause is a helper function to simulate +// a mocked call to pause a running Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerPause +func (c *ContainerService) ContainerPause(ctx context.Context, ctn string) error { + return nil +} + +// ContainerRemove is a helper function to simulate +// a mocked call to remove a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerRemove +func (c *ContainerService) ContainerRemove(ctx context.Context, ctn string, options types.ContainerRemoveOptions) error { + // verify a container was provided + if len(ctn) == 0 { + return errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + return nil +} + +// ContainerRename is a helper function to simulate +// a mocked call to rename a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerRename +func (c *ContainerService) ContainerRename(ctx context.Context, container, newContainerName string) error { + return nil +} + +// ContainerResize is a helper function to simulate +// a mocked call to resize a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerResize +func (c *ContainerService) ContainerResize(ctx context.Context, ctn string, options types.ResizeOptions) error { + return nil +} + +// ContainerRestart is a helper function to simulate +// a mocked call to restart a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerRestart +func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, timeout *time.Duration) error { + return nil +} + +// ContainerStart is a helper function to simulate +// a mocked call to start a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStart +func (c *ContainerService) ContainerStart(ctx context.Context, ctn string, options types.ContainerStartOptions) error { + // verify a container was provided + if len(ctn) == 0 { + return errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || + strings.Contains(ctn, "not-found") { + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + return nil +} + +// ContainerStatPath is a helper function to simulate +// a mocked call to capture information about a path +// inside a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStatPath +func (c *ContainerService) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) { + return types.ContainerPathStat{}, nil +} + +// ContainerStats is a helper function to simulate +// a mocked call to capture information about a +// Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStats +func (c *ContainerService) ContainerStats(ctx context.Context, ctn string, stream bool) (types.ContainerStats, error) { + return types.ContainerStats{}, nil +} + +// ContainerStop is a helper function to simulate +// a mocked call to stop a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStop +func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, timeout *time.Duration) error { + // verify a container was provided + if len(ctn) == 0 { + return errors.New("no container provided") + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + } + + return nil +} + +// ContainerTop is a helper function to simulate +// a mocked call to show running processes inside +// a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerTop +func (c *ContainerService) ContainerTop(ctx context.Context, ctn string, arguments []string) (container.ContainerTopOKBody, error) { + return container.ContainerTopOKBody{}, nil +} + +// ContainerUnpause is a helper function to simulate +// a mocked call to unpause a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerUnpause +func (c *ContainerService) ContainerUnpause(ctx context.Context, ctn string) error { + return nil +} + +// ContainerUpdate is a helper function to simulate +// a mocked call to update a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerUpdate +func (c *ContainerService) ContainerUpdate(ctx context.Context, ctn string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { + return container.ContainerUpdateOKBody{}, nil +} + +// ContainerWait is a helper function to simulate +// a mocked call to wait for a running Docker +// container to finish. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerWait +func (c *ContainerService) ContainerWait(ctx context.Context, ctn string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) { + ctnCh := make(chan container.ContainerWaitOKBody, 1) + errCh := make(chan error, 1) + + // verify a container was provided + if len(ctn) == 0 { + // propagate the error to the error channel + errCh <- errors.New("no container provided") + + return ctnCh, errCh + } + + // check if the container is not found + if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { + // propagate the error to the error channel + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errCh <- errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) + + return ctnCh, errCh + } + + // create goroutine for responding to call + go func() { + // create response object to return + response := container.ContainerWaitOKBody{ + StatusCode: 15, + } + + // sleep for 1 second to simulate waiting for the container + time.Sleep(1 * time.Second) + + // propagate the response to the container channel + ctnCh <- response + + // propagate nil to the error channel + errCh <- nil + }() + + return ctnCh, errCh +} + +// ContainersPrune is a helper function to simulate +// a mocked call to prune Docker containers. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainersPrune +func (c *ContainerService) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) { + return types.ContainersPruneReport{}, nil +} + +// ContainerStatsOneShot is a helper function to simulate +// a mocked call to return near realtime stats for a given container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.CopyFromContainer +func (c *ContainerService) ContainerStatsOneShot(ctx context.Context, containerID string) (types.ContainerStats, error) { + return types.ContainerStats{}, nil +} + +// CopyFromContainer is a helper function to simulate +// a mocked call to copy content from a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.CopyFromContainer +func (c *ContainerService) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) { + return nil, types.ContainerPathStat{}, nil +} + +// CopyToContainer is a helper function to simulate +// a mocked call to copy content to a Docker container. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.CopyToContainer +func (c *ContainerService) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error { + return nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// ContainerService satisfies the ContainerAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#ContainerAPIClient +var _ client.ContainerAPIClient = (*ContainerService)(nil) diff --git a/mock/docker/distribution.go b/mock/docker/distribution.go new file mode 100644 index 00000000..eb78ce76 --- /dev/null +++ b/mock/docker/distribution.go @@ -0,0 +1,30 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/client" +) + +// DistributionService implements all the distribution +// related functions for the Docker mock. +type DistributionService struct{} + +// DistributionInspect is a helper function to simulate +// a mocked call to inspect a Docker image and return +// the digest and manifest. +func (d *DistributionService) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registry.DistributionInspect, error) { + return registry.DistributionInspect{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// DistributionService satisfies the DistributionAPIClient interface that +// the Docker client expects. +var _ client.DistributionAPIClient = (*DistributionService)(nil) diff --git a/mock/docker/doc.go b/mock/docker/doc.go new file mode 100644 index 00000000..04e8f801 --- /dev/null +++ b/mock/docker/doc.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package docker provides a mock for using the Docker API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc +// +// Usage: +// +// import "github.com/go-vela/worker/mock/docker" +package docker diff --git a/mock/docker/docker.go b/mock/docker/docker.go new file mode 100644 index 00000000..96b60895 --- /dev/null +++ b/mock/docker/docker.go @@ -0,0 +1,43 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +// nolint: godot // ignore comment ending in a list +// +// Version represents the supported Docker API version for the mock. +// +// The Docker API version is pinned to ensure compatibility between the +// Docker API and client. The goal is to maintain n-1 compatibility. +// +// The maximum supported Docker API version for the client is here: +// +// https://docs.docker.com/engine/api/#api-version-matrix +// +// For example (use the compatibility matrix above for reference): +// +// * the Docker version of v20.10 has a maximum API version of v1.41 +// * to maintain n-1, the API version is pinned to v1.40 +const Version = "v1.40" + +// New returns a client that is capable of handling +// Docker client calls and returning stub responses. +// nolint:golint // returning unexported type intentionally +func New() (*mock, error) { + return &mock{ + ConfigService: ConfigService{}, + ContainerService: ContainerService{}, + DistributionService: DistributionService{}, + ImageService: ImageService{}, + NetworkService: NetworkService{}, + NodeService: NodeService{}, + PluginService: PluginService{}, + SecretService: SecretService{}, + ServiceService: ServiceService{}, + SystemService: SystemService{}, + SwarmService: SwarmService{}, + VolumeService: VolumeService{}, + Version: Version, + }, nil +} diff --git a/mock/docker/image.go b/mock/docker/image.go new file mode 100644 index 00000000..23dac612 --- /dev/null +++ b/mock/docker/image.go @@ -0,0 +1,256 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "strings" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" + "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/client" + "github.com/docker/docker/errdefs" + "github.com/docker/docker/pkg/stringid" +) + +// ImageService implements all the image +// related functions for the Docker mock. +type ImageService struct{} + +// BuildCachePrune is a helper function to simulate +// a mocked call to prune the build cache for the +// Docker daemon. +func (i *ImageService) BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error) { + return nil, nil +} + +// BuildCancel is a helper function to simulate +// a mocked call to cancel building a Docker image. +func (i *ImageService) BuildCancel(ctx context.Context, id string) error { + return nil +} + +// ImageBuild is a helper function to simulate +// a mocked call to build a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageBuild +func (i *ImageService) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { + return types.ImageBuildResponse{}, nil +} + +// ImageCreate is a helper function to simulate +// a mocked call to create a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageCreate +func (i *ImageService) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { + return nil, nil +} + +// ImageHistory is a helper function to simulate +// a mocked call to inspect the history for a +// Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageHistory +func (i *ImageService) ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error) { + return nil, nil +} + +// ImageImport is a helper function to simulate +// a mocked call to import a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageImport +func (i *ImageService) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { + return nil, nil +} + +// ImageInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker image and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageInspectWithRaw +func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) { + // verify an image was provided + if len(image) == 0 { + return types.ImageInspect{}, nil, errors.New("no image provided") + } + + // check if the image is not found + if strings.Contains(image, "notfound") || strings.Contains(image, "not-found") { + return types.ImageInspect{}, + nil, + errdefs.NotFound( + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), + ) + } + + path := fmt.Sprintf("/var/lib/docker/overlay2/%s", stringid.GenerateRandomID()) + + // create response object to return + response := types.ImageInspect{ + ID: fmt.Sprintf("sha256:%s", stringid.GenerateRandomID()), + RepoTags: []string{"alpine:latest"}, + RepoDigests: []string{fmt.Sprintf("alpine@sha256:%s", stringid.GenerateRandomID())}, + Created: time.Now().String(), + Container: fmt.Sprintf("sha256:%s", stringid.GenerateRandomID()), + DockerVersion: "19.03.1-ce", + Architecture: "amd64", + Os: "linux", + Size: 5552690, + VirtualSize: 5552690, + GraphDriver: types.GraphDriverData{ + Data: map[string]string{ + "MergedDir": fmt.Sprintf("%s/merged", path), + "UpperDir": fmt.Sprintf("%s/diff", path), + "WorkDir": fmt.Sprintf("%s/work", path), + }, + Name: "overlay2", + }, + RootFS: types.RootFS{ + Type: "layers", + Layers: []string{fmt.Sprintf("sha256:%s", stringid.GenerateRandomID())}, + }, + Metadata: types.ImageMetadata{LastTagTime: time.Now()}, + } + + // marshal response into raw bytes + b, err := json.Marshal(response) + if err != nil { + return types.ImageInspect{}, nil, err + } + + return response, b, nil +} + +// ImageList is a helper function to simulate +// a mocked call to list Docker images. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageList +func (i *ImageService) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { + return nil, nil +} + +// ImageLoad is a helper function to simulate +// a mocked call to load a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageLoad +func (i *ImageService) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { + return types.ImageLoadResponse{}, nil +} + +// ImagePull is a helper function to simulate +// a mocked call to pull a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImagePull +func (i *ImageService) ImagePull(ctx context.Context, image string, options types.ImagePullOptions) (io.ReadCloser, error) { + // verify an image was provided + if len(image) == 0 { + return nil, errors.New("no container provided") + } + + // check if the image is notfound and + // check if the notfound should be ignored + if strings.Contains(image, "notfound") && + !strings.Contains(image, "ignorenotfound") { + return nil, + errdefs.NotFound( + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), + ) + } + + // check if the image is not-found and + // check if the not-found should be ignored + if strings.Contains(image, "not-found") && + !strings.Contains(image, "ignore-not-found") { + return nil, + errdefs.NotFound( + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), + ) + } + + // create response object to return + response := ioutil.NopCloser( + bytes.NewReader( + []byte( + fmt.Sprintf("%s\n%s\n%s\n%s\n", + fmt.Sprintf("latest: Pulling from %s", image), + fmt.Sprintf("Digest: sha256:%s", stringid.GenerateRandomID()), + fmt.Sprintf("Status: Image is up to date for %s", image), + image, + ), + ), + ), + ) + + return response, nil +} + +// ImagePush is a helper function to simulate +// a mocked call to push a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImagePush +func (i *ImageService) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) { + return nil, nil +} + +// ImageRemove is a helper function to simulate +// a mocked call to remove a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageRemove +func (i *ImageService) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) { + return nil, nil +} + +// ImageSave is a helper function to simulate +// a mocked call to save a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageSave +func (i *ImageService) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) { + return nil, nil +} + +// ImageSearch is a helper function to simulate +// a mocked call to search for a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageSearch +func (i *ImageService) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) { + return nil, nil +} + +// ImageTag is a helper function to simulate +// a mocked call to tag a Docker image. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImageTag +func (i *ImageService) ImageTag(ctx context.Context, image, ref string) error { + return nil +} + +// ImagesPrune is a helper function to simulate +// a mocked call to prune Docker images. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ImagesPrune +func (i *ImageService) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (types.ImagesPruneReport, error) { + return types.ImagesPruneReport{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// ImageService satisfies the ImageAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#ImageAPIClient +var _ client.ImageAPIClient = (*ImageService)(nil) diff --git a/mock/docker/mock.go b/mock/docker/mock.go new file mode 100644 index 00000000..08a139d7 --- /dev/null +++ b/mock/docker/mock.go @@ -0,0 +1,112 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "net" + "net/http" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/client" +) + +type mock struct { + // Services + ConfigService + ContainerService + DistributionService + ImageService + NetworkService + NodeService + PluginService + SecretService + ServiceService + SwarmService + SystemService + VolumeService + + // Docker API version for the mock + Version string +} + +// ClientVersion is a helper function to return +// the version string associated with the mock. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ClientVersion +func (m *mock) ClientVersion() string { + return m.Version +} + +// Close is a helper function to simulate +// closing the transport client for the mock. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.Close +func (m *mock) Close() error { + return nil +} + +// DaemonHost is a helper function to simulate +// returning the host address used by the client. +func (m *mock) DaemonHost() string { + return "" +} + +// DialSession is a helper function to simulate +// returning a connection that can be used +// for communication with daemon. +func (m *mock) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) { + return nil, nil +} + +// DialHijack is a helper function to simulate +// returning a hijacked connection with +// negotiated protocol proto. +func (m *mock) DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error) { + return nil, nil +} + +// Dialer is a helper function to simulate +// returning a dialer for the raw stream +// connection, with HTTP/1.1 header, that can +// be used for proxying the daemon connection. +func (m *mock) Dialer() func(context.Context) (net.Conn, error) { + return func(context.Context) (net.Conn, error) { return nil, nil } +} + +// HTTPClient is a helper function to simulate +// returning a copy of the HTTP client bound +// to the server. +func (m *mock) HTTPClient() *http.Client { + return http.DefaultClient +} + +// NegotiateAPIVersion is a helper function to simulate +// a mocked call to query the API and update the client +// version to match the API version. +func (m *mock) NegotiateAPIVersion(ctx context.Context) {} + +// NegotiateAPIVersionPing is a helper function to simulate +// a mocked call to update the client version to match +// the ping version if it's less than the default version. +func (m *mock) NegotiateAPIVersionPing(types.Ping) {} + +// ServerVersion is a helper function to simulate +// a mocked call to return information on the +// Docker client and server host. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServerVersion +func (m *mock) ServerVersion(ctx context.Context) (types.Version, error) { + return types.Version{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure +// that our mock satisfies the Go interface that the +// Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#CommonAPIClient +var _ client.CommonAPIClient = (*mock)(nil) diff --git a/mock/docker/network.go b/mock/docker/network.go new file mode 100644 index 00000000..56df60d5 --- /dev/null +++ b/mock/docker/network.go @@ -0,0 +1,188 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "strings" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/client" + "github.com/docker/docker/errdefs" + "github.com/docker/docker/pkg/stringid" +) + +// NetworkService implements all the network +// related functions for the Docker mock. +type NetworkService struct{} + +// NetworkConnect is a helper function to simulate +// a mocked call to connect to a Docker network. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkConnect +func (n *NetworkService) NetworkConnect(ctx context.Context, network, container string, config *network.EndpointSettings) error { + return nil +} + +// NetworkCreate is a helper function to simulate +// a mocked call to create a Docker network. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkCreate +func (n *NetworkService) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { + // verify a network was provided + if len(name) == 0 { + return types.NetworkCreateResponse{}, errors.New("no network provided") + } + + // check if the network is notfound and + // check if the notfound should be ignored + if strings.Contains(name, "notfound") && + !strings.Contains(name, "ignorenotfound") { + return types.NetworkCreateResponse{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) + } + + // check if the network is not-found and + // check if the not-found should be ignored + if strings.Contains(name, "not-found") && + !strings.Contains(name, "ignore-not-found") { + return types.NetworkCreateResponse{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) + } + + // create response object to return + response := types.NetworkCreateResponse{ + ID: stringid.GenerateRandomID(), + } + + return response, nil +} + +// NetworkDisconnect is a helper function to simulate +// a mocked call to disconnect from a Docker network. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkDisconnect +func (n *NetworkService) NetworkDisconnect(ctx context.Context, network, container string, force bool) error { + return nil +} + +// NetworkInspect is a helper function to simulate +// a mocked call to inspect a Docker network. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkInspect +func (n *NetworkService) NetworkInspect(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, error) { + // verify a network was provided + if len(network) == 0 { + return types.NetworkResource{}, errors.New("no network provided") + } + + // check if the network is notfound + if strings.Contains(network, "notfound") { + return types.NetworkResource{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) + } + + // check if the network is not-found + if strings.Contains(network, "not-found") { + return types.NetworkResource{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) + } + + // create response object to return + response := types.NetworkResource{ + Attachable: false, + ConfigOnly: false, + Created: time.Now(), + Driver: "host", + ID: stringid.GenerateRandomID(), + Ingress: false, + Internal: false, + Name: network, + Scope: "local", + } + + return response, nil +} + +// NetworkInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker network and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkInspectWithRaw +func (n *NetworkService) NetworkInspectWithRaw(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) { + // verify a network was provided + if len(network) == 0 { + return types.NetworkResource{}, nil, errors.New("no network provided") + } + + // create response object to return + response := types.NetworkResource{ + Attachable: false, + ConfigOnly: false, + Created: time.Now(), + Driver: "host", + ID: stringid.GenerateRandomID(), + Ingress: false, + Internal: false, + Name: network, + Scope: "local", + } + + // marshal response into raw bytes + b, err := json.Marshal(response) + if err != nil { + return types.NetworkResource{}, nil, err + } + + return response, b, nil +} + +// NetworkList is a helper function to simulate +// a mocked call to list Docker networks. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkList +func (n *NetworkService) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { + return nil, nil +} + +// NetworkRemove is a helper function to simulate +// a mocked call to remove Docker a network. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworkRemove +func (n *NetworkService) NetworkRemove(ctx context.Context, network string) error { + // verify a network was provided + if len(network) == 0 { + return errors.New("no network provided") + } + + return nil +} + +// NetworksPrune is a helper function to simulate +// a mocked call to prune Docker networks. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NetworksPrune +func (n *NetworkService) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) { + return types.NetworksPruneReport{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// NetworkService satisfies the NetworkAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#NetworkAPIClient +var _ client.NetworkAPIClient = (*NetworkService)(nil) diff --git a/mock/docker/node.go b/mock/docker/node.go new file mode 100644 index 00000000..168f0f01 --- /dev/null +++ b/mock/docker/node.go @@ -0,0 +1,62 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/client" +) + +// NodeService implements all the node +// related functions for the Docker mock. +type NodeService struct{} + +// NodeInspectWithRaw is a helper function to simulate +// a mocked call to inspect a node for a Docker swarm +// cluster and return the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NodeInspectWithRaw +func (n *NodeService) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { + return swarm.Node{}, nil, nil +} + +// NodeList is a helper function to simulate +// a mocked call to list the nodes for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NodeList +func (n *NodeService) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { + return nil, nil +} + +// NodeRemove is a helper function to simulate +// a mocked call to remove a node from a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NodeRemove +func (n *NodeService) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { + return nil +} + +// NodeUpdate is a helper function to simulate +// a mocked call to update a node for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.NodeUpdate +func (n *NodeService) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { + return nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// NodeService satisfies the NodeAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#NodeAPIClient +var _ client.NodeAPIClient = (*NodeService)(nil) diff --git a/mock/docker/plugin.go b/mock/docker/plugin.go new file mode 100644 index 00000000..396250a0 --- /dev/null +++ b/mock/docker/plugin.go @@ -0,0 +1,109 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "io" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/client" +) + +// PluginService implements all the plugin +// related functions for the Docker mock. +type PluginService struct{} + +// PluginCreate is a helper function to simulate +// a mocked call to create a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginCreate +func (p *PluginService) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error { + return nil +} + +// PluginDisable is a helper function to simulate +// a mocked call to disable a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginDisable +func (p *PluginService) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { + return nil +} + +// PluginEnable is a helper function to simulate +// a mocked call to enable a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginEnable +func (p *PluginService) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { + return nil +} + +// PluginInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker plugin and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginInspectWithRaw +func (p *PluginService) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { + return nil, nil, nil +} + +// PluginInstall is a helper function to simulate +// a mocked call to install a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginInstall +func (p *PluginService) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { + return nil, nil +} + +// PluginList is a helper function to simulate +// a mocked call to list Docker plugins. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginList +func (p *PluginService) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) { + return types.PluginsListResponse{}, nil +} + +// PluginPush is a helper function to simulate +// a mocked call to push a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginPush +func (p *PluginService) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { + return nil, nil +} + +// PluginRemove is a helper function to simulate +// a mocked call to remove a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginRemove +func (p *PluginService) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { + return nil +} + +// PluginSet is a helper function to simulate +// a mocked call to update settings for a +// Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginSet +func (p *PluginService) PluginSet(ctx context.Context, name string, args []string) error { + return nil +} + +// PluginUpgrade is a helper function to simulate +// a mocked call to upgrade a Docker plugin. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.PluginUpgrade +func (p *PluginService) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { + return nil, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// PluginService satisfies the PluginAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#PluginAPIClient +var _ client.PluginAPIClient = (*PluginService)(nil) diff --git a/mock/docker/secret.go b/mock/docker/secret.go new file mode 100644 index 00000000..04f4495a --- /dev/null +++ b/mock/docker/secret.go @@ -0,0 +1,71 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/client" +) + +// SecretService implements all the secret +// related functions for the Docker mock. +type SecretService struct{} + +// SecretCreate is a helper function to simulate +// a mocked call to create a secret for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SecretCreate +func (s *SecretService) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { + return types.SecretCreateResponse{}, nil +} + +// SecretInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker secret and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SecretInspectWithRaw +func (s *SecretService) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) { + return swarm.Secret{}, nil, nil +} + +// SecretList is a helper function to simulate +// a mocked call to list secrets for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SecretList +func (s *SecretService) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + return nil, nil +} + +// SecretRemove is a helper function to simulate +// a mocked call to remove a secret for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SecretRemove +func (s *SecretService) SecretRemove(ctx context.Context, id string) error { + return nil +} + +// SecretUpdate is a helper function to simulate +// a mocked call to update a secret for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SecretUpdate +func (s *SecretService) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { + return nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// SecretService satisfies the SecretAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#SecretAPIClient +var _ client.SecretAPIClient = (*SecretService)(nil) diff --git a/mock/docker/service.go b/mock/docker/service.go new file mode 100644 index 00000000..750a1522 --- /dev/null +++ b/mock/docker/service.go @@ -0,0 +1,106 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "io" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/client" +) + +// ServiceService implements all the service +// related functions for the Docker mock. +type ServiceService struct{} + +// ServiceCreate is a helper function to simulate +// a mocked call to create a service for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceCreate +func (s *ServiceService) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { + return types.ServiceCreateResponse{}, nil +} + +// ServiceInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker service and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceInspectWithRaw +func (s *ServiceService) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) { + return swarm.Service{}, nil, nil +} + +// ServiceList is a helper function to simulate +// a mocked call to list services for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceList +func (s *ServiceService) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { + return nil, nil +} + +// ServiceLogs is a helper function to simulate +// a mocked call to capture the logs from a +// service for a Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceLogs +func (s *ServiceService) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { + return nil, nil +} + +// ServiceRemove is a helper function to simulate +// a mocked call to remove a service for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceRemove +func (s *ServiceService) ServiceRemove(ctx context.Context, serviceID string) error { + return nil +} + +// ServiceUpdate is a helper function to simulate +// a mocked call to update a service for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ServiceUpdate +func (s *ServiceService) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) { + return types.ServiceUpdateResponse{}, nil +} + +// TaskInspectWithRaw is a helper function to simulate +// a mocked call to inspect a task for a Docker swarm +// cluster and return the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.TaskInspectWithRaw +func (s *ServiceService) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { + return swarm.Task{}, nil, nil +} + +// TaskList is a helper function to simulate +// a mocked call to list tasks for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.TaskList +func (s *ServiceService) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { + return nil, nil +} + +// TaskLogs is a helper function to simulate +// a mocked call to capture the logs from a +// task for a Docker swarm cluster. +func (s *ServiceService) TaskLogs(ctx context.Context, taskID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { + return nil, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// ServiceService satisfies the ServiceAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#ServiceAPIClient +var _ client.ServiceAPIClient = (*ServiceService)(nil) diff --git a/mock/docker/swarm.go b/mock/docker/swarm.go new file mode 100644 index 00000000..bf45b893 --- /dev/null +++ b/mock/docker/swarm.go @@ -0,0 +1,89 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/client" +) + +// SwarmService implements all the swarm +// related functions for the Docker mock. +type SwarmService struct{} + +// SwarmGetUnlockKey is a helper function to simulate +// a mocked call to capture the unlock key for a +// Docker swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmGetUnlockKey +func (s *SwarmService) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { + return types.SwarmUnlockKeyResponse{}, nil +} + +// SwarmInit is a helper function to simulate +// a mocked call to initialize the Docker +// swarm cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmInit +func (s *SwarmService) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { + return "", nil +} + +// SwarmInspect is a helper function to simulate +// a mocked call to inspect the Docker swarm +// cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmInspect +func (s *SwarmService) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { + return swarm.Swarm{}, nil +} + +// SwarmJoin is a helper function to simulate +// a mocked call to join the Docker swarm +// cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmJoin +func (s *SwarmService) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { + return nil +} + +// SwarmLeave is a helper function to simulate +// a mocked call to leave the Docker swarm +// cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmLeave +func (s *SwarmService) SwarmLeave(ctx context.Context, force bool) error { + return nil +} + +// SwarmUnlock is a helper function to simulate +// a mocked call to unlock the Docker swarm +// cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmUnlock +func (s *SwarmService) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { + return nil +} + +// SwarmUpdate is a helper function to simulate +// a mocked call to update the Docker swarm +// cluster. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.SwarmUpdate +func (s *SwarmService) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { + return nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// SwarmService satisfies the SwarmAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#SwarmAPIClient +var _ client.SwarmAPIClient = (*SwarmService)(nil) diff --git a/mock/docker/system.go b/mock/docker/system.go new file mode 100644 index 00000000..bac9f756 --- /dev/null +++ b/mock/docker/system.go @@ -0,0 +1,72 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/events" + "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/client" +) + +// SystemService implements all the system +// related functions for the Docker mock. +type SystemService struct{} + +// DiskUsage is a helper function to simulate +// a mocked call to capture the data usage +// from the Docker daemon. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.DiskUsage +func (s *SystemService) DiskUsage(ctx context.Context) (types.DiskUsage, error) { + return types.DiskUsage{}, nil +} + +// Events is a helper function to simulate +// a mocked call to capture the events +// from the Docker daemon. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.Events +func (s *SystemService) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) { + return nil, nil +} + +// Info is a helper function to simulate +// a mocked call to capture the system +// information from the Docker daemon. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.Info +func (s *SystemService) Info(ctx context.Context) (types.Info, error) { + return types.Info{}, nil +} + +// Ping is a helper function to simulate +// a mocked call to ping the Docker +// daemon and return version information. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.Ping +func (s *SystemService) Ping(ctx context.Context) (types.Ping, error) { + return types.Ping{}, nil +} + +// RegistryLogin is a helper function to simulate +// a mocked call to authenticate the Docker +// daemon against a Docker registry. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.RegistryLogin +func (s *SystemService) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { + return registry.AuthenticateOKBody{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// SystemService satisfies the SystemAPIClient interface that +// the Docker client expects. +// +// hhttps://pkg.go.dev/github.com/docker/docker/client?tab=doc#SystemAPIClient +var _ client.NetworkAPIClient = (*NetworkService)(nil) diff --git a/mock/docker/volume.go b/mock/docker/volume.go new file mode 100644 index 00000000..36009818 --- /dev/null +++ b/mock/docker/volume.go @@ -0,0 +1,184 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package docker + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "strings" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/volume" + "github.com/docker/docker/client" + "github.com/docker/docker/errdefs" + "github.com/docker/docker/pkg/stringid" +) + +// VolumeService implements all the volume +// related functions for the Docker mock. +type VolumeService struct{} + +// VolumeCreate is a helper function to simulate +// a mocked call to create a Docker volume. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeCreate +func (v *VolumeService) VolumeCreate(ctx context.Context, options volume.VolumeCreateBody) (types.Volume, error) { + // verify a volume was provided + if len(options.Name) == 0 { + return types.Volume{}, errors.New("no volume provided") + } + + // check if the volume is notfound and + // check if the notfound should be ignored + if strings.Contains(options.Name, "notfound") && + !strings.Contains(options.Name, "ignorenotfound") { + return types.Volume{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) + } + + // check if the volume is not-found and + // check if the not-found should be ignored + if strings.Contains(options.Name, "not-found") && + !strings.Contains(options.Name, "ignore-not-found") { + return types.Volume{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) + } + + // create response object to return + response := types.Volume{ + CreatedAt: time.Now().String(), + Driver: options.Driver, + Labels: options.Labels, + Mountpoint: fmt.Sprintf("/var/lib/docker/volumes/%s/_data", stringid.GenerateRandomID()), + Name: options.Name, + Options: options.DriverOpts, + Scope: "local", + } + + return response, nil +} + +// VolumeInspect is a helper function to simulate +// a mocked call to inspect a Docker volume. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeInspect +func (v *VolumeService) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { + // verify a volume was provided + if len(volumeID) == 0 { + return types.Volume{}, errors.New("no volume provided") + } + + // check if the volume is notfound + if strings.Contains(volumeID, "notfound") { + return types.Volume{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) + } + + // check if the volume is not-found + if strings.Contains(volumeID, "not-found") { + return types.Volume{}, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) + } + + // create response object to return + response := types.Volume{ + CreatedAt: time.Now().String(), + Driver: "local", + Mountpoint: fmt.Sprintf("/var/lib/docker/volumes/%s/_data", stringid.GenerateRandomID()), + Name: volumeID, + Scope: "local", + } + + return response, nil +} + +// VolumeInspectWithRaw is a helper function to simulate +// a mocked call to inspect a Docker volume and return +// the raw body received from the API. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeInspectWithRaw +func (v *VolumeService) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { + // verify a volume was provided + if len(volumeID) == 0 { + return types.Volume{}, nil, errors.New("no volume provided") + } + + // check if the volume is notfound + if strings.Contains(volumeID, "notfound") { + return types.Volume{}, nil, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) + } + + // check if the volume is not-found + if strings.Contains(volumeID, "not-found") { + return types.Volume{}, nil, + // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) + } + + // create response object to return + response := types.Volume{ + CreatedAt: time.Now().String(), + Driver: "local", + Mountpoint: fmt.Sprintf("/var/lib/docker/volumes/%s/_data", stringid.GenerateRandomID()), + Name: volumeID, + Scope: "local", + } + + // marshal response into raw bytes + b, err := json.Marshal(response) + if err != nil { + return types.Volume{}, nil, err + } + + return response, b, nil +} + +// VolumeList is a helper function to simulate +// a mocked call to list Docker volumes. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeList +func (v *VolumeService) VolumeList(ctx context.Context, filter filters.Args) (volume.VolumeListOKBody, error) { + return volume.VolumeListOKBody{}, nil +} + +// VolumeRemove is a helper function to simulate +// a mocked call to remove Docker a volume. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeRemove +func (v *VolumeService) VolumeRemove(ctx context.Context, volumeID string, force bool) error { + // verify a volume was provided + if len(volumeID) == 0 { + return errors.New("no volume provided") + } + + return nil +} + +// VolumesPrune is a helper function to simulate +// a mocked call to prune Docker volumes. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumesPrune +func (v *VolumeService) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error) { + return types.VolumesPruneReport{}, nil +} + +// WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES +// +// This line serves as a quick and efficient way to ensure that our +// VolumeService satisfies the VolumeAPIClient interface that +// the Docker client expects. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#VolumeAPIClient +var _ client.VolumeAPIClient = (*VolumeService)(nil) diff --git a/mock/mock.go b/mock/mock.go new file mode 100644 index 00000000..7ff45c76 --- /dev/null +++ b/mock/mock.go @@ -0,0 +1,5 @@ +// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package mock diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 8f18dc42..e293904d 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -7,7 +7,7 @@ package docker import ( docker "github.com/docker/docker/client" - mock "github.com/go-vela/mock/docker" + mock "github.com/go-vela/worker/mock/docker" ) // nolint: godot // ignore comment ending in a list @@ -96,7 +96,7 @@ func NewMock(opts ...ClientOpt) (*client, error) { // create Docker client from the mock client // - // https://pkg.go.dev/github.com/go-vela/mock/docker#New + // https://pkg.go.dev/github.com/go-vela/worker/mock/docker#New _docker, err := mock.New() if err != nil { return nil, err From b43e72a99093e50bb930caef7640355702a1f638 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 1 Nov 2021 10:11:10 -0500 Subject: [PATCH 211/430] refactor: pull server mock package from server (#230) --- executor/context_test.go | 2 +- executor/executor_test.go | 2 +- executor/linux/build_test.go | 2 +- executor/linux/driver_test.go | 2 +- executor/linux/linux_test.go | 2 +- executor/linux/opts_test.go | 2 +- executor/linux/secret_test.go | 2 +- executor/linux/service_test.go | 2 +- executor/linux/stage_test.go | 2 +- executor/linux/step_test.go | 2 +- executor/local/local_test.go | 2 +- executor/local/opts_test.go | 2 +- executor/setup_test.go | 2 +- go.mod | 4 +- go.sum | 126 +++++++++--------------------- internal/build/snapshot_test.go | 2 +- internal/build/upload_test.go | 2 +- internal/service/snapshot_test.go | 2 +- internal/service/upload_test.go | 2 +- internal/step/snapshot_test.go | 2 +- internal/step/upload_test.go | 2 +- 21 files changed, 60 insertions(+), 108 deletions(-) diff --git a/executor/context_test.go b/executor/context_test.go index 4ccee9a6..ba83e911 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -12,7 +12,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/executor/linux" diff --git a/executor/executor_test.go b/executor/executor_test.go index 8995ca6f..7b27cc08 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 7ab2416a..d95474f5 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -10,8 +10,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/mock/server" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/mock/server" "github.com/urfave/cli/v2" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go index 02b60e25..b6f77fc9 100644 --- a/executor/linux/driver_test.go +++ b/executor/linux/driver_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index c6541bde..5965c621 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -10,7 +10,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 4e25e2fd..356b23a1 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 8bfb7c80..0fe2da18 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -14,8 +14,8 @@ import ( "github.com/gin-gonic/gin" "github.com/urfave/cli/v2" - "github.com/go-vela/mock/server" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index bec3f492..fea5d62d 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 0672389b..67164059 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" "github.com/urfave/cli/v2" - "github.com/go-vela/mock/server" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index e5dd7a89..adee0d87 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/local/local_test.go b/executor/local/local_test.go index 0d000e1d..cc64b289 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -10,7 +10,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index 6fa5f1d7..2ed93c51 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/setup_test.go b/executor/setup_test.go index c39b5d33..3390a3cc 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -11,7 +11,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" + "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" diff --git a/go.mod b/go.mod index d8ba8a1d..0d0d9323 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 + github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/mock v0.10.0 github.com/go-vela/sdk-go v0.10.1 - github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f + github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057 github.com/go-vela/types v0.10.0 github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index e28c7bac..8ff84a7c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -57,7 +56,6 @@ github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFP github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -74,14 +72,12 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= github.com/alicebob/miniredis/v2 v2.16.0 h1:ALkyFg7bSTEd1Mkrb4ppq4fnwjklA59dVtIehXCUZkU= github.com/alicebob/miniredis/v2 v2.16.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.54/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -103,19 +99,11 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200709052629-daa8e1ccc0bc/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -133,7 +121,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -144,15 +131,17 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= @@ -177,7 +166,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -198,25 +186,20 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0/go.mod h1:dJyDHQuwXsyQUkiXpcjbcXxpuQnf3qvA9G+0kPciTQc= github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= -github.com/go-vela/sdk-go v0.10.0/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= github.com/go-vela/sdk-go v0.10.1 h1:p/vKSHafLAJVGX64LMQchswd76NU0+NI6TAXC1ZCfH8= github.com/go-vela/sdk-go v0.10.1/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= -github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f h1:V9BUiWTN5DddiWBZ+m7hg7gF4aLudhznr6T2cWZHqB0= -github.com/go-vela/server v0.10.2-0.20211027183311-18eef236ab3f/go.mod h1:zBKgcYoDFATxGLshdFDoYUdTvFYejUNB0e8UBNE6gBg= +github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057 h1:KmemRdqIzi3TuEzqZq8HImraz5Lm/P7L+sbvO3itut4= +github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057/go.mod h1:XDG9Fo84TzycmUM4ocm2Exdvlri3VoYT3kbvPWt5uw0= github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= github.com/go-vela/types v0.10.0/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -251,7 +234,7 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -304,47 +287,44 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= +github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= +github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE= -github.com/hashicorp/vault/api v1.2.0/go.mod h1:dAjw0T5shMnrfH7Q/Mst+LrcTKvStZBVs1PICEDpUqY= -github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= -github.com/hashicorp/vault/sdk v0.2.1/go.mod h1:WfUiO1vYzfBkz1TmoE4ZGU7HD0T0Cl/rZwaxjBkgN4U= +github.com/hashicorp/vault/api v1.3.0/go.mod h1:EabNQLI0VWbWoGlA+oBLC8PXmR9D60aUVgQGvangFWQ= +github.com/hashicorp/vault/sdk v0.3.0/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -354,7 +334,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -391,10 +370,10 @@ github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpz github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -409,7 +388,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -450,7 +428,7 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -463,7 +441,6 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -492,32 +469,23 @@ github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -526,7 +494,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -537,20 +504,18 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -566,7 +531,6 @@ github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXY github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -578,9 +542,7 @@ github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -602,8 +564,6 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5 h1:MCfT24H3f//U5+UCrZp1/riVO3B50BovxtDiNn0XKkk= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 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= @@ -620,12 +580,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3 h1:oBcONsksxvpeodDrLjiMDaKHXKAVVfAydhe/792CE/o= go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -633,17 +595,14 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 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= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -684,11 +643,11 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -702,7 +661,6 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -715,7 +673,6 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -749,7 +706,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -759,7 +715,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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= @@ -788,7 +743,6 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -801,6 +755,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -823,7 +778,6 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -905,6 +859,7 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -928,6 +883,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -937,13 +893,11 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 h1:bFFRpT+e8JJVY7lMMfvezL1ZIwqiwmPl2bsE2yx4HqM= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -952,8 +906,11 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -967,7 +924,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -976,11 +932,9 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8X gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1000,12 +954,10 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.1.2/go.mod h1:/AGV0zvqF3mt9ZtzLzQmXWQ/5vr+1V1TyHZGZVjzmwI= -gorm.io/driver/sqlite v1.1.6/go.mod h1:W8LmC/6UvVbHKah0+QOC7Ja66EaZXHwUTjgXY8YNWX8= -gorm.io/gorm v1.21.15/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gorm.io/gorm v1.21.16/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gorm.io/driver/postgres v1.2.1/go.mod h1:SHRZhu+D0tLOHV5qbxZRUM6kBcf3jp/kxPz2mYMTsNY= +gorm.io/driver/sqlite v1.2.3/go.mod h1:wkiGvZF3le/8vjCRYg0bT8TSw6APZ5rtgKW8uQYE3sc= +gorm.io/gorm v1.22.0/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.22.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go index 7747b6e0..8f5f4712 100644 --- a/internal/build/snapshot_test.go +++ b/internal/build/snapshot_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" ) diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go index b29f90fc..4695af1a 100644 --- a/internal/build/upload_test.go +++ b/internal/build/upload_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" ) diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index 85d8ee48..c51da19e 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" ) diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index 4b88c19e..c93f1524 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" ) diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index cf3073aa..385e22e9 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" ) diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index 957c92c7..fdbe740c 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/mock/server" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" ) From e89abc1653197a5d2fd5393cc6b9b0b2e64faf48 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 4 Nov 2021 11:05:12 -0500 Subject: [PATCH 212/430] feat: enable streaming logs for container (#233) * revert: stream container logs * feat: add flag to enable streaming logs * feat(executor): add logic to stream logs if enabled * enhance: make log publishing method configurable * enhance: use configurable log publishing method * chore: configure time log publish method for local * chore: address linter feedback * chore: fix tests for code changes * chore: address linter feedback v2 --- cmd/vela-worker/exec.go | 19 +-- cmd/vela-worker/run.go | 3 +- docker-compose.yml | 2 + executor/executor_test.go | 18 ++- executor/flags.go | 7 + executor/linux/linux.go | 16 +- executor/linux/opts.go | 17 ++ executor/linux/opts_test.go | 44 ++++++ executor/linux/service.go | 131 +++++++++++++-- executor/linux/step.go | 131 +++++++++++++-- executor/setup.go | 12 ++ executor/setup_test.go | 166 ++++++++++++-------- router/middleware/executor/executor_test.go | 30 ++-- 13 files changed, 470 insertions(+), 126 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index c2166e8e..3360bdb5 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -47,15 +47,16 @@ func (w *Worker) exec(index int) error { // // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ - Driver: w.Config.Executor.Driver, - Client: w.VelaClient, - Hostname: w.Config.API.Address.Hostname(), - Runtime: w.Runtime, - Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), - Repo: item.Repo, - User: item.User, - Version: v.Semantic(), + Driver: w.Config.Executor.Driver, + LogMethod: w.Config.Executor.LogMethod, + Client: w.VelaClient, + Hostname: w.Config.API.Address.Hostname(), + Runtime: w.Runtime, + Build: item.Build, + Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), + Repo: item.Repo, + User: item.User, + Version: v.Semantic(), }) // add the executor to the worker diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 74af6be5..0a9e38cf 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -95,7 +95,8 @@ func run(c *cli.Context) error { CheckIn: c.Duration("checkIn"), // executor configuration Executor: &executor.Setup{ - Driver: c.String("executor.driver"), + Driver: c.String("executor.driver"), + LogMethod: c.String("executor.log_method"), }, // logger configuration Logger: &Logger{ diff --git a/docker-compose.yml b/docker-compose.yml index e696a1b6..3bf26fb9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,8 @@ services: networks: - vela environment: + EXECUTOR_DRIVER: linux + EXECUTOR_LOG_METHOD: 'time-chunks' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' QUEUE_ROUTES: 'docker,local,docker:local' diff --git a/executor/executor_test.go b/executor/executor_test.go index 7b27cc08..55211fda 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -44,6 +44,7 @@ func TestExecutor_New(t *testing.T) { _linux, err := linux.New( linux.WithBuild(_build), linux.WithHostname("localhost"), + linux.WithLogMethod("byte-chunks"), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), linux.WithRuntime(_runtime), @@ -92,14 +93,15 @@ func TestExecutor_New(t *testing.T) { { failure: false, setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - Version: "v1.0.0", + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", }, want: _linux, }, diff --git a/executor/flags.go b/executor/flags.go index f29e4549..73895019 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -42,4 +42,11 @@ var Flags = []cli.Flag{ Usage: "driver to be used for the executor", Value: constants.DriverLinux, }, + &cli.StringFlag{ + EnvVars: []string{"VELA_EXECUTOR_LOG_METHOD", "EXECUTOR_LOG_METHOD"}, + FilePath: "/vela/executor/log_method", + Name: "executor.log_method", + Usage: "method used to publish logs to the server - options: (byte-chunks|time-chunks)", + Value: "byte-chunks", + }, } diff --git a/executor/linux/linux.go b/executor/linux/linux.go index fea5eeea..96248d5c 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -30,19 +30,21 @@ type ( secret *secretSvc // private fields - init *pipeline.Container - logger *logrus.Entry - build *library.Build - pipeline *pipeline.Build - repo *library.Repo + init *pipeline.Container + logger *logrus.Entry + logMethod string + build *library.Build + pipeline *pipeline.Build + repo *library.Repo // nolint: structcheck,unused // ignore false positives secrets sync.Map services sync.Map serviceLogs sync.Map steps sync.Map stepLogs sync.Map - user *library.User - err error + + user *library.User + err error } // nolint: structcheck // ignore false positive diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 8dcd266b..d23914ff 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -42,6 +42,23 @@ func WithBuild(b *library.Build) Opt { } } +// WithLogMethod sets the method used to publish logs in the client. +func WithLogMethod(method string) Opt { + logrus.Trace("configuring log streaming in linux client") + + return func(c *client) error { + // check if a method is provided + if len(method) == 0 { + return fmt.Errorf("empty log method provided") + } + + // set the log method in the client + c.logMethod = method + + return nil + } +} + // WithHostname sets the hostname in the client. func WithHostname(hostname string) Opt { logrus.Trace("configuring hostname in linux client") diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 356b23a1..2fc20829 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -65,6 +65,50 @@ func TestLinux_Opt_WithBuild(t *testing.T) { } } +func TestLinux_Opt_WithLogMethod(t *testing.T) { + // setup tests + tests := []struct { + failure bool + logMethod string + }{ + { + failure: false, + logMethod: "byte-chunks", + }, + { + failure: false, + logMethod: "time-chunks", + }, + { + failure: true, + logMethod: "", + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithLogMethod(test.logMethod), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogMethod should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithLogMethod returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.logMethod, test.logMethod) { + t.Errorf("WithLogMethod is %v, want %v", _engine.logMethod, test.logMethod) + } + } +} + func TestLinux_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { diff --git a/executor/linux/service.go b/executor/linux/service.go index 7e67bf50..63f039f1 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -5,6 +5,8 @@ package linux import ( + "bufio" + "bytes" "context" "fmt" "io/ioutil" @@ -161,6 +163,8 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error } // StreamService tails the output for a service. +// +// nolint: funlen // ignore function length func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with service metadata // @@ -175,7 +179,6 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err return err } - // nolint: dupl // ignore similar code defer func() { // tail the runtime container rc, err := c.Runtime.TailContainer(ctx, ctn) @@ -217,19 +220,125 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err } defer rc.Close() - // set the timeout to the repo timeout - // to ensure the stream is not cut off - c.Vela.SetTimeout(time.Minute * time.Duration(c.repo.GetTimeout())) + // create new buffer for uploading logs + logs := new(bytes.Buffer) + + // nolint: dupl // ignore similar code with step + switch c.logMethod { + case "time-chunks": + // create new channel for processing logs + done := make(chan bool) + + // nolint: dupl // ignore similar code + go func() { + logger.Debug("polling logs for container") + + // spawn "infinite" loop that will upload logs + // from the buffer until the channel is closed + for { + // sleep for "1s" before attempting to upload logs + time.Sleep(1 * time.Second) + + // create a non-blocking select to check if the channel is closed + select { + // after repo timeout of idle (no response) end the stream + // + // this is a safety mechanism + case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): + logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) + + return + // channel is closed + case <-done: + logger.Trace("channel closed for polling container logs") + + // return out of the go routine + return + // channel is not closed + default: + // get the current size of log data + size := len(_log.GetData()) + + // update the existing log with the new bytes if there is new data to add + if len(logs.Bytes()) > size { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Error(err) + } + + // flush the buffer of logs + logs.Reset() + } + } + } + }() + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + } - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Stream - _, err = c.Vela.Svc.Stream(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, rc) - if err != nil { - logger.Errorf("unable to stream logs: %v", err) - } + logger.Info("finished streaming logs") + + // close channel to stop processing logs + close(done) + + return scanner.Err() + case "byte-chunks": + fallthrough + default: + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + + // if we have at least 1000 bytes in our buffer + // + // nolint: gomnd // ignore magic number + if logs.Len() > 1000 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + return err + } + + // flush the buffer of logs + logs.Reset() + } + } - logger.Info("finished streaming logs") + logger.Info("finished streaming logs") - return nil + return scanner.Err() + } } // DestroyService cleans up services after execution. diff --git a/executor/linux/step.go b/executor/linux/step.go index a3200177..2a29b264 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -5,6 +5,8 @@ package linux import ( + "bufio" + "bytes" "context" "fmt" "io/ioutil" @@ -205,6 +207,8 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { } // StreamStep tails the output for a step. +// +// nolint: funlen // ignore function length func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { // TODO: remove hardcoded reference if ctn.Name == "init" { @@ -224,7 +228,6 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return err } - // nolint: dupl // ignore similar code defer func() { // tail the runtime container rc, err := c.Runtime.TailContainer(ctx, ctn) @@ -266,19 +269,125 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error } defer rc.Close() - // set the timeout to the repo timeout - // to ensure the stream is not cut off - c.Vela.SetTimeout(time.Minute * time.Duration(c.repo.GetTimeout())) + // create new buffer for uploading logs + logs := new(bytes.Buffer) + + // nolint: dupl // ignore similar code with service + switch c.logMethod { + case "time-chunks": + // create new channel for processing logs + done := make(chan bool) + + // nolint: dupl // ignore similar code + go func() { + logger.Debug("polling logs for container") + + // spawn "infinite" loop that will upload logs + // from the buffer until the channel is closed + for { + // sleep for "1s" before attempting to upload logs + time.Sleep(1 * time.Second) + + // create a non-blocking select to check if the channel is closed + select { + // after repo timeout of idle (no response) end the stream + // + // this is a safety mechanism + case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): + logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) + + return + // channel is closed + case <-done: + logger.Trace("channel closed for polling container logs") + + // return out of the go routine + return + // channel is not closed + default: + // get the current size of log data + size := len(_log.GetData()) + + // update the existing log with the new bytes if there is new data to add + if len(logs.Bytes()) > size { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep + _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Error(err) + } + + // flush the buffer of logs + logs.Reset() + } + } + } + }() + + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + } - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Stream - _, err = c.Vela.Step.Stream(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, rc) - if err != nil { - logger.Errorf("unable to stream logs: %v", err) - } + logger.Info("finished streaming logs") + + // close channel to stop processing logs + close(done) + + return scanner.Err() + case "byte-chunks": + fallthrough + default: + // create new scanner from the container output + scanner := bufio.NewScanner(rc) + + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) + + // if we have at least 1000 bytes in our buffer + // + // nolint: gomnd // ignore magic number + if logs.Len() > 1000 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep + _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + return err + } + + // flush the buffer of logs + logs.Reset() + } + } - logger.Info("finished streaming logs") + logger.Info("finished streaming logs") - return nil + return scanner.Err() + } } // DestroyStep cleans up steps after execution. diff --git a/executor/setup.go b/executor/setup.go index 112b6214..96db863d 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -30,6 +30,8 @@ type Setup struct { // specifies the executor driver to use Driver string + // specifies the executor method used to publish logs + LogMethod string // specifies the executor hostname Hostname string // specifies the executor version @@ -69,6 +71,7 @@ func (s *Setup) Linux() (Engine, error) { // https://pkg.go.dev/github.com/go-vela/worker/executor/linux?tab=doc#New return linux.New( linux.WithBuild(s.Build), + linux.WithLogMethod(s.LogMethod), linux.WithHostname(s.Hostname), linux.WithPipeline(s.Pipeline), linux.WithRepo(s.Repo), @@ -134,6 +137,15 @@ func (s *Setup) Validate() error { return nil } + // handle the executor log method provided + switch s.LogMethod { + case "byte-chunks", "time-chunks": + case "": + return fmt.Errorf("empty executor log method provided in setup") + default: + return fmt.Errorf("invalid executor log method provided in setup: %s", s.LogMethod) + } + // check if a Vela client was provided if s.Client == nil { return fmt.Errorf("no Vela client provided in setup") diff --git a/executor/setup_test.go b/executor/setup_test.go index 3390a3cc..90588876 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -77,6 +77,7 @@ func TestExecutor_Setup_Linux(t *testing.T) { want, err := linux.New( linux.WithBuild(_build), + linux.WithLogMethod("byte-chunks"), linux.WithHostname("localhost"), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), @@ -90,15 +91,16 @@ func TestExecutor_Setup_Linux(t *testing.T) { } _setup := &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Hostname: "localhost", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - Version: "v1.0.0", + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Hostname: "localhost", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", } // run test @@ -224,97 +226,131 @@ func TestExecutor_Setup_Validate(t *testing.T) { }{ { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: false, }, { setup: &Setup{ - Build: nil, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: nil, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: nil, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + }, + failure: true, + }, + { + setup: &Setup{ + Build: _build, + Client: _client, + Driver: "", + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: nil, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: nil, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: "", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: nil, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: nil, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: nil, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: nil, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: nil, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: nil, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: nil, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "foobar", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 516ebe8f..6e64e926 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -30,13 +30,14 @@ func TestExecutor_Retrieve(t *testing.T) { } want, err := executor.New(&executor.Setup{ - Driver: constants.DriverLinux, - Client: new(vela.Client), - Runtime: _runtime, - Build: new(library.Build), - Pipeline: new(pipeline.Build), - Repo: new(library.Repo), - User: new(library.User), + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), }) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -64,13 +65,14 @@ func TestExecutor_Establish(t *testing.T) { } want, err := executor.New(&executor.Setup{ - Driver: constants.DriverLinux, - Client: new(vela.Client), - Runtime: _runtime, - Build: new(library.Build), - Pipeline: new(pipeline.Build), - Repo: new(library.Repo), - User: new(library.User), + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), }) if err != nil { t.Errorf("unable to create executor engine: %v", err) From ce4ff025287dbdce6e1077a696e2eb916045bc75 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 4 Nov 2021 19:12:45 +0000 Subject: [PATCH 213/430] chore: release v0.11.0-rc1 (#234) --- go.mod | 12 +++++++++--- go.sum | 31 ++++++++----------------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 0d0d9323..895f5661 100644 --- a/go.mod +++ b/go.mod @@ -6,15 +6,21 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 + github.com/containerd/containerd v1.4.4 // indirect github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v20.10.10+incompatible + github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/sdk-go v0.10.1 - github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057 - github.com/go-vela/types v0.10.0 + github.com/go-vela/sdk-go v0.11.0-rc1 + github.com/go-vela/server v0.11.0-rc1 + github.com/go-vela/types v0.11.0-rc1 github.com/google/go-cmp v0.5.6 + github.com/gorilla/mux v1.7.4 // indirect github.com/joho/godotenv v1.4.0 + github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.1 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 8ff84a7c..a95a1280 100644 --- a/go.sum +++ b/go.sum @@ -53,7 +53,6 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030I github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -77,8 +76,7 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.40.54/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.41.14/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -121,7 +119,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -189,18 +186,14 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/compiler v0.10.1-0.20211025223007-bdcd7b7f8de0/go.mod h1:dJyDHQuwXsyQUkiXpcjbcXxpuQnf3qvA9G+0kPciTQc= -github.com/go-vela/mock v0.10.0 h1:ZJs40xElnB4DNiQc+nEEeZS4Z0K/uXl6kGRpPlccuMY= -github.com/go-vela/mock v0.10.0/go.mod h1:TihYvb+NBiKXgcsBIpARU9H00rzrLAhFQvsRkzUqDxc= -github.com/go-vela/sdk-go v0.10.1 h1:p/vKSHafLAJVGX64LMQchswd76NU0+NI6TAXC1ZCfH8= -github.com/go-vela/sdk-go v0.10.1/go.mod h1:LGHpZezP0+KBb3OX9Mf5rGXK1dS7Ms8kWCHb8bWzOYc= -github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057 h1:KmemRdqIzi3TuEzqZq8HImraz5Lm/P7L+sbvO3itut4= -github.com/go-vela/server v0.10.2-0.20211029173632-4e64f8946057/go.mod h1:XDG9Fo84TzycmUM4ocm2Exdvlri3VoYT3kbvPWt5uw0= -github.com/go-vela/types v0.10.0 h1:C2RPVWAolm6TESb3JpKVdO2agtjG0ecnGuyrkEKNaS8= -github.com/go-vela/types v0.10.0/go.mod h1:6taTlivaC0wDwDJVlc8sBaVZToyzkyDMtGUYIAfgA9M= +github.com/go-vela/sdk-go v0.11.0-rc1 h1:B2LehUUW5UvULsVEj9iMbfAXpf/EQ+HnHfudTxTeW5g= +github.com/go-vela/sdk-go v0.11.0-rc1/go.mod h1:bwmCvF9nk9BcKNLfC5jiFj8C5YEoW1xAVoG737WaVBc= +github.com/go-vela/server v0.11.0-rc1 h1:y/Fln79cIYMSOJbwvy+Hf5GstoHvnWo9MKHPrZ1+Fe4= +github.com/go-vela/server v0.11.0-rc1/go.mod h1:tnGr39vUKkG4lfC9lu2qXLM1c6P/tZAF1ThHyZREUho= +github.com/go-vela/types v0.11.0-rc1 h1:1/wQA0NadOYpGKBuAwFisc4qIiw79wlU1qdiZClUfes= +github.com/go-vela/types v0.11.0-rc1/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= @@ -272,7 +265,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.4/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= @@ -388,7 +380,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -432,7 +423,7 @@ github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30= +github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -554,7 +545,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -606,7 +596,6 @@ golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -779,7 +768,6 @@ golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -890,7 +878,6 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201012135029-0c95dc0d88e8/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 h1:bFFRpT+e8JJVY7lMMfvezL1ZIwqiwmPl2bsE2yx4HqM= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -906,7 +893,6 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= @@ -970,7 +956,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4= k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs= -k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk= k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/client-go v0.22.3 h1:6onkOSc+YNdwq5zXE0wFXicq64rrym+mXwHu/CPVGO4= From a0a087f149e0b8b0106d0267442b6ffa867934d8 Mon Sep 17 00:00:00 2001 From: David Vader <48764154+davidvader@users.noreply.github.com> Date: Mon, 8 Nov 2021 08:59:52 -0500 Subject: [PATCH 214/430] fix: compare time chunks against zero (#235) --- executor/linux/service.go | 5 +---- executor/linux/step.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/executor/linux/service.go b/executor/linux/service.go index 63f039f1..c60843f5 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -256,11 +256,8 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err return // channel is not closed default: - // get the current size of log data - size := len(_log.GetData()) - // update the existing log with the new bytes if there is new data to add - if len(logs.Bytes()) > size { + if len(logs.Bytes()) > 0 { logger.Trace(logs.String()) // update the existing log with the new bytes diff --git a/executor/linux/step.go b/executor/linux/step.go index 2a29b264..9d68cf05 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -305,11 +305,8 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return // channel is not closed default: - // get the current size of log data - size := len(_log.GetData()) - // update the existing log with the new bytes if there is new data to add - if len(logs.Bytes()) > size { + if len(logs.Bytes()) > 0 { logger.Trace(logs.String()) // update the existing log with the new bytes From 3715d12e7844265321a0bfc25042fcff87bd43f0 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 10 Nov 2021 18:14:59 +0000 Subject: [PATCH 215/430] chore: release v0.11.0-rc3 (#236) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 895f5661..fa3ae8f4 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,9 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/sdk-go v0.11.0-rc1 - github.com/go-vela/server v0.11.0-rc1 - github.com/go-vela/types v0.11.0-rc1 + github.com/go-vela/sdk-go v0.11.0-rc3 + github.com/go-vela/server v0.11.0-rc3 + github.com/go-vela/types v0.11.0-rc3 github.com/google/go-cmp v0.5.6 github.com/gorilla/mux v1.7.4 // indirect github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index a95a1280..11a92beb 100644 --- a/go.sum +++ b/go.sum @@ -186,12 +186,12 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.11.0-rc1 h1:B2LehUUW5UvULsVEj9iMbfAXpf/EQ+HnHfudTxTeW5g= -github.com/go-vela/sdk-go v0.11.0-rc1/go.mod h1:bwmCvF9nk9BcKNLfC5jiFj8C5YEoW1xAVoG737WaVBc= -github.com/go-vela/server v0.11.0-rc1 h1:y/Fln79cIYMSOJbwvy+Hf5GstoHvnWo9MKHPrZ1+Fe4= -github.com/go-vela/server v0.11.0-rc1/go.mod h1:tnGr39vUKkG4lfC9lu2qXLM1c6P/tZAF1ThHyZREUho= -github.com/go-vela/types v0.11.0-rc1 h1:1/wQA0NadOYpGKBuAwFisc4qIiw79wlU1qdiZClUfes= -github.com/go-vela/types v0.11.0-rc1/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= +github.com/go-vela/sdk-go v0.11.0-rc3 h1:f/lMdDPlKylSK/oGO9WT+yb+Hl6VlwH3xjUnU5tTqw4= +github.com/go-vela/sdk-go v0.11.0-rc3/go.mod h1:Pmsrdn6XjkJ5xfyHNX81YYrOW/XYSFTsLwE1lsjAQK0= +github.com/go-vela/server v0.11.0-rc3 h1:jMM4LSn8pWlIr4miNIfDd1ROhe4CU/by/17KA0LCrYM= +github.com/go-vela/server v0.11.0-rc3/go.mod h1:2mVX9TaHpHq2JYIpeKepZFQga6eadUPSKMZGUoMoXRY= +github.com/go-vela/types v0.11.0-rc3 h1:xON3Rki5NGXngJI3G5dkUnXPXIkuNcj9pU2Lj6PE5fY= +github.com/go-vela/types v0.11.0-rc3/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From 7f6f31191c6f126978ca5f02842dce0ed600b80c Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Thu, 11 Nov 2021 15:33:42 -0600 Subject: [PATCH 216/430] chore(v0.11.0): update dependencies for v0.11.0 (#238) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index fa3ae8f4..259b6993 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,9 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-vela/sdk-go v0.11.0-rc3 - github.com/go-vela/server v0.11.0-rc3 - github.com/go-vela/types v0.11.0-rc3 + github.com/go-vela/sdk-go v0.11.0 + github.com/go-vela/server v0.11.0 + github.com/go-vela/types v0.11.0 github.com/google/go-cmp v0.5.6 github.com/gorilla/mux v1.7.4 // indirect github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index 11a92beb..05024b66 100644 --- a/go.sum +++ b/go.sum @@ -186,12 +186,12 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.11.0-rc3 h1:f/lMdDPlKylSK/oGO9WT+yb+Hl6VlwH3xjUnU5tTqw4= -github.com/go-vela/sdk-go v0.11.0-rc3/go.mod h1:Pmsrdn6XjkJ5xfyHNX81YYrOW/XYSFTsLwE1lsjAQK0= -github.com/go-vela/server v0.11.0-rc3 h1:jMM4LSn8pWlIr4miNIfDd1ROhe4CU/by/17KA0LCrYM= -github.com/go-vela/server v0.11.0-rc3/go.mod h1:2mVX9TaHpHq2JYIpeKepZFQga6eadUPSKMZGUoMoXRY= -github.com/go-vela/types v0.11.0-rc3 h1:xON3Rki5NGXngJI3G5dkUnXPXIkuNcj9pU2Lj6PE5fY= -github.com/go-vela/types v0.11.0-rc3/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= +github.com/go-vela/sdk-go v0.11.0 h1:TnbmGBppx1Ux7GPUXv1qDk5DuKKlmurjfex1debH0UM= +github.com/go-vela/sdk-go v0.11.0/go.mod h1:48WCgfDktF90VMvzQ7EZjMFxSSBEsr2kEVtDUwErcqI= +github.com/go-vela/server v0.11.0 h1:+8SONSqzj7jOyiEzbYrtM+/6Xnw4ZfEEPiHkusyL6RY= +github.com/go-vela/server v0.11.0/go.mod h1:0phuhEP09iKIiNKpO+cfOa6qU+epgr9Oon1MAZ1nIJ0= +github.com/go-vela/types v0.11.0 h1:b7QMak0SLAfQjgUOPDhrS/XPPEswhI+27VZzn/axuJA= +github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From b586acec7d28b6232a3effde0ff88d1efc3b9cf1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 14:36:48 -0600 Subject: [PATCH 217/430] fix(deps): update module github.com/opencontainers/image-spec to v1.0.2 (#237) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 259b6993..a21f561c 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.1 + github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 diff --git a/go.sum b/go.sum index 05024b66..fe471539 100644 --- a/go.sum +++ b/go.sum @@ -471,8 +471,8 @@ github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= From 11dd7698fcbd97af62190f39c8dd21d476476c94 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 17 Nov 2021 15:53:27 -0600 Subject: [PATCH 218/430] enhance: setting version information (#240) * enhance(version): add fallback for empty tag * enhance(version): use go version from runtime library * chore: clean go code --- Makefile | 8 +------- version/version.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9f4d4f9b..d0a3e482 100644 --- a/Makefile +++ b/Makefile @@ -17,14 +17,8 @@ ifndef GITHUB_TAG GITHUB_TAG = $(shell git describe --tag --abbrev=0) endif -# check if a go version is already set -ifndef GOLANG_VERSION - # capture the current go version we build the application from - GOLANG_VERSION = $(shell go version | awk '{ print $$3 }') -endif - # create a list of linker flags for building the golang application -LD_FLAGS = -X github.com/go-vela/worker/version.Commit=${GITHUB_SHA} -X github.com/go-vela/worker/version.Date=${BUILD_DATE} -X github.com/go-vela/worker/version.Go=${GOLANG_VERSION} -X github.com/go-vela/worker/version.Tag=${GITHUB_TAG} +LD_FLAGS = -X github.com/go-vela/worker/version.Commit=${GITHUB_SHA} -X github.com/go-vela/worker/version.Date=${BUILD_DATE} -X github.com/go-vela/worker/version.Tag=${GITHUB_TAG} # The `clean` target is intended to clean the workspace # and prepare the local changes for submission. diff --git a/version/version.go b/version/version.go index 2e84520c..d62ce117 100644 --- a/version/version.go +++ b/version/version.go @@ -9,8 +9,8 @@ import ( "runtime" "github.com/Masterminds/semver/v3" - "github.com/go-vela/types/version" + "github.com/sirupsen/logrus" ) var ( @@ -23,7 +23,7 @@ var ( // Date represents the build date information for the package. Date string // Go represents the golang version information for the package. - Go string + Go = runtime.Version() // OS represents the operating system information for the package. OS = runtime.GOOS // Tag represents the git tag information for the package. @@ -32,6 +32,14 @@ var ( // New creates a new version object for Vela that is used throughout the application. func New() *version.Version { + // check if a semantic tag was provided + if len(Tag) == 0 { + logrus.Warningf("no semantic tag provided - defaulting to v0.0.0") + + // set a fallback default for the tag + Tag = "v0.0.0" + } + v, err := semver.NewVersion(Tag) if err != nil { fmt.Println(fmt.Errorf("unable to parse semantic version for %s: %v", Tag, err)) From cdef8a6682c62210b14246efb8b948bffc9bd3fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Nov 2021 10:51:59 -0600 Subject: [PATCH 219/430] fix(deps): update deps (patch) to v0.22.4 (#241) --- go.mod | 6 +++--- go.sum | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index a21f561c..1a7d3732 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.0.3 - k8s.io/api v0.22.3 - k8s.io/apimachinery v0.22.3 - k8s.io/client-go v0.22.3 + k8s.io/api v0.22.4 + k8s.io/apimachinery v0.22.4 + k8s.io/client-go v0.22.4 ) diff --git a/go.sum b/go.sum index fe471539..a0a450f8 100644 --- a/go.sum +++ b/go.sum @@ -954,18 +954,20 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4= -k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs= -k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk= +k8s.io/api v0.22.4 h1:UvyHW0ezB2oIgHAxlYoo6UJQObYXU7awuNarwoHEOjw= +k8s.io/api v0.22.4/go.mod h1:Rgs+9gIGYC5laXQSZZ9JqT5NevNgoGiOdVWi1BAB3qk= k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/client-go v0.22.3 h1:6onkOSc+YNdwq5zXE0wFXicq64rrym+mXwHu/CPVGO4= -k8s.io/client-go v0.22.3/go.mod h1:ElDjYf8gvZsKDYexmsmnMQ0DYO8W9RwBjfQ1PI53yow= +k8s.io/apimachinery v0.22.4 h1:9uwcvPpukBw/Ri0EUmWz+49cnFtaoiyEhQTK+xOe7Ck= +k8s.io/apimachinery v0.22.4/go.mod h1:yU6oA6Gnax9RrxGzVvPFFJ+mpnW6PBSqp0sx0I0HHW0= +k8s.io/client-go v0.22.4 h1:aAQ1Wk+I3bjCNk35YWUqbaueqrIonkfDPJSPDDe8Kfg= +k8s.io/client-go v0.22.4/go.mod h1:Yzw4e5e7h1LNHA4uqnMVrpEpUs1hJOiuBsJKIlRCHDA= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c h1:jvamsI1tn9V0S8jicyX82qaFC0H/NKxv2e5mbqsgR80= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g= k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From 3c1ba5935fc107b73b1560ff6e45be9f01250075 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 23 Nov 2021 11:33:05 -0500 Subject: [PATCH 220/430] fix: move Step init logic to library (#239) * StepFromContainer -> StepFromContainerEnvironment * Use library.StepFromBuildContainer to create new Steps * update go-vela/types * go mod tidy Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- executor/linux/step.go | 22 ++++------------------ executor/local/step.go | 22 ++++------------------ go.mod | 2 +- go.sum | 4 +++- 4 files changed, 12 insertions(+), 38 deletions(-) diff --git a/executor/linux/step.go b/executor/linux/step.go index 9d68cf05..ff6c38b4 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -40,8 +40,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // create a library step object to facilitate injecting environment as early as possible // (PlanStep is too late to inject environment vars for the kubernetes runtime). - _step := c.newLibraryStep(ctn) - _step.SetStatus(constants.StatusPending) + _step := library.StepFromBuildContainer(c.build, ctn) // update the step container environment // @@ -73,19 +72,6 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error return nil } -// newLibraryStep creates a library step object. -func (c *client) newLibraryStep(ctn *pipeline.Container) *library.Step { - _step := new(library.Step) - _step.SetName(ctn.Name) - _step.SetNumber(ctn.Number) - _step.SetImage(ctn.Image) - _step.SetStage(ctn.Environment["VELA_STEP_STAGE"]) - _step.SetHost(c.build.GetHost()) - _step.SetRuntime(c.build.GetRuntime()) - _step.SetDistribution(c.build.GetDistribution()) - return _step -} - // PlanStep prepares the step for execution. func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { var err error @@ -96,7 +82,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { logger := c.logger.WithField("step", ctn.Name) // create the library step object - _step := c.newLibraryStep(ctn) + _step := library.StepFromBuildContainer(c.build, ctn) _step.SetStatus(constants.StatusRunning) _step.SetStarted(time.Now().UTC().Unix()) @@ -406,8 +392,8 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error if err != nil { // create the step from the container // - // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainer - _step = library.StepFromContainer(ctn) + // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainerEnvironment + _step = library.StepFromContainerEnvironment(ctn) } // defer an upload of the step diff --git a/executor/local/step.go b/executor/local/step.go index 3c5d54a2..860ba3ae 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -35,8 +35,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // create a library step object to facilitate injecting environment as early as possible // (PlanStep is too late to inject environment vars for the kubernetes runtime). - _step := c.newLibraryStep(ctn) - _step.SetStatus(constants.StatusPending) + _step := library.StepFromBuildContainer(c.build, ctn) // update the step container environment // @@ -57,23 +56,10 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error return nil } -// newLibraryStep creates a library step object. -func (c *client) newLibraryStep(ctn *pipeline.Container) *library.Step { - _step := new(library.Step) - _step.SetName(ctn.Name) - _step.SetNumber(ctn.Number) - _step.SetImage(ctn.Image) - _step.SetStage(ctn.Environment["VELA_STEP_STAGE"]) - _step.SetHost(c.build.GetHost()) - _step.SetRuntime(c.build.GetRuntime()) - _step.SetDistribution(c.build.GetDistribution()) - return _step -} - // PlanStep prepares the step for execution. func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // create the library step object - _step := c.newLibraryStep(ctn) + _step := library.StepFromBuildContainer(c.build, ctn) _step.SetStatus(constants.StatusRunning) _step.SetStarted(time.Now().UTC().Unix()) @@ -199,8 +185,8 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error if err != nil { // create the step from the container // - // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainer - _step = library.StepFromContainer(ctn) + // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainerEnvironment + _step = library.StepFromContainerEnvironment(ctn) } // defer an upload of the step diff --git a/go.mod b/go.mod index 1a7d3732..ba03e470 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/gin-gonic/gin v1.7.4 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.0 - github.com/go-vela/types v0.11.0 + github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc github.com/google/go-cmp v0.5.6 github.com/gorilla/mux v1.7.4 // indirect github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index a0a450f8..7f9b7bb7 100644 --- a/go.sum +++ b/go.sum @@ -190,8 +190,9 @@ github.com/go-vela/sdk-go v0.11.0 h1:TnbmGBppx1Ux7GPUXv1qDk5DuKKlmurjfex1debH0UM github.com/go-vela/sdk-go v0.11.0/go.mod h1:48WCgfDktF90VMvzQ7EZjMFxSSBEsr2kEVtDUwErcqI= github.com/go-vela/server v0.11.0 h1:+8SONSqzj7jOyiEzbYrtM+/6Xnw4ZfEEPiHkusyL6RY= github.com/go-vela/server v0.11.0/go.mod h1:0phuhEP09iKIiNKpO+cfOa6qU+epgr9Oon1MAZ1nIJ0= -github.com/go-vela/types v0.11.0 h1:b7QMak0SLAfQjgUOPDhrS/XPPEswhI+27VZzn/axuJA= github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= +github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc h1:5BJtsCPpi0jlw9XEFafcUo/u+kdEA7N9bp7bBW9/hjA= +github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -403,6 +404,7 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= From eb9aa931613868f665c35d6872c0973fef8788a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:23:08 -0600 Subject: [PATCH 221/430] fix(deps): update module github.com/gin-gonic/gin to v1.7.6 (#242) Co-authored-by: Renovate Bot Co-authored-by: Jordan Brockopp --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ba03e470..533435bd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 - github.com/gin-gonic/gin v1.7.4 + github.com/gin-gonic/gin v1.7.6 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.0 github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc diff --git a/go.sum b/go.sum index 7f9b7bb7..7bbc2097 100644 --- a/go.sum +++ b/go.sum @@ -154,8 +154,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.6 h1:Ma2JlolDP9KCHuHTrW58EIIxVUQKxSxzuCKguCYyFas= +github.com/gin-gonic/gin v1.7.6/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From f7f6d550fbec1d84dda02b42d8f0f556a0318f3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Nov 2021 03:46:17 +0000 Subject: [PATCH 222/430] fix(deps): update module github.com/gin-gonic/gin to v1.7.7 (#243) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 533435bd..271521a5 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 - github.com/gin-gonic/gin v1.7.6 + github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.0 github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc diff --git a/go.sum b/go.sum index 7bbc2097..db79ced4 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gin-gonic/gin v1.7.6 h1:Ma2JlolDP9KCHuHTrW58EIIxVUQKxSxzuCKguCYyFas= -github.com/gin-gonic/gin v1.7.6/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 7e3661689cb2416be0f6e0ae63d4d35056b9341b Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 3 Dec 2021 09:00:03 -0600 Subject: [PATCH 223/430] fix: local setup with server (#245) --- .env.example | 8 ++++---- DOCS.md | 6 +++--- docker-compose.yml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 6f209ab9..8ab90001 100644 --- a/.env.example +++ b/.env.example @@ -12,7 +12,7 @@ # These are used by the ui service # defined in the docker compose stack -# customize the location where you want users to provide feedack +# customize the location where you want users to provide feedback # # default: https://github.com/go-vela/ui/issues/new # VELA_FEEDBACK_URL= @@ -44,10 +44,10 @@ VELA_API=http://localhost:8080 # github web url (only required if using GitHub Enterprise) # # default: https://github.com -# VELA_SOURCE_ADDR= +# VELA_SCM_ADDR= # github client id from oauth application -VELA_SOURCE_CLIENT= +VELA_SCM_CLIENT= # github client secret from oauth application -VELA_SOURCE_SECRET= +VELA_SCM_SECRET= diff --git a/DOCS.md b/DOCS.md index 8d59659b..d65afb6e 100644 --- a/DOCS.md +++ b/DOCS.md @@ -38,7 +38,7 @@ cd $HOME/go-vela/worker ```bash # add Github Enterprise Web URL to local `.env` file for `docker-compose` -echo "VELA_SOURCE_ADDR=" >> .env +echo "VELA_SCM_ADDR=" >> .env ``` * Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: @@ -50,10 +50,10 @@ echo "VELA_SOURCE_ADDR=" >> .env ```bash # add Github Client ID to local `.env` file for `docker-compose` -echo "VELA_SOURCE_CLIENT=" >> .env +echo "VELA_SCM_CLIENT=" >> .env # add Github Client Secret to local `.env` file for `docker-compose` -echo "VELA_SOURCE_SECRET=" >> .env +echo "VELA_SCM_SECRET=" >> .env ``` ## Start diff --git a/docker-compose.yml b/docker-compose.yml index 3bf26fb9..f72de7c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,8 +62,8 @@ services: QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' QUEUE_ROUTES: 'docker,local,docker:local' - SOURCE_DRIVER: github - SOURCE_CONTEXT: 'continuous-integration/vela' + SCM_DRIVER: github + SCM_CONTEXT: 'continuous-integration/vela' SECRET_VAULT: 'true' SECRET_VAULT_ADDR: 'http://vault:8200' SECRET_VAULT_TOKEN: vela From e15d69847a0d0bfd6cffebf655f9014fee25df4d Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 6 Dec 2021 20:02:50 +0000 Subject: [PATCH 224/430] feat(logs): allow setting max log size (#244) --- cmd/vela-worker/exec.go | 21 ++- cmd/vela-worker/run.go | 5 +- executor/executor_test.go | 20 +- executor/flags.go | 6 + executor/linux/linux.go | 13 +- executor/linux/opts.go | 12 ++ executor/linux/opts_test.go | 35 ++++ executor/linux/service.go | 21 +++ executor/linux/step.go | 21 +++ executor/linux/step_test.go | 9 + executor/setup.go | 3 + executor/setup_test.go | 192 +++++++++++--------- router/middleware/executor/executor_test.go | 34 ++-- 13 files changed, 259 insertions(+), 133 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 3360bdb5..e99f8720 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -47,16 +47,17 @@ func (w *Worker) exec(index int) error { // // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ - Driver: w.Config.Executor.Driver, - LogMethod: w.Config.Executor.LogMethod, - Client: w.VelaClient, - Hostname: w.Config.API.Address.Hostname(), - Runtime: w.Runtime, - Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), - Repo: item.Repo, - User: item.User, - Version: v.Semantic(), + Driver: w.Config.Executor.Driver, + LogMethod: w.Config.Executor.LogMethod, + MaxLogSize: w.Config.Executor.MaxLogSize, + Client: w.VelaClient, + Hostname: w.Config.API.Address.Hostname(), + Runtime: w.Runtime, + Build: item.Build, + Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), + Repo: item.Repo, + User: item.User, + Version: v.Semantic(), }) // add the executor to the worker diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 0a9e38cf..4d0fc388 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -95,8 +95,9 @@ func run(c *cli.Context) error { CheckIn: c.Duration("checkIn"), // executor configuration Executor: &executor.Setup{ - Driver: c.String("executor.driver"), - LogMethod: c.String("executor.log_method"), + Driver: c.String("executor.driver"), + LogMethod: c.String("executor.log_method"), + MaxLogSize: c.Uint("executor.max_log_size"), }, // logger configuration Logger: &Logger{ diff --git a/executor/executor_test.go b/executor/executor_test.go index 55211fda..86e17c5e 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -45,6 +45,7 @@ func TestExecutor_New(t *testing.T) { linux.WithBuild(_build), linux.WithHostname("localhost"), linux.WithLogMethod("byte-chunks"), + linux.WithMaxLogSize(2097152), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), linux.WithRuntime(_runtime), @@ -93,15 +94,16 @@ func TestExecutor_New(t *testing.T) { { failure: false, setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - Version: "v1.0.0", + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", }, want: _linux, }, diff --git a/executor/flags.go b/executor/flags.go index 73895019..f889ac6c 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -49,4 +49,10 @@ var Flags = []cli.Flag{ Usage: "method used to publish logs to the server - options: (byte-chunks|time-chunks)", Value: "byte-chunks", }, + &cli.UintFlag{ + EnvVars: []string{"VELA_EXECUTOR_MAX_LOG_SIZE", "EXECUTOR_MAX_LOG_SIZE"}, + FilePath: "/vela/executor/max_log_size", + Name: "executor.max_log_size", + Usage: "maximum log size (in bytes)", + }, } diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 96248d5c..2d2a5c1e 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -30,12 +30,13 @@ type ( secret *secretSvc // private fields - init *pipeline.Container - logger *logrus.Entry - logMethod string - build *library.Build - pipeline *pipeline.Build - repo *library.Repo + init *pipeline.Container + logger *logrus.Entry + logMethod string + maxLogSize uint + build *library.Build + pipeline *pipeline.Build + repo *library.Repo // nolint: structcheck,unused // ignore false positives secrets sync.Map services sync.Map diff --git a/executor/linux/opts.go b/executor/linux/opts.go index d23914ff..a4a72f84 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -59,6 +59,18 @@ func WithLogMethod(method string) Opt { } } +// WithMaxLogSize set the maximum log size (in bytes) in the client. +func WithMaxLogSize(size uint) Opt { + logrus.Trace("configuring maximum log size in linux client") + + return func(c *client) error { + // set the maximum log size in the client + c.maxLogSize = size + + return nil + } +} + // WithHostname sets the hostname in the client. func WithHostname(hostname string) Opt { logrus.Trace("configuring hostname in linux client") diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 2fc20829..026d9c1c 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -109,6 +109,41 @@ func TestLinux_Opt_WithLogMethod(t *testing.T) { } } +func TestLinux_Opt_WithMaxLogSize(t *testing.T) { + // setup tests + tests := []struct { + failure bool + maxLogSize uint + }{ + { + failure: false, + maxLogSize: 2097152, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithMaxLogSize(test.maxLogSize), + ) + + if test.failure { + if err == nil { + t.Errorf("WithMaxLogSize should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithMaxLogSize returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.maxLogSize, test.maxLogSize) { + t.Errorf("WithMaxLogSize is %v, want %v", _engine.maxLogSize, test.maxLogSize) + } + } +} func TestLinux_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { diff --git a/executor/linux/service.go b/executor/linux/service.go index c60843f5..d9d32e9d 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -197,6 +197,13 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err return } + // don't attempt last upload if log size exceeded + if c.maxLogSize > 0 && uint(len(data)) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + return + } + // overwrite the existing log with all bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData @@ -277,6 +284,13 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // flush the buffer of logs logs.Reset() } + + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + return + } } } }() @@ -330,6 +344,13 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // flush the buffer of logs logs.Reset() } + + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + break + } } logger.Info("finished streaming logs") diff --git a/executor/linux/step.go b/executor/linux/step.go index ff6c38b4..adb91d23 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -232,6 +232,13 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return } + // don't attempt last upload if log size exceeded + if c.maxLogSize > 0 && uint(len(data)) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + return + } + // overwrite the existing log with all bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData @@ -312,6 +319,13 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // flush the buffer of logs logs.Reset() } + + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + return + } } } }() @@ -365,6 +379,13 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // flush the buffer of logs logs.Reset() } + + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") + + break + } } logger.Info("finished streaming logs") diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index adee0d87..eb64c85b 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -323,6 +323,10 @@ func TestLinux_StreamStep(t *testing.T) { _build := testBuild() _repo := testRepo() _user := testUser() + _logs := new(library.Log) + + // fill log with bytes + _logs.SetData(make([]byte, 1000)) gin.SetMode(gin.TestMode) @@ -346,6 +350,7 @@ func TestLinux_StreamStep(t *testing.T) { }{ { // init step container failure: false, + logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_init", Directory: "/vela/src/github.com/github/octocat", @@ -358,6 +363,7 @@ func TestLinux_StreamStep(t *testing.T) { }, { // basic step container failure: false, + logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -370,6 +376,7 @@ func TestLinux_StreamStep(t *testing.T) { }, { // step container with name not found failure: true, + logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_notfound", Directory: "/vela/src/github.com/github/octocat", @@ -382,6 +389,7 @@ func TestLinux_StreamStep(t *testing.T) { }, { // empty step container failure: true, + logs: _logs, container: new(pipeline.Container), }, } @@ -391,6 +399,7 @@ func TestLinux_StreamStep(t *testing.T) { _engine, err := New( WithBuild(_build), WithPipeline(new(pipeline.Build)), + WithMaxLogSize(10), WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), diff --git a/executor/setup.go b/executor/setup.go index 96db863d..52fd8821 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -32,6 +32,8 @@ type Setup struct { Driver string // specifies the executor method used to publish logs LogMethod string + // specifies the maximum log size + MaxLogSize uint // specifies the executor hostname Hostname string // specifies the executor version @@ -72,6 +74,7 @@ func (s *Setup) Linux() (Engine, error) { return linux.New( linux.WithBuild(s.Build), linux.WithLogMethod(s.LogMethod), + linux.WithMaxLogSize(s.MaxLogSize), linux.WithHostname(s.Hostname), linux.WithPipeline(s.Pipeline), linux.WithRepo(s.Repo), diff --git a/executor/setup_test.go b/executor/setup_test.go index 90588876..a09705bb 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -78,6 +78,7 @@ func TestExecutor_Setup_Linux(t *testing.T) { want, err := linux.New( linux.WithBuild(_build), linux.WithLogMethod("byte-chunks"), + linux.WithMaxLogSize(2097152), linux.WithHostname("localhost"), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), @@ -91,16 +92,17 @@ func TestExecutor_Setup_Linux(t *testing.T) { } _setup := &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Hostname: "localhost", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - Version: "v1.0.0", + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Hostname: "localhost", + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, + Version: "v1.0.0", } // run test @@ -226,131 +228,141 @@ func TestExecutor_Setup_Validate(t *testing.T) { }{ { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: false, }, { setup: &Setup{ - Build: nil, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: nil, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: nil, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: nil, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: "", - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: "", + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: nil, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: nil, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: nil, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: nil, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: nil, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: nil, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: nil, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: nil, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, { setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "foobar", - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, + Build: _build, + Client: _client, + Driver: constants.DriverLinux, + LogMethod: "foobar", + MaxLogSize: 2097152, + Pipeline: _pipeline, + Repo: _repo, + Runtime: _runtime, + User: _user, }, failure: true, }, diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 6e64e926..a1839000 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -30,14 +30,15 @@ func TestExecutor_Retrieve(t *testing.T) { } want, err := executor.New(&executor.Setup{ - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Client: new(vela.Client), - Runtime: _runtime, - Build: new(library.Build), - Pipeline: new(pipeline.Build), - Repo: new(library.Repo), - User: new(library.User), + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), }) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -65,14 +66,15 @@ func TestExecutor_Establish(t *testing.T) { } want, err := executor.New(&executor.Setup{ - Driver: constants.DriverLinux, - LogMethod: "byte-chunks", - Client: new(vela.Client), - Runtime: _runtime, - Build: new(library.Build), - Pipeline: new(pipeline.Build), - Repo: new(library.Repo), - User: new(library.User), + Driver: constants.DriverLinux, + LogMethod: "byte-chunks", + MaxLogSize: 2097152, + Client: new(vela.Client), + Runtime: _runtime, + Build: new(library.Build), + Pipeline: new(pipeline.Build), + Repo: new(library.Repo), + User: new(library.User), }) if err != nil { t.Errorf("unable to create executor engine: %v", err) From 140e526669842eea216ca70f9de693755aad95f3 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 14 Dec 2021 16:19:13 -0600 Subject: [PATCH 225/430] chore: update go-vela/server dependency (#252) --- go.mod | 2 +- go.sum | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 271521a5..10d59a86 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.11.0 - github.com/go-vela/server v0.11.0 + github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc github.com/google/go-cmp v0.5.6 github.com/gorilla/mux v1.7.4 // indirect diff --git a/go.sum b/go.sum index db79ced4..15ae8264 100644 --- a/go.sum +++ b/go.sum @@ -69,14 +69,16 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.16.0 h1:ALkyFg7bSTEd1Mkrb4ppq4fnwjklA59dVtIehXCUZkU= github.com/alicebob/miniredis/v2 v2.16.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.17.0 h1:EwLdrIS50uczw71Jc7iVSxZluTKj5nfSP8n7ARRnJy0= +github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.41.14/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.42.19/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -189,8 +191,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.11.0 h1:TnbmGBppx1Ux7GPUXv1qDk5DuKKlmurjfex1debH0UM= github.com/go-vela/sdk-go v0.11.0/go.mod h1:48WCgfDktF90VMvzQ7EZjMFxSSBEsr2kEVtDUwErcqI= -github.com/go-vela/server v0.11.0 h1:+8SONSqzj7jOyiEzbYrtM+/6Xnw4ZfEEPiHkusyL6RY= github.com/go-vela/server v0.11.0/go.mod h1:0phuhEP09iKIiNKpO+cfOa6qU+epgr9Oon1MAZ1nIJ0= +github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 h1:5a2t2rh2/zD/+NMVrGw9UyILryaF9naG4cGF+WDWuj4= +github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06/go.mod h1:CG7MFRFVZ4s2ov4B2XRJles4R+vLD+3AMQw7O9qzk1c= github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc h1:5BJtsCPpi0jlw9XEFafcUo/u+kdEA7N9bp7bBW9/hjA= github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= @@ -198,8 +201,9 @@ github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -338,6 +342,7 @@ github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfG github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= @@ -350,24 +355,29 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= +github.com/jackc/pgx/v4 v4.14.0/go.mod h1:jT3ibf/A0ZVCp89rtCIN0zCJxcE74ypROmHEZYsG/j8= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -574,8 +584,9 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3 h1:oBcONsksxvpeodDrLjiMDaKHXKAVVfAydhe/792CE/o= go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20211203141949-70c0e40ae128 h1:bxH+EXOo87zEOwKDdZ8Tevgi6irRbqheRm/fr293c58= +go.starlark.net v0.0.0-20211203141949-70c0e40ae128/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -679,8 +690,9 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/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= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -944,9 +956,13 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.2.1/go.mod h1:SHRZhu+D0tLOHV5qbxZRUM6kBcf3jp/kxPz2mYMTsNY= +gorm.io/driver/postgres v1.2.3/go.mod h1:pJV6RgYQPG47aM1f0QeOzFH9HxQc8JcmAgjRCgS0wjs= gorm.io/driver/sqlite v1.2.3/go.mod h1:wkiGvZF3le/8vjCRYg0bT8TSw6APZ5rtgKW8uQYE3sc= +gorm.io/driver/sqlite v1.2.6/go.mod h1:gyoX0vHiiwi0g49tv+x2E7l8ksauLK0U/gShcdUsjWY= gorm.io/gorm v1.22.0/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gorm.io/gorm v1.22.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= From b848e1b8cdd685b5dfe243208d844b05cb487389 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 15 Dec 2021 09:37:07 -0600 Subject: [PATCH 226/430] enhance: use application logger (#246) --- cmd/vela-worker/exec.go | 47 ++++++++------ docker-compose.yml | 2 - executor/flags.go | 18 ------ executor/linux/api.go | 2 +- executor/linux/build.go | 86 +++++++++++++------------- executor/linux/linux.go | 10 ++- executor/linux/opts.go | 102 ++++++++++++++----------------- executor/linux/secret.go | 14 ++--- executor/linux/service.go | 12 ++-- executor/linux/stage.go | 8 +-- executor/linux/step.go | 12 ++-- executor/local/opts.go | 18 +++--- executor/setup.go | 4 ++ runtime/docker/build.go | 10 ++- runtime/docker/container.go | 24 +++----- runtime/docker/docker.go | 16 ++++- runtime/docker/image.go | 17 +++--- runtime/docker/network.go | 8 +-- runtime/docker/opts.go | 39 ++++++++---- runtime/docker/volume.go | 14 ++--- runtime/flags.go | 18 ------ runtime/kubernetes/build.go | 14 ++--- runtime/kubernetes/container.go | 20 +++--- runtime/kubernetes/image.go | 6 +- runtime/kubernetes/kubernetes.go | 37 ++++++++--- runtime/kubernetes/network.go | 8 +-- runtime/kubernetes/opts.go | 59 +++++++++++------- runtime/kubernetes/volume.go | 10 ++- runtime/runtime.go | 1 - runtime/setup.go | 5 ++ 30 files changed, 330 insertions(+), 311 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index e99f8720..2567a17b 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -25,14 +25,6 @@ func (w *Worker) exec(index int) error { // setup the version v := version.New() - // setup the runtime - // - // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#New - w.Runtime, err = runtime.New(w.Config.Runtime) - if err != nil { - return err - } - // capture an item from the queue item, err := w.Queue.Pop(context.Background()) if err != nil { @@ -43,10 +35,39 @@ func (w *Worker) exec(index int) error { return nil } + // create logger with extra metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields + logger := logrus.WithFields(logrus.Fields{ + "build": item.Build.GetNumber(), + "executor": w.Config.Executor.Driver, + "host": w.Config.API.Address.Hostname(), + "repo": item.Repo.GetFullName(), + "runtime": w.Config.Runtime.Driver, + "user": item.User.GetName(), + "version": v.Semantic(), + }) + + // setup the runtime + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#New + w.Runtime, err = runtime.New(&runtime.Setup{ + Logger: logger, + Driver: w.Config.Runtime.Driver, + ConfigFile: w.Config.Runtime.ConfigFile, + HostVolumes: w.Config.Runtime.HostVolumes, + Namespace: w.Config.Runtime.Namespace, + PrivilegedImages: w.Config.Runtime.PrivilegedImages, + }) + if err != nil { + return err + } + // setup the executor // // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ + Logger: logger, Driver: w.Config.Executor.Driver, LogMethod: w.Config.Executor.LogMethod, MaxLogSize: w.Config.Executor.MaxLogSize, @@ -63,16 +84,6 @@ func (w *Worker) exec(index int) error { // add the executor to the worker w.Executors[index] = _executor - // create logger with extra metadata - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields - logger := logrus.WithFields(logrus.Fields{ - "build": item.Build.GetNumber(), - "host": w.Config.API.Address.Hostname(), - "repo": item.Repo.GetFullName(), - "version": v.Semantic(), - }) - // capture the configured build timeout t := w.Config.Build.Timeout // check if the repository has a custom timeout diff --git a/docker-compose.yml b/docker-compose.yml index f72de7c0..53731914 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,6 @@ services: EXECUTOR_LOG_METHOD: 'time-chunks' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' - QUEUE_ROUTES: 'docker,local,docker:local' VELA_BUILD_LIMIT: 1 VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace @@ -61,7 +60,6 @@ services: DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' - QUEUE_ROUTES: 'docker,local,docker:local' SCM_DRIVER: github SCM_CONTEXT: 'continuous-integration/vela' SECRET_VAULT: 'true' diff --git a/executor/flags.go b/executor/flags.go index f889ac6c..f1321da8 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -15,24 +15,6 @@ import ( // // https://pkg.go.dev/github.com/urfave/cli?tab=doc#Flag var Flags = []cli.Flag{ - - // Logging Flags - - &cli.StringFlag{ - EnvVars: []string{"VELA_LOG_FORMAT", "EXECUTOR_LOG_FORMAT"}, - FilePath: "/vela/executor/log_format", - Name: "executor.log.format", - Usage: "format of logs to output", - Value: "json", - }, - &cli.StringFlag{ - EnvVars: []string{"VELA_LOG_LEVEL", "EXECUTOR_LOG_LEVEL"}, - FilePath: "/vela/executor/log_level", - Name: "executor.log.level", - Usage: "level of logs to output", - Value: "info", - }, - // Executor Flags &cli.StringFlag{ diff --git a/executor/linux/api.go b/executor/linux/api.go index 8c09a521..167d7546 100644 --- a/executor/linux/api.go +++ b/executor/linux/api.go @@ -192,7 +192,7 @@ func (c *client) CancelBuild() (*library.Build, error) { err = c.DestroyBuild(context.Background()) if err != nil { - c.logger.Errorf("unable to destroy build: %v", err) + c.Logger.Errorf("unable to destroy build: %v", err) } return b, nil diff --git a/executor/linux/build.go b/executor/linux/build.go index 9cc36d87..f721715b 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -23,7 +23,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // defer taking a snapshot of the build // // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot - defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.Logger, c.repo) }() // update the build fields c.build.SetStatus(constants.StatusRunning) @@ -32,7 +32,7 @@ func (c *client) CreateBuild(ctx context.Context) error { c.build.SetDistribution(c.Driver()) c.build.SetRuntime(c.Runtime.Driver()) - c.logger.Info("uploading build state") + c.Logger.Info("uploading build state") // send API call to update the build // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update @@ -55,14 +55,14 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to load init step from pipeline: %w", c.err) } - c.logger.Infof("creating %s step", c.init.Name) + c.Logger.Infof("creating %s step", c.init.Name) // create the step c.err = c.CreateStep(ctx, c.init) if c.err != nil { return fmt.Errorf("unable to create %s step: %w", c.init.Name, c.err) } - c.logger.Infof("planning %s step", c.init.Name) + c.Logger.Infof("planning %s step", c.init.Name) // plan the step c.err = c.PlanStep(ctx, c.init) if c.err != nil { @@ -79,7 +79,7 @@ func (c *client) PlanBuild(ctx context.Context) error { // defer taking a snapshot of the build // // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot - defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.Logger, c.repo) }() // load the init step from the client // @@ -100,9 +100,9 @@ func (c *client) PlanBuild(ctx context.Context) error { // defer taking a snapshot of the init step // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#SnapshotInit - defer func() { step.SnapshotInit(c.init, c.build, c.Vela, c.logger, c.repo, _init, _log) }() + defer func() { step.SnapshotInit(c.init, c.build, c.Vela, c.Logger, c.repo, _init, _log) }() - c.logger.Info("creating network") + c.Logger.Info("creating network") // create the runtime network for the pipeline c.err = c.Runtime.CreateNetwork(ctx, c.pipeline) if c.err != nil { @@ -126,7 +126,7 @@ func (c *client) PlanBuild(ctx context.Context) error { // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData _log.AppendData(network) - c.logger.Info("creating volume") + c.Logger.Info("creating volume") // create the runtime volume for the pipeline c.err = c.Runtime.CreateVolume(ctx, c.pipeline) if c.err != nil { @@ -162,7 +162,7 @@ func (c *client) PlanBuild(ctx context.Context) error { continue } - c.logger.Infof("pulling %s %s secret %s", secret.Engine, secret.Type, secret.Name) + c.Logger.Infof("pulling %s %s secret %s", secret.Engine, secret.Type, secret.Name) s, err := c.secret.pull(secret) if err != nil { @@ -196,7 +196,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // defer taking a snapshot of the build // // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Snapshot - defer func() { build.Snapshot(c.build, c.Vela, c.err, c.logger, c.repo) }() + defer func() { build.Snapshot(c.build, c.Vela, c.err, c.Logger, c.repo) }() // load the init step from the client // @@ -217,16 +217,16 @@ func (c *client) AssembleBuild(ctx context.Context) error { // defer an upload of the init step // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Upload - defer func() { step.Upload(c.init, c.build, c.Vela, c.logger, c.repo, _init) }() + defer func() { step.Upload(c.init, c.build, c.Vela, c.Logger, c.repo, _init) }() defer func() { - c.logger.Infof("uploading %s step logs", c.init.Name) + c.Logger.Infof("uploading %s step logs", c.init.Name) // send API call to update the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), c.init.Number, _log) if err != nil { - c.logger.Errorf("unable to upload %s logs: %v", c.init.Name, err) + c.Logger.Errorf("unable to upload %s logs: %v", c.init.Name, err) } }() @@ -240,14 +240,14 @@ func (c *client) AssembleBuild(ctx context.Context) error { // TODO: remove this; but we need it for tests s.Detach = true - c.logger.Infof("creating %s service", s.Name) + c.Logger.Infof("creating %s service", s.Name) // create the service c.err = c.CreateService(ctx, s) if c.err != nil { return fmt.Errorf("unable to create %s service: %w", s.Name, c.err) } - c.logger.Infof("inspecting %s service", s.Name) + c.Logger.Infof("inspecting %s service", s.Name) // inspect the service image image, err := c.Runtime.InspectImage(ctx, s) if err != nil { @@ -275,7 +275,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { continue } - c.logger.Infof("creating %s stage", s.Name) + c.Logger.Infof("creating %s stage", s.Name) // create the stage c.err = c.CreateStage(ctx, s) if c.err != nil { @@ -295,14 +295,14 @@ func (c *client) AssembleBuild(ctx context.Context) error { continue } - c.logger.Infof("creating %s step", s.Name) + c.Logger.Infof("creating %s step", s.Name) // create the step c.err = c.CreateStep(ctx, s) if c.err != nil { return fmt.Errorf("unable to create %s step: %w", s.Name, c.err) } - c.logger.Infof("inspecting %s step", s.Name) + c.Logger.Infof("inspecting %s step", s.Name) // inspect the step image image, err := c.Runtime.InspectImage(ctx, s) if err != nil { @@ -328,14 +328,14 @@ func (c *client) AssembleBuild(ctx context.Context) error { continue } - c.logger.Infof("creating %s secret", s.Origin.Name) + c.Logger.Infof("creating %s secret", s.Origin.Name) // create the service c.err = c.secret.create(ctx, s.Origin) if c.err != nil { return fmt.Errorf("unable to create %s secret: %w", s.Origin.Name, c.err) } - c.logger.Infof("inspecting %s secret", s.Origin.Name) + c.Logger.Infof("inspecting %s secret", s.Origin.Name) // inspect the service image image, err := c.Runtime.InspectImage(ctx, s.Origin) if err != nil { @@ -375,7 +375,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData _log.AppendData([]byte("> Executing secret images...\n")) - c.logger.Info("executing secret images") + c.Logger.Info("executing secret images") // execute the secret c.err = c.secret.exec(ctx, &c.pipeline.Secrets) if c.err != nil { @@ -392,18 +392,18 @@ func (c *client) ExecBuild(ctx context.Context) error { // defer an upload of the build // // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Upload - defer func() { build.Upload(c.build, c.Vela, c.err, c.logger, c.repo) }() + defer func() { build.Upload(c.build, c.Vela, c.err, c.Logger, c.repo) }() // execute the services for the pipeline for _, _service := range c.pipeline.Services { - c.logger.Infof("planning %s service", _service.Name) + c.Logger.Infof("planning %s service", _service.Name) // plan the service c.err = c.PlanService(ctx, _service) if c.err != nil { return fmt.Errorf("unable to plan service: %w", c.err) } - c.logger.Infof("executing %s service", _service.Name) + c.Logger.Infof("executing %s service", _service.Name) // execute the service c.err = c.ExecService(ctx, _service) if c.err != nil { @@ -425,14 +425,14 @@ func (c *client) ExecBuild(ctx context.Context) error { continue } - c.logger.Infof("planning %s step", _step.Name) + c.Logger.Infof("planning %s step", _step.Name) // plan the step c.err = c.PlanStep(ctx, _step) if c.err != nil { return fmt.Errorf("unable to plan step: %w", c.err) } - c.logger.Infof("executing %s step", _step.Name) + c.Logger.Infof("executing %s step", _step.Name) // execute the step c.err = c.ExecStep(ctx, _step) if c.err != nil { @@ -465,14 +465,14 @@ func (c *client) ExecBuild(ctx context.Context) error { // // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Go stages.Go(func() error { - c.logger.Infof("planning %s stage", stage.Name) + c.Logger.Infof("planning %s stage", stage.Name) // plan the stage c.err = c.PlanStage(stageCtx, stage, stageMap) if c.err != nil { return fmt.Errorf("unable to plan stage: %w", c.err) } - c.logger.Infof("executing %s stage", stage.Name) + c.Logger.Infof("executing %s stage", stage.Name) // execute the stage c.err = c.ExecStage(stageCtx, stage, stageMap) if c.err != nil { @@ -483,7 +483,7 @@ func (c *client) ExecBuild(ctx context.Context) error { }) } - c.logger.Debug("waiting for stages completion") + c.Logger.Debug("waiting for stages completion") // wait for the stages to complete or return an error // // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait @@ -500,11 +500,11 @@ func (c *client) DestroyBuild(ctx context.Context) error { var err error defer func() { - c.logger.Info("deleting runtime build") + c.Logger.Info("deleting runtime build") // remove the runtime build for the pipeline err = c.Runtime.RemoveBuild(ctx, c.pipeline) if err != nil { - c.logger.Errorf("unable to remove runtime build: %v", err) + c.Logger.Errorf("unable to remove runtime build: %v", err) } }() @@ -515,11 +515,11 @@ func (c *client) DestroyBuild(ctx context.Context) error { continue } - c.logger.Infof("destroying %s step", _step.Name) + c.Logger.Infof("destroying %s step", _step.Name) // destroy the step err = c.DestroyStep(ctx, _step) if err != nil { - c.logger.Errorf("unable to destroy step: %v", err) + c.Logger.Errorf("unable to destroy step: %v", err) } } @@ -530,21 +530,21 @@ func (c *client) DestroyBuild(ctx context.Context) error { continue } - c.logger.Infof("destroying %s stage", _stage.Name) + c.Logger.Infof("destroying %s stage", _stage.Name) // destroy the stage err = c.DestroyStage(ctx, _stage) if err != nil { - c.logger.Errorf("unable to destroy stage: %v", err) + c.Logger.Errorf("unable to destroy stage: %v", err) } } // destroy the services for the pipeline for _, _service := range c.pipeline.Services { - c.logger.Infof("destroying %s service", _service.Name) + c.Logger.Infof("destroying %s service", _service.Name) // destroy the service err = c.DestroyService(ctx, _service) if err != nil { - c.logger.Errorf("unable to destroy service: %v", err) + c.Logger.Errorf("unable to destroy service: %v", err) } } @@ -555,26 +555,26 @@ func (c *client) DestroyBuild(ctx context.Context) error { continue } - c.logger.Infof("destroying %s secret", _secret.Name) + c.Logger.Infof("destroying %s secret", _secret.Name) // destroy the secret err = c.secret.destroy(ctx, _secret.Origin) if err != nil { - c.logger.Errorf("unable to destroy secret: %v", err) + c.Logger.Errorf("unable to destroy secret: %v", err) } } - c.logger.Info("deleting volume") + c.Logger.Info("deleting volume") // remove the runtime volume for the pipeline err = c.Runtime.RemoveVolume(ctx, c.pipeline) if err != nil { - c.logger.Errorf("unable to remove volume: %v", err) + c.Logger.Errorf("unable to remove volume: %v", err) } - c.logger.Info("deleting network") + c.Logger.Info("deleting network") // remove the runtime network for the pipeline err = c.Runtime.RemoveNetwork(ctx, c.pipeline) if err != nil { - c.logger.Errorf("unable to remove network: %v", err) + c.Logger.Errorf("unable to remove network: %v", err) } return err diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 2d2a5c1e..e6308c3b 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -7,19 +7,18 @@ package linux import ( "sync" - "github.com/go-vela/worker/runtime" - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - + "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) type ( // client manages communication with the pipeline resources. client struct { + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry Vela *vela.Client Runtime runtime.Engine Secrets map[string]*library.Secret @@ -31,7 +30,6 @@ type ( // private fields init *pipeline.Container - logger *logrus.Entry logMethod string maxLogSize uint build *library.Build @@ -69,7 +67,7 @@ func New(opts ...Opt) (*client, error) { // create new logger for the client // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry - c.logger = logrus.NewEntry(logger) + c.Logger = logrus.NewEntry(logger) // apply all provided configuration options for _, opt := range opts { diff --git a/executor/linux/opts.go b/executor/linux/opts.go index a4a72f84..c096e7c9 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -7,34 +7,26 @@ package linux import ( "fmt" - "github.com/go-vela/worker/runtime" - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - + "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) -// Opt represents a configuration option to initialize the client. +// Opt represents a configuration option to initialize the executor client for Linux. type Opt func(*client) error -// WithBuild sets the library build in the client. +// WithBuild sets the library build in the executor client for Linux. func WithBuild(b *library.Build) Opt { - logrus.Trace("configuring build in linux client") - return func(c *client) error { + c.Logger.Trace("configuring build in linux executor client") + // check if the build provided is empty if b == nil { return fmt.Errorf("empty build provided") } - // update engine logger with build metadata - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - c.logger = c.logger.WithField("build", b.GetNumber()) - // set the build in the client c.build = b @@ -42,11 +34,11 @@ func WithBuild(b *library.Build) Opt { } } -// WithLogMethod sets the method used to publish logs in the client. +// WithLogMethod sets the method used to publish logs in the executor client for Linux. func WithLogMethod(method string) Opt { - logrus.Trace("configuring log streaming in linux client") - return func(c *client) error { + c.Logger.Trace("configuring log streaming method in linux executor client") + // check if a method is provided if len(method) == 0 { return fmt.Errorf("empty log method provided") @@ -59,11 +51,11 @@ func WithLogMethod(method string) Opt { } } -// WithMaxLogSize set the maximum log size (in bytes) in the client. +// WithMaxLogSize sets the maximum log size (in bytes) in the executor client for Linux. func WithMaxLogSize(size uint) Opt { - logrus.Trace("configuring maximum log size in linux client") - return func(c *client) error { + c.Logger.Trace("configuring maximum log size in linux executor client") + // set the maximum log size in the client c.maxLogSize = size @@ -71,22 +63,17 @@ func WithMaxLogSize(size uint) Opt { } } -// WithHostname sets the hostname in the client. +// WithHostname sets the hostname in the executor client for Linux. func WithHostname(hostname string) Opt { - logrus.Trace("configuring hostname in linux client") - return func(c *client) error { + c.Logger.Trace("configuring hostname in linux executor client") + // check if a hostname is provided if len(hostname) == 0 { // default the hostname to localhost hostname = "localhost" } - // update engine logger with host metadata - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - c.logger = c.logger.WithField("host", hostname) - // set the hostname in the client c.Hostname = hostname @@ -94,11 +81,26 @@ func WithHostname(hostname string) Opt { } } -// WithPipeline sets the pipeline build in the client. -func WithPipeline(p *pipeline.Build) Opt { - logrus.Trace("configuring pipeline in linux client") +// WithLogger sets the logger in the executor client for Linux. +func WithLogger(logger *logrus.Entry) Opt { + return func(c *client) error { + c.Logger.Trace("configuring logger in linux executor client") + + // check if the logger provided is empty + if logger != nil { + // set the executor logger in the linux client + c.Logger = logger + } + return nil + } +} + +// WithPipeline sets the pipeline build in the executor client for Linux. +func WithPipeline(p *pipeline.Build) Opt { return func(c *client) error { + c.Logger.Trace("configuring pipeline in linux executor client") + // check if the pipeline provided is empty if p == nil { return fmt.Errorf("empty pipeline provided") @@ -111,21 +113,16 @@ func WithPipeline(p *pipeline.Build) Opt { } } -// WithRepo sets the library repo in the client. +// WithRepo sets the library repo in the executor client for Linux. func WithRepo(r *library.Repo) Opt { - logrus.Trace("configuring repo in linux client") - return func(c *client) error { + c.Logger.Trace("configuring repository in linux executor client") + // check if the repo provided is empty if r == nil { return fmt.Errorf("empty repo provided") } - // update engine logger with repo metadata - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - c.logger = c.logger.WithField("repo", r.GetFullName()) - // set the repo in the client c.repo = r @@ -133,11 +130,11 @@ func WithRepo(r *library.Repo) Opt { } } -// WithRuntime sets the runtime engine in the client. +// WithRuntime sets the runtime engine in the executor client for Linux. func WithRuntime(r runtime.Engine) Opt { - logrus.Trace("configuring runtime in linux client") - return func(c *client) error { + c.Logger.Trace("configuring runtime in linux executor client") + // check if the runtime provided is empty if r == nil { return fmt.Errorf("empty runtime provided") @@ -150,21 +147,16 @@ func WithRuntime(r runtime.Engine) Opt { } } -// WithUser sets the library user in the client. +// WithUser sets the library user in the executor client for Linux. func WithUser(u *library.User) Opt { - logrus.Trace("configuring user in linux client") - return func(c *client) error { + c.Logger.Trace("configuring user in linux executor client") + // check if the user provided is empty if u == nil { return fmt.Errorf("empty user provided") } - // update engine logger with user metadata - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - c.logger = c.logger.WithField("user", u.GetName()) - // set the user in the client c.user = u @@ -172,11 +164,11 @@ func WithUser(u *library.User) Opt { } } -// WithVelaClient sets the Vela client in the client. +// WithVelaClient sets the Vela client in the executor client for Linux. func WithVelaClient(cli *vela.Client) Opt { - logrus.Trace("configuring Vela client in linux client") - return func(c *client) error { + c.Logger.Trace("configuring Vela client in linux executor client") + // check if the Vela client provided is empty if cli == nil { return fmt.Errorf("empty Vela client provided") @@ -189,11 +181,11 @@ func WithVelaClient(cli *vela.Client) Opt { } } -// WithVersion sets the version in the client. +// WithVersion sets the version in the executor client for Linux. func WithVersion(version string) Opt { - logrus.Trace("configuring version in linux client") - return func(c *client) error { + c.Logger.Trace("configuring version in linux executor client") + // check if a version is provided if len(version) == 0 { // default the version to localhost diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 5db230c5..79e2dbb0 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -39,7 +39,7 @@ func (s *secretSvc) create(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with secret metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := s.client.logger.WithField("secret", ctn.Name) + logger := s.client.Logger.WithField("secret", ctn.Name) ctn.Environment["VELA_DISTRIBUTION"] = s.client.build.GetDistribution() ctn.Environment["BUILD_HOST"] = s.client.build.GetHost() @@ -76,7 +76,7 @@ func (s *secretSvc) destroy(ctx context.Context, ctn *pipeline.Container) error // update engine logger with secret metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := s.client.logger.WithField("secret", ctn.Name) + logger := s.client.Logger.WithField("secret", ctn.Name) logger.Debug("inspecting container") // inspect the runtime container @@ -106,13 +106,13 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { defer func() { _init.SetFinished(time.Now().UTC().Unix()) - s.client.logger.Infof("uploading %s step state", _init.GetName()) + s.client.Logger.Infof("uploading %s step state", _init.GetName()) // send API call to update the build // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update _, _, err = s.client.Vela.Step.Update(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), _init) if err != nil { - s.client.logger.Errorf("unable to upload init state: %v", err) + s.client.Logger.Errorf("unable to upload init state: %v", err) } }() @@ -126,7 +126,7 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { // update engine logger with secret metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := s.client.logger.WithField("secret", _secret.Origin.Name) + logger := s.client.Logger.WithField("secret", _secret.Origin.Name) logger.Debug("running container") // run the runtime container @@ -178,7 +178,7 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update _, _, err = s.client.Vela.Step.Update(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), _init) if err != nil { - s.client.logger.Errorf("unable to upload init state: %v", err) + s.client.Logger.Errorf("unable to upload init state: %v", err) } } @@ -260,7 +260,7 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with secret metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := s.client.logger.WithField("secret", ctn.Name) + logger := s.client.Logger.WithField("secret", ctn.Name) // create new buffer for uploading logs logs := new(bytes.Buffer) diff --git a/executor/linux/service.go b/executor/linux/service.go index d9d32e9d..f40f131a 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -24,7 +24,7 @@ func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) err // update engine logger with service metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("service", ctn.Name) + logger := c.Logger.WithField("service", ctn.Name) logger.Debug("setting up container") // setup the runtime container @@ -67,7 +67,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error // update engine logger with service metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("service", ctn.Name) + logger := c.Logger.WithField("service", ctn.Name) // create the library service object _service := new(library.Service) @@ -121,7 +121,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error // update engine logger with service metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("service", ctn.Name) + logger := c.Logger.WithField("service", ctn.Name) // load the service from the client // @@ -134,7 +134,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error // defer taking a snapshot of the service // // https://pkg.go.dev/github.com/go-vela/worker/internal/service#Snapshot - defer func() { service.Snapshot(ctn, c.build, c.Vela, c.logger, c.repo, _service) }() + defer func() { service.Snapshot(ctn, c.build, c.Vela, c.Logger, c.repo, _service) }() logger.Debug("running container") // run the runtime container @@ -169,7 +169,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // update engine logger with service metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("service", ctn.Name) + logger := c.Logger.WithField("service", ctn.Name) // load the logs for the service from the client // @@ -364,7 +364,7 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er // update engine logger with service metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("service", ctn.Name) + logger := c.Logger.WithField("service", ctn.Name) // load the service from the client // diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 551fa393..01a44034 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -26,7 +26,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { // update engine logger with stage metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("stage", s.Name) + logger := c.Logger.WithField("stage", s.Name) // update the init log with progress // @@ -66,7 +66,7 @@ func (c *client) PlanStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) // update engine logger with stage metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("stage", s.Name) + logger := c.Logger.WithField("stage", s.Name) logger.Debug("gathering stage dependency tree") // ensure dependent stages have completed @@ -101,7 +101,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) // update engine logger with stage metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("stage", s.Name) + logger := c.Logger.WithField("stage", s.Name) // close the stage channel at the end defer func() { @@ -150,7 +150,7 @@ func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { // update engine logger with stage metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("stage", s.Name) + logger := c.Logger.WithField("stage", s.Name) var err error // destroy the steps for the stage diff --git a/executor/linux/step.go b/executor/linux/step.go index adb91d23..ce7be40e 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -24,7 +24,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // update engine logger with step metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("step", ctn.Name) + logger := c.Logger.WithField("step", ctn.Name) // TODO: remove hardcoded reference if ctn.Name == "init" { @@ -79,7 +79,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with step metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("step", ctn.Name) + logger := c.Logger.WithField("step", ctn.Name) // create the library step object _step := library.StepFromBuildContainer(c.build, ctn) @@ -132,7 +132,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with step metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("step", ctn.Name) + logger := c.Logger.WithField("step", ctn.Name) // load the step from the client // @@ -145,7 +145,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { // defer taking a snapshot of the step // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Snapshot - defer func() { step.Snapshot(ctn, c.build, c.Vela, c.logger, c.repo, _step) }() + defer func() { step.Snapshot(ctn, c.build, c.Vela, c.Logger, c.repo, _step) }() logger.Debug("running container") // run the runtime container @@ -204,7 +204,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // update engine logger with step metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("step", ctn.Name) + logger := c.Logger.WithField("step", ctn.Name) // load the logs for the step from the client // @@ -404,7 +404,7 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error // update engine logger with step metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField - logger := c.logger.WithField("step", ctn.Name) + logger := c.Logger.WithField("step", ctn.Name) // load the step from the client // diff --git a/executor/local/opts.go b/executor/local/opts.go index 27e63129..cdae43a8 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -15,10 +15,10 @@ import ( "github.com/go-vela/types/pipeline" ) -// Opt represents a configuration option to initialize the client. +// Opt represents a configuration option to initialize the executor client for Local. type Opt func(*client) error -// WithBuild sets the library build in the client. +// WithBuild sets the library build in the executor client for Local. func WithBuild(b *library.Build) Opt { return func(c *client) error { // set the build in the client @@ -28,7 +28,7 @@ func WithBuild(b *library.Build) Opt { } } -// WithHostname sets the hostname in the client. +// WithHostname sets the hostname in the executor client for Local. func WithHostname(hostname string) Opt { return func(c *client) error { // check if a hostname is provided @@ -44,7 +44,7 @@ func WithHostname(hostname string) Opt { } } -// WithPipeline sets the pipeline build in the client. +// WithPipeline sets the pipeline build in the executor client for Local. func WithPipeline(p *pipeline.Build) Opt { return func(c *client) error { // check if the pipeline provided is empty @@ -59,7 +59,7 @@ func WithPipeline(p *pipeline.Build) Opt { } } -// WithRepo sets the library repo in the client. +// WithRepo sets the library repo in the executor client for Local. func WithRepo(r *library.Repo) Opt { return func(c *client) error { // set the repo in the client @@ -69,7 +69,7 @@ func WithRepo(r *library.Repo) Opt { } } -// WithRuntime sets the runtime engine in the client. +// WithRuntime sets the runtime engine in the executor client for Local. func WithRuntime(r runtime.Engine) Opt { return func(c *client) error { // check if the runtime provided is empty @@ -84,7 +84,7 @@ func WithRuntime(r runtime.Engine) Opt { } } -// WithUser sets the library user in the client. +// WithUser sets the library user in the executor client for Local. func WithUser(u *library.User) Opt { return func(c *client) error { // set the user in the client @@ -94,7 +94,7 @@ func WithUser(u *library.User) Opt { } } -// WithVelaClient sets the Vela client in the client. +// WithVelaClient sets the Vela client in the executor client for Local. func WithVelaClient(cli *vela.Client) Opt { return func(c *client) error { // set the Vela client in the client @@ -104,7 +104,7 @@ func WithVelaClient(cli *vela.Client) Opt { } } -// WithVersion sets the version in the client. +// WithVersion sets the version in the executor client for Local. func WithVersion(version string) Opt { return func(c *client) error { // check if a version is provided diff --git a/executor/setup.go b/executor/setup.go index 52fd8821..a2660891 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -26,6 +26,9 @@ import ( // creating a Vela engine capable of integrating // with a configured executor. type Setup struct { + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry + // Executor Configuration // specifies the executor driver to use @@ -82,6 +85,7 @@ func (s *Setup) Linux() (Engine, error) { linux.WithUser(s.User), linux.WithVelaClient(s.Client), linux.WithVersion(s.Version), + linux.WithLogger(s.Logger), ) } diff --git a/runtime/docker/build.go b/runtime/docker/build.go index a468bc67..260573b3 100644 --- a/runtime/docker/build.go +++ b/runtime/docker/build.go @@ -8,14 +8,12 @@ import ( "context" "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" ) // InspectBuild displays details about the pod for the init step. // This is a no-op for docker. func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("no-op: inspecting build for pipeline %s", b.ID) + c.Logger.Tracef("no-op: inspecting build for pipeline %s", b.ID) return []byte{}, nil } @@ -23,7 +21,7 @@ func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, e // SetupBuild prepares the pipeline build. // This is a no-op for docker. func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("no-op: setting up for build %s", b.ID) + c.Logger.Tracef("no-op: setting up for build %s", b.ID) return nil } @@ -31,7 +29,7 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { // AssembleBuild finalizes pipeline build setup. // This is a no-op for docker. func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("no-op: assembling build %s", b.ID) + c.Logger.Tracef("no-op: assembling build %s", b.ID) return nil } @@ -39,7 +37,7 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { // RemoveBuild deletes (kill, remove) the pipeline build metadata. // This is a no-op for docker. func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("no-op: removing build %s", b.ID) + c.Logger.Tracef("no-op: removing build %s", b.ID) return nil } diff --git a/runtime/docker/container.go b/runtime/docker/container.go index fafb53fe..02cf0a4d 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -19,13 +19,11 @@ import ( "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" - - "github.com/sirupsen/logrus" ) // InspectContainer inspects the pipeline container. func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("inspecting container %s", ctn.ID) + c.Logger.Tracef("inspecting container %s", ctn.ID) // send API call to inspect the container // @@ -45,7 +43,7 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // RemoveContainer deletes (kill, remove) the pipeline container. func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("removing container %s", ctn.ID) + c.Logger.Tracef("removing container %s", ctn.ID) // send API call to inspect the container // @@ -94,12 +92,12 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // // nolint: lll // ignore long line length due to variable names func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { - logrus.Tracef("running container %s", ctn.ID) + c.Logger.Tracef("running container %s", ctn.ID) // allocate new container config from pipeline container containerConf := ctnConfig(ctn) // allocate new host config with volume data - hostConf := hostConfig(b.ID, ctn.Ulimits, c.config.Volumes) + hostConf := hostConfig(c.Logger, b.ID, ctn.Ulimits, c.config.Volumes) // allocate new network config with container name networkConf := netConfig(b.ID, ctn.Name) @@ -188,7 +186,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // SetupContainer prepares the image for the pipeline container. func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("setting up for container %s", ctn.ID) + c.Logger.Tracef("setting up for container %s", ctn.ID) // handle the container pull policy switch ctn.Pull { @@ -203,7 +201,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er case constants.PullOnStart: fallthrough default: - logrus.Tracef("skipping setup for container %s due to pull policy %s", ctn.ID, ctn.Pull) + c.Logger.Tracef("skipping setup for container %s due to pull policy %s", ctn.ID, ctn.Pull) return nil } @@ -240,7 +238,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // // nolint: lll // ignore long line length due to variable names func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { - logrus.Tracef("tailing output for container %s", ctn.ID) + c.Logger.Tracef("tailing output for container %s", ctn.ID) // create options for capturing container logs // @@ -266,14 +264,14 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // capture all stdout and stderr logs go func() { - logrus.Tracef("copying logs for container %s", ctn.ID) + c.Logger.Tracef("copying logs for container %s", ctn.ID) // copy container stdout and stderr logs to our in-memory pipe // // https://godoc.org/github.com/docker/docker/pkg/stdcopy#StdCopy _, err := stdcopy.StdCopy(wc, wc, logs) if err != nil { - logrus.Errorf("unable to copy logs for container: %v", err) + c.Logger.Errorf("unable to copy logs for container: %v", err) } // close logs buffer @@ -288,7 +286,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // WaitContainer blocks until the pipeline container completes. func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("waiting for container %s", ctn.ID) + c.Logger.Tracef("waiting for container %s", ctn.ID) // send API call to wait for the container completion // @@ -307,8 +305,6 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // ctnConfig is a helper function to // generate the container config. func ctnConfig(ctn *pipeline.Container) *container.Config { - logrus.Tracef("Creating container configuration for step %s", ctn.ID) - // create container config object // // https://godoc.org/github.com/docker/docker/api/types/container#Config diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index e293904d..74eb8a06 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -6,11 +6,11 @@ package docker import ( docker "github.com/docker/docker/client" - mock "github.com/go-vela/worker/mock/docker" + "github.com/sirupsen/logrus" ) -// nolint: godot // ignore comment ending in a list +// nolint: godot // ignore period at end for comment ending in a list // // Version represents the supported Docker API version for the mock. // @@ -38,6 +38,8 @@ type client struct { config *config // https://godoc.org/github.com/docker/docker/client#CommonAPIClient Docker docker.CommonAPIClient + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry } // New returns an Engine implementation that @@ -51,6 +53,16 @@ func New(opts ...ClientOpt) (*client, error) { // create new fields c.config = new(config) + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger + logger := logrus.StandardLogger() + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + c.Logger = logrus.NewEntry(logger) + // apply all provided configuration options for _, opt := range opts { err := opt(c) diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 43f8d816..56427d6e 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -15,13 +15,12 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" - "github.com/sirupsen/logrus" ) // CreateImage creates the pipeline container image. func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("creating image for container %s", ctn.ID) + c.Logger.Tracef("creating image for container %s", ctn.ID) // parse image from container // @@ -43,13 +42,15 @@ func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error if err != nil { return err } - defer reader.Close() - // copy output from image pull to standard output - _, err = io.Copy(os.Stdout, reader) - if err != nil { - return err + // check if logrus is set up with trace level + if logrus.GetLevel() == logrus.TraceLevel { + // copy output from image pull to standard output + _, err = io.Copy(os.Stdout, reader) + if err != nil { + return err + } } return nil @@ -57,7 +58,7 @@ func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error // InspectImage inspects the pipeline container image. func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { - logrus.Tracef("inspecting image for container %s", ctn.ID) + c.Logger.Tracef("inspecting image for container %s", ctn.ID) // create output for inspecting image output := []byte( diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 090adb28..e1c20679 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -13,13 +13,11 @@ import ( "github.com/docker/docker/api/types/network" "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" ) // CreateNetwork creates the pipeline network. func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("creating network for pipeline %s", b.ID) + c.Logger.Tracef("creating network for pipeline %s", b.ID) // create options for creating network // @@ -41,7 +39,7 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { // InspectNetwork inspects the pipeline network. func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("inspecting network for pipeline %s", b.ID) + c.Logger.Tracef("inspecting network for pipeline %s", b.ID) // create options for inspecting network // @@ -75,7 +73,7 @@ func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, // RemoveNetwork deletes the pipeline network. func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("removing network for pipeline %s", b.ID) + c.Logger.Tracef("removing network for pipeline %s", b.ID) // send API call to remove the network // diff --git a/runtime/docker/opts.go b/runtime/docker/opts.go index 33dad050..d1b4884c 100644 --- a/runtime/docker/opts.go +++ b/runtime/docker/opts.go @@ -8,28 +8,43 @@ import ( "github.com/sirupsen/logrus" ) -// ClientOpt represents a configuration option to initialize the runtime client. +// ClientOpt represents a configuration option to initialize the runtime client for Docker. type ClientOpt func(*client) error -// WithPrivilegedImages sets the Docker privileged images in the runtime client. -func WithPrivilegedImages(images []string) ClientOpt { - logrus.Trace("configuring privileged images in docker runtime client") - +// WithHostVolumes sets the host volumes in the runtime client for Docker. +func WithHostVolumes(volumes []string) ClientOpt { return func(c *client) error { - // set the runtime privileged images in the docker client - c.config.Images = images + c.Logger.Trace("configuring host volumes in docker runtime client") + + // set the runtime host volumes in the docker client + c.config.Volumes = volumes return nil } } -// WithHostVolumes sets the Docker host volumes in the runtime client. -func WithHostVolumes(volumes []string) ClientOpt { - logrus.Trace("configuring host volumes in docker runtime client") +// WithLogger sets the logger in the runtime client for Docker. +func WithLogger(logger *logrus.Entry) ClientOpt { + return func(c *client) error { + c.Logger.Trace("configuring logger in docker runtime client") + + // check if the logger provided is empty + if logger != nil { + // set the runtime logger in the docker client + c.Logger = logger + } + return nil + } +} + +// WithPrivilegedImages sets the privileged images in the runtime client for Docker. +func WithPrivilegedImages(images []string) ClientOpt { return func(c *client) error { - // set the runtime host volumes in the docker client - c.config.Volumes = volumes + c.Logger.Trace("configuring privileged images in docker runtime client") + + // set the runtime privileged images in the docker client + c.config.Images = images return nil } diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 357162da..0226f859 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -23,7 +23,7 @@ import ( // CreateVolume creates the pipeline volume. func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("creating volume for pipeline %s", b.ID) + c.Logger.Tracef("creating volume for pipeline %s", b.ID) // create options for creating volume // @@ -46,7 +46,7 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { // InspectVolume inspects the pipeline volume. func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("inspecting volume for pipeline %s", b.ID) + c.Logger.Tracef("inspecting volume for pipeline %s", b.ID) // create output for inspecting volume output := []byte( @@ -75,7 +75,7 @@ func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, // RemoveVolume deletes the pipeline volume. func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("removing volume for pipeline %s", b.ID) + c.Logger.Tracef("removing volume for pipeline %s", b.ID) // send API call to remove the volume // @@ -90,8 +90,8 @@ func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { // hostConfig is a helper function to generate the host config // with Ulimit and volume specifications for a container. -func hostConfig(id string, ulimits pipeline.UlimitSlice, volumes []string) *container.HostConfig { - logrus.Tracef("creating mount for default volume %s", id) +func hostConfig(logger *logrus.Entry, id string, ulimits pipeline.UlimitSlice, volumes []string) *container.HostConfig { + logger.Tracef("creating mount for default volume %s", id) // create default mount for pipeline volume mounts := []mount.Mount{ @@ -117,12 +117,12 @@ func hostConfig(id string, ulimits pipeline.UlimitSlice, volumes []string) *cont if len(volumes) > 0 { // iterate through all volumes provided for _, v := range volumes { - logrus.Tracef("creating mount for volume %s", v) + logger.Tracef("creating mount for volume %s", v) // parse the volume provided _volume, err := vol.ParseWithError(v) if err != nil { - logrus.Error(err) + logger.Error(err) } // add the volume to the set of mounts diff --git a/runtime/flags.go b/runtime/flags.go index 1565d0ea..afa05cd7 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -15,24 +15,6 @@ import ( // // https://pkg.go.dev/github.com/urfave/cli?tab=doc#Flag var Flags = []cli.Flag{ - - // Logging Flags - - &cli.StringFlag{ - EnvVars: []string{"VELA_LOG_FORMAT", "RUNTIME_LOG_FORMAT"}, - FilePath: "/vela/runtime/log_format", - Name: "runtime.log.format", - Usage: "format of logs to output", - Value: "json", - }, - &cli.StringFlag{ - EnvVars: []string{"VELA_LOG_LEVEL", "RUNTIME_LOG_LEVEL"}, - FilePath: "/vela/runtime/log_level", - Name: "runtime.log.level", - Usage: "level of logs to output", - Value: "info", - }, - // Runtime Flags &cli.StringFlag{ diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index 42fbd1bc..4d0b8a12 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -11,15 +11,13 @@ import ( "github.com/go-vela/types/pipeline" "github.com/buildkite/yaml" - "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // InspectBuild displays details about the pod for the init step. func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("inspecting build pod for pipeline %s", b.ID) + c.Logger.Tracef("inspecting build pod for pipeline %s", b.ID) output := []byte(fmt.Sprintf("> Inspecting pod for pipeline %s", b.ID)) @@ -39,7 +37,7 @@ func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, e // SetupBuild prepares the pod metadata for the pipeline build. func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("setting up for build %s", b.ID) + c.Logger.Tracef("setting up for build %s", b.ID) // create the object metadata for the pod // @@ -66,7 +64,7 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { // So, all environment, volume, and other container metadata must be setup // before running AssembleBuild. func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("assembling build %s", b.ID) + c.Logger.Tracef("assembling build %s", b.ID) var err error // last minute Environment setup @@ -113,7 +111,7 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { // remnants get deleted. c.createdPod = true - logrus.Infof("creating pod %s", c.Pod.ObjectMeta.Name) + c.Logger.Infof("creating pod %s", c.Pod.ObjectMeta.Name) // send API call to create the pod // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface @@ -130,7 +128,7 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { // RemoveBuild deletes (kill, remove) the pipeline build metadata. // This deletes the kubernetes pod. func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("removing build %s", b.ID) + c.Logger.Tracef("removing build %s", b.ID) if !c.createdPod { // nothing to do @@ -155,7 +153,7 @@ func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { PropagationPolicy: &policy, } - logrus.Infof("removing pod %s", c.Pod.ObjectMeta.Name) + c.Logger.Infof("removing pod %s", c.Pod.ObjectMeta.Name) // send API call to delete the pod err := c.Kubernetes.CoreV1(). Pods(c.config.Namespace). diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index d0e2d8c0..f354850a 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -17,8 +17,6 @@ import ( "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" - "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -27,7 +25,7 @@ import ( // InspectContainer inspects the pipeline container. func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("inspecting container %s", ctn.ID) + c.Logger.Tracef("inspecting container %s", ctn.ID) // create options for getting the container opts := metav1.GetOptions{} @@ -66,7 +64,7 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // RemoveContainer deletes (kill, remove) the pipeline container. // This is a no-op for kubernetes. RemoveBuild handles deleting the pod. func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("no-op: removing container %s", ctn.ID) + c.Logger.Tracef("no-op: removing container %s", ctn.ID) return nil } @@ -75,7 +73,7 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e // // nolint: lll // ignore long line length func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { - logrus.Tracef("running container %s", ctn.ID) + c.Logger.Tracef("running container %s", ctn.ID) // parse image from step _image, err := image.ParseWithError(ctn.Image) if err != nil { @@ -105,7 +103,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // SetupContainer prepares the image for the pipeline container. func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("setting up for container %s", ctn.ID) + c.Logger.Tracef("setting up for container %s", ctn.ID) // create the container object for the pod // @@ -200,7 +198,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // setupContainerEnvironment adds env vars to the Pod spec for a container. // Call this just before pod creation to capture as many env changes as possible. func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { - logrus.Tracef("setting up environment for container %s", ctn.ID) + c.Logger.Tracef("setting up environment for container %s", ctn.ID) // get the matching container spec // (-1 to convert to 0-based index, -1 for injected init container) @@ -224,7 +222,7 @@ func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { // // nolint: lll // ignore long line length due to variable names func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { - logrus.Tracef("tailing output for container %s", ctn.ID) + c.Logger.Tracef("tailing output for container %s", ctn.ID) // create object to store container logs var logs io.ReadCloser @@ -258,7 +256,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io GetLogs(c.Pod.ObjectMeta.Name, opts). Stream(context.Background()) if err != nil { - logrus.Errorf("%v", err) + c.Logger.Errorf("%v", err) return false, nil } @@ -297,7 +295,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io Cap: 2 * time.Minute, } - logrus.Tracef("capturing logs with exponential backoff for container %s", ctn.ID) + c.Logger.Tracef("capturing logs with exponential backoff for container %s", ctn.ID) // perform the function to capture logs with periodic backoff // // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#ExponentialBackoff @@ -311,7 +309,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // WaitContainer blocks until the pipeline container completes. func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("waiting for container %s", ctn.ID) + c.Logger.Tracef("waiting for container %s", ctn.ID) // create label selector for watching the pod selector := fmt.Sprintf("pipeline=%s", c.Pod.ObjectMeta.Name) diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index 1a123131..46ed168a 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -12,8 +12,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" ) const imagePatch = ` @@ -31,14 +29,14 @@ const imagePatch = ` // CreateImage creates the pipeline container image. func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error { - logrus.Tracef("creating image for container %s", ctn.ID) + c.Logger.Tracef("no-op: creating image for container %s", ctn.ID) return nil } // InspectImage inspects the pipeline container image. func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]byte, error) { - logrus.Tracef("inspecting image for container %s", ctn.ID) + c.Logger.Tracef("inspecting image for container %s", ctn.ID) // TODO: consider updating this command // diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index d406830f..86df5844 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -6,6 +6,7 @@ package kubernetes import ( "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" @@ -28,6 +29,8 @@ type client struct { config *config // https://pkg.go.dev/k8s.io/client-go/kubernetes#Interface Kubernetes kubernetes.Interface + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry // https://pkg.go.dev/k8s.io/api/core/v1#Pod Pod *v1.Pod // commonVolumeMounts includes workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) @@ -42,11 +45,21 @@ type client struct { // nolint: golint // ignore returning unexported client func New(opts ...ClientOpt) (*client, error) { // create new Kubernetes client - c := &client{} + c := new(client) // create new fields - c.config = &config{} - c.Pod = &v1.Pod{} + c.config = new(config) + c.Pod = new(v1.Pod) + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger + logger := logrus.StandardLogger() + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + c.Logger = logrus.NewEntry(logger) // apply all provided configuration options for _, opt := range opts { @@ -68,7 +81,7 @@ func New(opts ...ClientOpt) (*client, error) { // https://pkg.go.dev/k8s.io/client-go/rest?tab=doc#InClusterConfig config, err = rest.InClusterConfig() if err != nil { - logrus.Error("VELA_RUNTIME_CONFIG not defined and failed to create kubernetes InClusterConfig!") + c.Logger.Error("VELA_RUNTIME_CONFIG not defined and failed to create kubernetes InClusterConfig!") return nil, err } } else { @@ -101,11 +114,21 @@ func New(opts ...ClientOpt) (*client, error) { // nolint: golint // ignore returning unexported client func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { // create new Kubernetes client - c := &client{} + c := new(client) // create new fields - c.config = &config{} - c.Pod = &v1.Pod{} + c.config = new(config) + c.Pod = new(v1.Pod) + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger + logger := logrus.StandardLogger() + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + c.Logger = logrus.NewEntry(logger) // set the Kubernetes namespace in the runtime client c.config.Namespace = "test" diff --git a/runtime/kubernetes/network.go b/runtime/kubernetes/network.go index a481aefb..86fe8250 100644 --- a/runtime/kubernetes/network.go +++ b/runtime/kubernetes/network.go @@ -12,13 +12,11 @@ import ( v1 "k8s.io/api/core/v1" "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" ) // CreateNetwork creates the pipeline network. func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("creating network for pipeline %s", b.ID) + c.Logger.Tracef("creating network for pipeline %s", b.ID) // nolint: lll // ignore long line length due to link // create the network for the pod @@ -89,7 +87,7 @@ func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { // InspectNetwork inspects the pipeline network. func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("inspecting network for pipeline %s", b.ID) + c.Logger.Tracef("inspecting network for pipeline %s", b.ID) // TODO: consider updating this command // @@ -113,7 +111,7 @@ func (c *client) InspectNetwork(ctx context.Context, b *pipeline.Build) ([]byte, // network lives and dies with the pod it's attached to. However, Vela // uses it to cleanup the network definition for the pod. func (c *client) RemoveNetwork(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("removing network for pipeline %s", b.ID) + c.Logger.Tracef("removing network for pipeline %s", b.ID) // remove the network definition from the pod spec // diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go index b30d2f05..d751f37b 100644 --- a/runtime/kubernetes/opts.go +++ b/runtime/kubernetes/opts.go @@ -10,14 +10,14 @@ import ( "github.com/sirupsen/logrus" ) -// ClientOpt represents a configuration option to initialize the runtime client. +// ClientOpt represents a configuration option to initialize the runtime client for Kubernetes. type ClientOpt func(*client) error -// WithConfigFile sets the Kubernetes config file in the runtime client. +// WithConfigFile sets the config file in the runtime client for Kubernetes. func WithConfigFile(file string) ClientOpt { - logrus.Trace("configuring config file in kubernetes runtime client") - return func(c *client) error { + c.Logger.Trace("configuring config file in kubernetes runtime client") + // set the runtime config file in the kubernetes client c.config.File = file @@ -25,11 +25,38 @@ func WithConfigFile(file string) ClientOpt { } } -// WithNamespace sets the Kubernetes namespace in the runtime client. -func WithNamespace(namespace string) ClientOpt { - logrus.Trace("configuring namespace in kubernetes runtime client") +// WithHostVolumes sets the host volumes in the runtime client for Kubernetes. +func WithHostVolumes(volumes []string) ClientOpt { + return func(c *client) error { + c.Logger.Trace("configuring host volumes in kubernetes runtime client") + + // set the runtime host volumes in the kubernetes client + c.config.Volumes = volumes + + return nil + } +} + +// WithLogger sets the logger in the runtime client for Kubernetes. +func WithLogger(logger *logrus.Entry) ClientOpt { + return func(c *client) error { + c.Logger.Trace("configuring logger in kubernetes runtime client") + + // check if the logger provided is empty + if logger != nil { + // set the runtime logger in the kubernetes client + c.Logger = logger + } + + return nil + } +} +// WithNamespace sets the namespace in the runtime client for Kubernetes. +func WithNamespace(namespace string) ClientOpt { return func(c *client) error { + c.Logger.Trace("configuring namespace in kubernetes runtime client") + // check if the namespace provided is empty if len(namespace) == 0 { return fmt.Errorf("no Kubernetes namespace provided") @@ -42,26 +69,14 @@ func WithNamespace(namespace string) ClientOpt { } } -// WithPrivilegedImages sets the Kubernetes privileged images in the runtime client. +// WithPrivilegedImages sets the privileged images in the runtime client for Kubernetes. func WithPrivilegedImages(images []string) ClientOpt { - logrus.Trace("configuring privileged images in kubernetes runtime client") - return func(c *client) error { + c.Logger.Trace("configuring privileged images in kubernetes runtime client") + // set the runtime privileged images in the kubernetes client c.config.Images = images return nil } } - -// WithHostVolumes sets the Kubernetes host volumes in the runtime client. -func WithHostVolumes(volumes []string) ClientOpt { - logrus.Trace("configuring host volumes in kubernetes runtime client") - - return func(c *client) error { - // set the runtime host volumes in the kubernetes client - c.config.Volumes = volumes - - return nil - } -} diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go index 974c2a8d..72709ee5 100644 --- a/runtime/kubernetes/volume.go +++ b/runtime/kubernetes/volume.go @@ -15,13 +15,11 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" vol "github.com/go-vela/worker/internal/volume" - - "github.com/sirupsen/logrus" ) // CreateVolume creates the pipeline volume. func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("creating volume for pipeline %s", b.ID) + c.Logger.Tracef("creating volume for pipeline %s", b.ID) // create the workspace volume for the pod // @@ -94,7 +92,7 @@ func (c *client) CreateVolume(ctx context.Context, b *pipeline.Build) error { // InspectVolume inspects the pipeline volume. func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, error) { - logrus.Tracef("inspecting volume for pipeline %s", b.ID) + c.Logger.Tracef("inspecting volume for pipeline %s", b.ID) // TODO: consider updating this command // @@ -118,7 +116,7 @@ func (c *client) InspectVolume(ctx context.Context, b *pipeline.Build) ([]byte, // volume lives and dies with the pod it's attached to. However, Vela // uses it to cleanup the volume definition for the pod. func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { - logrus.Tracef("removing volume for pipeline %s", b.ID) + c.Logger.Tracef("removing volume for pipeline %s", b.ID) // remove the volume definition from the pod spec // @@ -134,7 +132,7 @@ func (c *client) setupVolumeMounts(ctx context.Context, ctn *pipeline.Container) volumeMounts []v1.VolumeMount, err error, ) { - logrus.Tracef("setting up VolumeMounts for container %s", ctn.ID) + c.Logger.Tracef("setting up VolumeMounts for container %s", ctn.ID) // add workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) volumeMounts = append(volumeMounts, c.commonVolumeMounts...) diff --git a/runtime/runtime.go b/runtime/runtime.go index 8bcb182e..39cdfafc 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -8,7 +8,6 @@ import ( "fmt" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) diff --git a/runtime/setup.go b/runtime/setup.go index e4f6ac0b..42624b68 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -19,6 +19,9 @@ import ( // creating a Vela engine capable of integrating // with a configured runtime environment. type Setup struct { + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry + // Runtime Configuration // specifies the driver to use for the runtime client @@ -44,6 +47,7 @@ func (s *Setup) Docker() (Engine, error) { return docker.New( docker.WithHostVolumes(s.HostVolumes), docker.WithPrivilegedImages(s.PrivilegedImages), + docker.WithLogger(s.Logger), ) } @@ -60,6 +64,7 @@ func (s *Setup) Kubernetes() (Engine, error) { kubernetes.WithHostVolumes(s.HostVolumes), kubernetes.WithNamespace(s.Namespace), kubernetes.WithPrivilegedImages(s.PrivilegedImages), + kubernetes.WithLogger(s.Logger), ) } From 21411a0898dd470aa6d676b953454cd4e52cf46d Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Wed, 15 Dec 2021 17:05:20 -0600 Subject: [PATCH 227/430] fix(docker): pulling images without output (#253) --- runtime/docker/image.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 56427d6e..d311a350 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "os" "strings" @@ -51,6 +52,12 @@ func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error if err != nil { return err } + } else { + // discard output from image pull + _, err = io.Copy(ioutil.Discard, reader) + if err != nil { + return err + } } return nil From 0be642cc2cef8c99e3fb626d89496e5bc6f96343 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 22 Dec 2021 21:48:06 +0000 Subject: [PATCH 228/430] chore(deps): update go to 1.17 (#255) --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 4 +- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 2 +- go.mod | 93 +++++++++++++++++++++++++++++--- 8 files changed, 93 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1cf68a53..bfceca31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9b054c2b..d61948f5 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -12,7 +12,7 @@ jobs: prerelease: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ec424de8..01871f0d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: publish: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc5eba4c..d8495c73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: release: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 1c7bc7e1..94d21fce 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -10,7 +10,7 @@ jobs: diff-review: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 @@ -27,7 +27,7 @@ jobs: full-review: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 095e572a..da268885 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d7e6913d..7ace2e23 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -11,7 +11,7 @@ jobs: validate: runs-on: ubuntu-latest container: - image: golang:1.16 + image: golang:1.17 steps: - name: clone uses: actions/checkout@v2 diff --git a/go.mod b/go.mod index 10d59a86..fc197a14 100644 --- a/go.mod +++ b/go.mod @@ -1,26 +1,19 @@ module github.com/go-vela/worker -go 1.16 +go 1.17 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 - github.com/containerd/containerd v1.4.4 // indirect github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v20.10.10+incompatible - github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc github.com/google/go-cmp v0.5.6 - github.com/gorilla/mux v1.7.4 // indirect github.com/joho/godotenv v1.4.0 - github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect - github.com/morikuni/aec v1.0.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.11.0 github.com/sirupsen/logrus v1.8.1 @@ -31,3 +24,87 @@ require ( k8s.io/apimachinery v0.22.4 k8s.io/client-go v0.22.4 ) + +require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/alicebob/miniredis/v2 v2.17.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/containerd/containerd v1.4.4 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/drone/envsubst v1.0.3 // indirect + github.com/evanphx/json-patch v4.11.0+incompatible // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-logr/logr v0.4.0 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/go-redis/redis/v8 v8.11.4 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.2.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-github/v39 v39.2.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/gnostic v0.5.5 // indirect + github.com/gorilla/mux v1.7.4 // indirect + github.com/goware/urlx v0.3.1 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.0 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.11 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.26.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/ugorji/go/codec v1.1.11 // indirect + github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect + go.starlark.net v0.0.0-20211203141949-70c0e40ae128 // indirect + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect + golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect + golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 // indirect + google.golang.org/grpc v1.41.0 // indirect + google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/klog/v2 v2.9.0 // indirect + k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect + k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) From 30be02480fed5e24350ed52e9f899e175af1ed88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Dec 2021 11:56:51 -0600 Subject: [PATCH 229/430] fix(deps): update kubernetes packages to v0.23.1 (#250) --- go.mod | 32 +++++++------- go.sum | 136 +++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 130 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index fc197a14..bbe319ee 100644 --- a/go.mod +++ b/go.mod @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.0.3 - k8s.io/api v0.22.4 - k8s.io/apimachinery v0.22.4 - k8s.io/client-go v0.22.4 + k8s.io/api v0.23.1 + k8s.io/apimachinery v0.23.1 + k8s.io/client-go v0.23.1 ) require ( @@ -42,10 +42,10 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/drone/envsubst v1.0.3 // indirect - github.com/evanphx/json-patch v4.11.0+incompatible // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v0.4.0 // indirect + github.com/go-logr/logr v1.2.0 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect @@ -58,13 +58,12 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect - github.com/gorilla/mux v1.7.4 // indirect github.com/goware/urlx v0.3.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.11 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect @@ -72,7 +71,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.1 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -89,22 +88,23 @@ require ( github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect go.starlark.net v0.0.0-20211203141949-70c0e40ae128 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect - golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect + golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect - golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect + golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect + golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 // indirect + google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect google.golang.org/grpc v1.41.0 // indirect - google.golang.org/protobuf v1.26.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/klog/v2 v2.9.0 // indirect - k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect - k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect + k8s.io/klog/v2 v2.30.0 // indirect + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect + k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect + sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index 15ae8264..8530f3e0 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,11 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -99,6 +104,7 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -135,11 +141,13 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= @@ -152,6 +160,7 @@ github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -171,9 +180,12 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= @@ -216,6 +228,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -231,6 +244,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -247,6 +261,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= @@ -261,6 +276,7 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 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= @@ -268,6 +284,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -279,8 +299,8 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= @@ -329,6 +349,7 @@ github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -386,8 +407,9 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -457,8 +479,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -558,6 +581,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -573,6 +597,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= @@ -583,6 +608,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.starlark.net v0.0.0-20211203141949-70c0e40ae128 h1:bxH+EXOo87zEOwKDdZ8Tevgi6irRbqheRm/fr293c58= @@ -610,7 +637,6 @@ golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -638,6 +664,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -646,6 +673,9 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -680,16 +710,29 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/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-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -751,27 +794,39 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -822,6 +877,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-20200505023115-26f46d2f7ef8/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= @@ -829,8 +885,15 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -854,6 +917,11 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -893,8 +961,18 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 h1:bFFRpT+e8JJVY7lMMfvezL1ZIwqiwmPl2bsE2yx4HqM= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -908,8 +986,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -923,8 +1006,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -973,25 +1057,33 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.4 h1:UvyHW0ezB2oIgHAxlYoo6UJQObYXU7awuNarwoHEOjw= -k8s.io/api v0.22.4/go.mod h1:Rgs+9gIGYC5laXQSZZ9JqT5NevNgoGiOdVWi1BAB3qk= +k8s.io/api v0.23.1 h1:ncu/qfBfUoClqwkTGbeRqqOqBCRoUAflMuOaOD7J0c8= +k8s.io/api v0.23.1/go.mod h1:WfXnOnwSqNtG62Y1CdjoMxh7r7u9QXGCkA1u0na2jgo= k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.4 h1:9uwcvPpukBw/Ri0EUmWz+49cnFtaoiyEhQTK+xOe7Ck= k8s.io/apimachinery v0.22.4/go.mod h1:yU6oA6Gnax9RrxGzVvPFFJ+mpnW6PBSqp0sx0I0HHW0= -k8s.io/client-go v0.22.4 h1:aAQ1Wk+I3bjCNk35YWUqbaueqrIonkfDPJSPDDe8Kfg= -k8s.io/client-go v0.22.4/go.mod h1:Yzw4e5e7h1LNHA4uqnMVrpEpUs1hJOiuBsJKIlRCHDA= +k8s.io/apimachinery v0.23.1 h1:sfBjlDFwj2onG0Ijx5C+SrAoeUscPrmghm7wHP+uXlo= +k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= +k8s.io/client-go v0.23.1 h1:Ma4Fhf/p07Nmj9yAB1H7UwbFHEBrSPg8lviR24U2GiQ= +k8s.io/client-go v0.23.1/go.mod h1:6QSI8fEuqD4zgFK0xbdwfB/PthBsIxCJMa3s17WlcO0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c h1:jvamsI1tn9V0S8jicyX82qaFC0H/NKxv2e5mbqsgR80= k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= From 019187c05d77356432372fb990f4e2e38d7421b6 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 6 Jan 2022 10:31:33 -0600 Subject: [PATCH 230/430] feat(secrets): mask secrets in logs (#254) * initial changes * add some replace logic for secret masking * bringing in new types * fix go mod validate * multi line compatibility and initial testing work * added testing for internal secret masking * add back accidental deletion of error checking Co-authored-by: Jordan Brockopp --- executor/linux/step.go | 53 +++++++- executor/linux/step_test.go | 134 +++++++++++++++++++ executor/linux/testdata/step/secret_text.txt | 4 + go.mod | 2 +- go.sum | 3 +- 5 files changed, 192 insertions(+), 4 deletions(-) create mode 100644 executor/linux/testdata/step/secret_text.txt diff --git a/executor/linux/step.go b/executor/linux/step.go index ce7be40e..8a340584 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -10,6 +10,8 @@ import ( "context" "fmt" "io/ioutil" + "regexp" + "strings" "time" "github.com/go-vela/types/constants" @@ -214,6 +216,8 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return err } + secretValues := getSecretValues(ctn) + defer func() { // tail the runtime container rc, err := c.Runtime.TailContainer(ctx, ctn) @@ -239,6 +243,9 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return } + // mask secrets in logs before setting them in the database. + data = maskSecrets(data, secretValues) + // overwrite the existing log with all bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData @@ -305,7 +312,10 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // update the existing log with the new bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) + + data := maskSecrets(logs.Bytes(), secretValues) + + _log.AppendData(data) logger.Debug("appending logs") // send API call to append the logs for the step @@ -362,10 +372,13 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error if logs.Len() > 1000 { logger.Trace(logs.String()) + // mask secrets before updating logs + data := maskSecrets(logs.Bytes(), secretValues) + // update the existing log with the new bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) + _log.AppendData(data) logger.Debug("appending logs") // send API call to append the logs for the step @@ -438,3 +451,39 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error return nil } + +// getSecretValues is a helper function that creates a slice of +// secret values that will be used to mask secrets in logs before +// updating the database. +func getSecretValues(ctn *pipeline.Container) []string { + secretValues := []string{} + // gather secrets' values from the environment map for masking + for _, secret := range ctn.Secrets { + s := ctn.Environment[strings.ToUpper(secret.Target)] + // handle multi line secrets from files + s = strings.ReplaceAll(s, "\n", " ") + + // drop any trailing spaces + if strings.HasSuffix(s, " ") { + s = s[:(len(s) - 1)] + } + secretValues = append(secretValues, s) + } + return secretValues +} + +// maskSecrets is a helper function that takes in a byte array +// and a slice of secret values to mask. +func maskSecrets(log []byte, secrets []string) []byte { + strData := string(log) + for _, secret := range secrets { + re := regexp.MustCompile(`\s` + secret + `\s`) + matches := re.FindAllString(strData, -1) + for _, match := range matches { + mask := string(match[0]) + constants.SecretLogMask + string(match[len(match)-1]) + strData = strings.Replace(strData, match, mask, 1) + } + strData = re.ReplaceAllString(strData, constants.SecretLogMask) + } + return []byte(strData) +} diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index eb64c85b..30f86346 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -6,7 +6,9 @@ package linux import ( "context" + "io/ioutil" "net/http/httptest" + "reflect" "testing" "github.com/gin-gonic/gin" @@ -338,6 +340,7 @@ func TestLinux_StreamStep(t *testing.T) { } _runtime, err := docker.NewMock() + if err != nil { t.Errorf("unable to create runtime engine: %v", err) } @@ -522,3 +525,134 @@ func TestLinux_DestroyStep(t *testing.T) { } } } + +func TestLinux_getSecretValues(t *testing.T) { + fileSecret, err := ioutil.ReadFile("./testdata/step/secret_text.txt") + if err != nil { + t.Errorf("unable to read from test data file secret. Err: %v", err) + } + tests := []struct { + want []string + container *pipeline.Container + }{ + { // no secrets container + want: []string{}, + container: &pipeline.Container{ + ID: "step_github_octocat_1_init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, + { // secrets container + want: []string{"secretUser", "secretPass"}, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{ + "FOO": "bar", + "SECRET_USERNAME": "secretUser", + "SECRET_PASSWORD": "secretPass", + }, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + Secrets: pipeline.StepSecretSlice{ + { + Source: "someSource", + Target: "secret_username", + }, + { + Source: "someOtherSource", + Target: "secret_password", + }, + }, + }, + }, + { // secrets container with file as value + want: []string{"secretUser", "this is a secret"}, + container: &pipeline.Container{ + ID: "step_github_octocat_1_ignorenotfound", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{ + "FOO": "bar", + "SECRET_USERNAME": "secretUser", + "SECRET_PASSWORD": string(fileSecret), + }, + Image: "alpine:latest", + Name: "ignorenotfound", + Number: 1, + Pull: "not_present", + Secrets: pipeline.StepSecretSlice{ + { + Source: "someSource", + Target: "secret_username", + }, + { + Source: "someOtherSource", + Target: "secret_password", + }, + }, + }, + }, + } + // run tests + for _, test := range tests { + got := getSecretValues(test.container) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("getSecretValues is %v, want %v", got, test.want) + } + } +} + +func TestLinux_maskSecrets(t *testing.T) { + // set up test secrets + sVals := []string{"secret", "bigsecret", "littlesecret", "extrasecret"} + + // set up test logs + s1 := "$ echo $NO_SECRET\nnosecret\n" + s2 := "$ echo $SECRET\nbigsecret\n" + s2Masked := "$ echo $SECRET\n***\n" + s3 := "$ echo $SECRET1\nbigsecret\n$ echo $SECRET2\nlittlesecret\n" + s3Masked := "$ echo $SECRET1\n***\n$ echo $SECRET2\n***\n" + + tests := []struct { + want []byte + log []byte + secrets []string + }{ + { // no secrets in log + want: []byte(s1), + log: []byte(s1), + secrets: sVals, + }, + { // one secret in log + want: []byte(s2Masked), + log: []byte(s2), + secrets: sVals, + }, + { // multiple secrets in log + want: []byte(s3Masked), + log: []byte(s3), + secrets: sVals, + }, + { // empty secrets slice + want: []byte(s3), + log: []byte(s3), + secrets: []string{}, + }, + } + // run tests + for _, test := range tests { + got := maskSecrets(test.log, test.secrets) + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("maskSecrets is %v, want %v", string(got), string(test.want)) + } + } +} diff --git a/executor/linux/testdata/step/secret_text.txt b/executor/linux/testdata/step/secret_text.txt new file mode 100644 index 00000000..525086b6 --- /dev/null +++ b/executor/linux/testdata/step/secret_text.txt @@ -0,0 +1,4 @@ +this +is +a +secret \ No newline at end of file diff --git a/go.mod b/go.mod index bbe319ee..4d6d4ced 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 - github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc + github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9 github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 8530f3e0..6e2dafe9 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,9 @@ github.com/go-vela/server v0.11.0/go.mod h1:0phuhEP09iKIiNKpO+cfOa6qU+epgr9Oon1M github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 h1:5a2t2rh2/zD/+NMVrGw9UyILryaF9naG4cGF+WDWuj4= github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06/go.mod h1:CG7MFRFVZ4s2ov4B2XRJles4R+vLD+3AMQw7O9qzk1c= github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= -github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc h1:5BJtsCPpi0jlw9XEFafcUo/u+kdEA7N9bp7bBW9/hjA= github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= +github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9 h1:wvbQB5W9P5F9etlG3T0bLfJd8Ct/SYWnCKCysqF6n1w= +github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From ab3d223fe5e16b86b5b5a2ebf807a12873083c32 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 10:15:37 -0600 Subject: [PATCH 231/430] fix(deps): update module gotest.tools/v3 to v3.1.0 (#256) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4d6d4ced..edbf5c53 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - gotest.tools/v3 v3.0.3 + gotest.tools/v3 v3.1.0 k8s.io/api v0.23.1 k8s.io/apimachinery v0.23.1 k8s.io/client-go v0.23.1 diff --git a/go.sum b/go.sum index 6e2dafe9..9a33d931 100644 --- a/go.sum +++ b/go.sum @@ -1049,8 +1049,8 @@ gorm.io/gorm v1.22.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= +gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From a6ebe854b521f9e05d23c32fa3ce9dc99f65fbd6 Mon Sep 17 00:00:00 2001 From: Kayla McKay <39921134+kaymckay@users.noreply.github.com> Date: Wed, 19 Jan 2022 09:37:09 -0600 Subject: [PATCH 232/430] chore: update copyright year to 2022 (#257) * update copyright year to 2022 * fix quotes --- .github/README.md | 2 +- Dockerfile | 2 +- Dockerfile-alpine | 2 +- LICENSE | 2 +- Makefile | 2 +- api/build.go | 2 +- api/doc.go | 2 +- api/executor.go | 2 +- api/health.go | 2 +- api/metrics.go | 2 +- api/pipeline.go | 2 +- api/repo.go | 2 +- api/shutdown.go | 2 +- api/version.go | 2 +- cmd/vela-worker/client.go | 2 +- cmd/vela-worker/exec.go | 2 +- cmd/vela-worker/flags.go | 2 +- cmd/vela-worker/main.go | 4 ++-- cmd/vela-worker/operate.go | 2 +- cmd/vela-worker/register.go | 2 +- cmd/vela-worker/run.go | 2 +- cmd/vela-worker/server.go | 2 +- cmd/vela-worker/start.go | 2 +- cmd/vela-worker/validate.go | 2 +- cmd/vela-worker/worker.go | 2 +- docker-compose.yml | 4 ++-- executor/context.go | 2 +- executor/context_test.go | 2 +- executor/doc.go | 2 +- executor/engine.go | 2 +- executor/executor.go | 2 +- executor/executor_test.go | 2 +- executor/flags.go | 2 +- executor/linux/api.go | 2 +- executor/linux/api_test.go | 2 +- executor/linux/build.go | 2 +- executor/linux/build_test.go | 2 +- executor/linux/doc.go | 2 +- executor/linux/driver.go | 2 +- executor/linux/driver_test.go | 2 +- executor/linux/linux.go | 2 +- executor/linux/linux_test.go | 2 +- executor/linux/opts.go | 2 +- executor/linux/opts_test.go | 2 +- executor/linux/secret.go | 2 +- executor/linux/secret_test.go | 2 +- executor/linux/service.go | 2 +- executor/linux/service_test.go | 2 +- executor/linux/stage.go | 2 +- executor/linux/stage_test.go | 2 +- executor/linux/step.go | 2 +- executor/linux/step_test.go | 2 +- executor/local/api.go | 2 +- executor/local/api_test.go | 2 +- executor/local/build.go | 2 +- executor/local/build_test.go | 2 +- executor/local/doc.go | 2 +- executor/local/driver.go | 2 +- executor/local/driver_test.go | 2 +- executor/local/local.go | 2 +- executor/local/local_test.go | 2 +- executor/local/opts.go | 2 +- executor/local/opts_test.go | 2 +- executor/local/service.go | 2 +- executor/local/service_test.go | 2 +- executor/local/stage.go | 2 +- executor/local/stage_test.go | 2 +- executor/local/step.go | 2 +- executor/setup.go | 2 +- executor/setup_test.go | 2 +- internal/build/doc.go | 2 +- internal/build/snapshot.go | 2 +- internal/build/snapshot_test.go | 2 +- internal/build/upload.go | 2 +- internal/build/upload_test.go | 2 +- internal/doc.go | 2 +- internal/image/doc.go | 2 +- internal/image/image.go | 2 +- internal/image/image_test.go | 2 +- internal/internal.go | 2 +- internal/service/doc.go | 2 +- internal/service/environment.go | 2 +- internal/service/environment_test.go | 2 +- internal/service/load.go | 2 +- internal/service/load_test.go | 2 +- internal/service/snapshot.go | 2 +- internal/service/snapshot_test.go | 2 +- internal/service/upload.go | 2 +- internal/service/upload_test.go | 2 +- internal/step/doc.go | 2 +- internal/step/environment.go | 2 +- internal/step/environment_test.go | 2 +- internal/step/load.go | 2 +- internal/step/load_test.go | 2 +- internal/step/skip.go | 2 +- internal/step/skip_test.go | 2 +- internal/step/snapshot.go | 2 +- internal/step/snapshot_test.go | 2 +- internal/step/upload.go | 2 +- internal/step/upload_test.go | 2 +- internal/volume/doc.go | 2 +- internal/volume/volume.go | 2 +- internal/volume/volume_test.go | 2 +- mock/doc.go | 2 +- mock/docker/config.go | 2 +- mock/docker/container.go | 2 +- mock/docker/distribution.go | 2 +- mock/docker/doc.go | 2 +- mock/docker/docker.go | 2 +- mock/docker/image.go | 2 +- mock/docker/mock.go | 2 +- mock/docker/network.go | 2 +- mock/docker/node.go | 2 +- mock/docker/plugin.go | 2 +- mock/docker/secret.go | 2 +- mock/docker/service.go | 2 +- mock/docker/swarm.go | 2 +- mock/docker/system.go | 2 +- mock/docker/volume.go | 2 +- mock/mock.go | 2 +- router/build.go | 2 +- router/build_test.go | 2 +- router/doc.go | 2 +- router/executor.go | 2 +- router/executor_test.go | 2 +- router/middleware/doc.go | 2 +- router/middleware/executor.go | 2 +- router/middleware/executor/executor.go | 2 +- router/middleware/executor/executor_test.go | 2 +- router/middleware/executor_test.go | 2 +- router/middleware/header.go | 2 +- router/middleware/header_test.go | 2 +- router/middleware/logger.go | 2 +- router/middleware/logger_test.go | 2 +- router/middleware/payload.go | 2 +- router/middleware/payload_test.go | 2 +- router/middleware/perm/doc.go | 2 +- router/middleware/perm/perm.go | 2 +- router/middleware/perm/perm_test.go | 2 +- router/middleware/secret.go | 2 +- router/middleware/secret_test.go | 2 +- router/middleware/token/doc.go | 2 +- router/middleware/token/token.go | 2 +- router/middleware/token/token_test.go | 2 +- router/middleware/user/context.go | 2 +- router/middleware/user/context_test.go | 2 +- router/middleware/user/doc.go | 2 +- router/middleware/user/user.go | 2 +- router/middleware/user/user_test.go | 2 +- router/pipeline.go | 2 +- router/pipeline_test.go | 2 +- router/repo.go | 2 +- router/repo_test.go | 2 +- router/router.go | 2 +- router/router_test.go | 2 +- runtime/context.go | 2 +- runtime/context_test.go | 2 +- runtime/doc.go | 2 +- runtime/docker/build.go | 2 +- runtime/docker/build_test.go | 2 +- runtime/docker/container.go | 2 +- runtime/docker/container_test.go | 2 +- runtime/docker/doc.go | 2 +- runtime/docker/docker.go | 2 +- runtime/docker/docker_test.go | 2 +- runtime/docker/driver.go | 2 +- runtime/docker/driver_test.go | 2 +- runtime/docker/image.go | 2 +- runtime/docker/image_test.go | 2 +- runtime/docker/network.go | 2 +- runtime/docker/network_test.go | 2 +- runtime/docker/opts.go | 2 +- runtime/docker/opts_test.go | 2 +- runtime/docker/volume.go | 2 +- runtime/docker/volume_test.go | 2 +- runtime/engine.go | 2 +- runtime/flags.go | 2 +- runtime/kubernetes/build.go | 2 +- runtime/kubernetes/build_test.go | 2 +- runtime/kubernetes/container.go | 2 +- runtime/kubernetes/container_test.go | 2 +- runtime/kubernetes/doc.go | 2 +- runtime/kubernetes/driver.go | 2 +- runtime/kubernetes/driver_test.go | 2 +- runtime/kubernetes/image.go | 2 +- runtime/kubernetes/image_test.go | 2 +- runtime/kubernetes/kubernetes.go | 2 +- runtime/kubernetes/kubernetes_test.go | 2 +- runtime/kubernetes/network.go | 2 +- runtime/kubernetes/network_test.go | 2 +- runtime/kubernetes/opts.go | 2 +- runtime/kubernetes/opts_test.go | 2 +- runtime/kubernetes/volume.go | 2 +- runtime/kubernetes/volume_test.go | 2 +- runtime/runtime.go | 2 +- runtime/runtime_test.go | 2 +- runtime/setup.go | 2 +- runtime/setup_test.go | 2 +- version/version.go | 2 +- 199 files changed, 201 insertions(+), 201 deletions(-) diff --git a/.github/README.md b/.github/README.md index d58a3b63..02e630e7 100644 --- a/.github/README.md +++ b/.github/README.md @@ -34,7 +34,7 @@ Please see our [support](SUPPORT.md) documentation for further instructions. ## Copyright and License ``` -Copyright (c) 2021 Target Brands, Inc. +Copyright (c) 2022 Target Brands, Inc. ``` [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/Dockerfile b/Dockerfile index 58369f9e..94738924 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/Dockerfile-alpine b/Dockerfile-alpine index b74bcc2e..c1c42c56 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/LICENSE b/LICENSE index 026db73c..3abdb036 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2021 Target Brands, Inc. + Copyright (c) 2022 Target Brands, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index d0a3e482..290035ef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/build.go b/api/build.go index 28e30293..e552a815 100644 --- a/api/build.go +++ b/api/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/doc.go b/api/doc.go index b649d6ab..aacdede7 100644 --- a/api/doc.go +++ b/api/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/executor.go b/api/executor.go index c4e1cc12..d7880a63 100644 --- a/api/executor.go +++ b/api/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/health.go b/api/health.go index 32bbc894..5609fb75 100644 --- a/api/health.go +++ b/api/health.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/metrics.go b/api/metrics.go index 992c2121..67585339 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/pipeline.go b/api/pipeline.go index 272caf33..3755bd6f 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/repo.go b/api/repo.go index 5005a39d..1a79af62 100644 --- a/api/repo.go +++ b/api/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/shutdown.go b/api/shutdown.go index 60c5413a..82e8aa2f 100644 --- a/api/shutdown.go +++ b/api/shutdown.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/api/version.go b/api/version.go index 62f5d990..a7400fa9 100644 --- a/api/version.go +++ b/api/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 33731cfb..677df2dc 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2567a17b..50d70f9d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 585664e5..cefbacf2 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index c0ca7878..cef5fd75 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -55,7 +55,7 @@ func main() { app.Name = "vela-worker" app.HelpName = "vela-worker" app.Usage = "Vela build daemon designed for executing pipelines" - app.Copyright = "Copyright (c) 2021 Target Brands, Inc. All rights reserved." + app.Copyright = "Copyright (c) 2022 Target Brands, Inc. All rights reserved." app.Authors = []*cli.Author{ { Name: "Vela Admins", diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 75372d12..53a522d6 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index bb6c646e..e147b83a 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 4d0fc388..e519531d 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 44cc1095..876c8064 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index f27350c5..74f8cca5 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 3c9a46b0..84db82b1 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 434fba22..02eb4ff1 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/docker-compose.yml b/docker-compose.yml index 53731914..2050ae46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. @@ -152,4 +152,4 @@ services: - IPC_LOCK networks: - vela: + vela: \ No newline at end of file diff --git a/executor/context.go b/executor/context.go index 37750533..f06e77b6 100644 --- a/executor/context.go +++ b/executor/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/context_test.go b/executor/context_test.go index ba83e911..790e5ff3 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/doc.go b/executor/doc.go index b17464e1..c3dc5a64 100644 --- a/executor/doc.go +++ b/executor/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/engine.go b/executor/engine.go index 0fbd4c88..b3fba545 100644 --- a/executor/engine.go +++ b/executor/engine.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/executor.go b/executor/executor.go index 1fd80458..031ca6cf 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/executor_test.go b/executor/executor_test.go index 86e17c5e..bbd56188 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/flags.go b/executor/flags.go index f1321da8..df9d7743 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/api.go b/executor/linux/api.go index 167d7546..9ee2150a 100644 --- a/executor/linux/api.go +++ b/executor/linux/api.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/api_test.go b/executor/linux/api_test.go index a60d0f11..6004f806 100644 --- a/executor/linux/api_test.go +++ b/executor/linux/api_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/build.go b/executor/linux/build.go index f721715b..fa31f65d 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index d95474f5..86279bfb 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/doc.go b/executor/linux/doc.go index cd16e144..f26b67fd 100644 --- a/executor/linux/doc.go +++ b/executor/linux/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/driver.go b/executor/linux/driver.go index a1d80eb5..22b9ec64 100644 --- a/executor/linux/driver.go +++ b/executor/linux/driver.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go index b6f77fc9..294fe1e2 100644 --- a/executor/linux/driver_test.go +++ b/executor/linux/driver_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/linux.go b/executor/linux/linux.go index e6308c3b..50e490ea 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 5965c621..cd95faf3 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/opts.go b/executor/linux/opts.go index c096e7c9..04f23146 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 026d9c1c..4d2f2621 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 79e2dbb0..0d0be10a 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 0fe2da18..66ebd4da 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/service.go b/executor/linux/service.go index f40f131a..c1a38200 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index fea5d62d..ab9fee11 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 01a44034..21b738f0 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 67164059..2ac87e9d 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/step.go b/executor/linux/step.go index 8a340584..181b27b9 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 30f86346..df1450e0 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/api.go b/executor/local/api.go index 0ed25483..2be695a5 100644 --- a/executor/local/api.go +++ b/executor/local/api.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/api_test.go b/executor/local/api_test.go index 97ebc3ab..0b909732 100644 --- a/executor/local/api_test.go +++ b/executor/local/api_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/build.go b/executor/local/build.go index 0511dacb..312ba8c8 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/build_test.go b/executor/local/build_test.go index 5643e1c1..8e687173 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/doc.go b/executor/local/doc.go index 0f487a8f..be55b775 100644 --- a/executor/local/doc.go +++ b/executor/local/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/driver.go b/executor/local/driver.go index e02eb0f1..27bd6cb8 100644 --- a/executor/local/driver.go +++ b/executor/local/driver.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/driver_test.go b/executor/local/driver_test.go index 4f19c178..171b9a1a 100644 --- a/executor/local/driver_test.go +++ b/executor/local/driver_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/local.go b/executor/local/local.go index 801b7ce8..c922a1af 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/local_test.go b/executor/local/local_test.go index cc64b289..c3644e3a 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/opts.go b/executor/local/opts.go index cdae43a8..6b7a489a 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index 2ed93c51..e55975c1 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/service.go b/executor/local/service.go index 7248502f..b90ca91d 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/service_test.go b/executor/local/service_test.go index e3e1c784..c6bd1ae9 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/stage.go b/executor/local/stage.go index 6b807590..16d27ee7 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index 676f83b6..3272182e 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/local/step.go b/executor/local/step.go index 860ba3ae..032ccbbf 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/setup.go b/executor/setup.go index a2660891..ba1dc615 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/executor/setup_test.go b/executor/setup_test.go index a09705bb..32494180 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/build/doc.go b/internal/build/doc.go index c2c5c609..e1870f2c 100644 --- a/internal/build/doc.go +++ b/internal/build/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/build/snapshot.go b/internal/build/snapshot.go index 77adb1e8..02b96458 100644 --- a/internal/build/snapshot.go +++ b/internal/build/snapshot.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go index 8f5f4712..23c3ddfa 100644 --- a/internal/build/snapshot_test.go +++ b/internal/build/snapshot_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/build/upload.go b/internal/build/upload.go index 4ab8e6f5..f39b6c94 100644 --- a/internal/build/upload.go +++ b/internal/build/upload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go index 4695af1a..45f93479 100644 --- a/internal/build/upload_test.go +++ b/internal/build/upload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/doc.go b/internal/doc.go index a8093234..7f15e7d5 100644 --- a/internal/doc.go +++ b/internal/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/image/doc.go b/internal/image/doc.go index d740349f..8277eab6 100644 --- a/internal/image/doc.go +++ b/internal/image/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/image/image.go b/internal/image/image.go index 6175ff18..d662a464 100644 --- a/internal/image/image.go +++ b/internal/image/image.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/image/image_test.go b/internal/image/image_test.go index 999ba3f3..c8a40298 100644 --- a/internal/image/image_test.go +++ b/internal/image/image_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/internal.go b/internal/internal.go index a0e07f05..c1bc3e4a 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/doc.go b/internal/service/doc.go index 7a2f0920..93b428e3 100644 --- a/internal/service/doc.go +++ b/internal/service/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/environment.go b/internal/service/environment.go index 401a4b83..312f686a 100644 --- a/internal/service/environment.go +++ b/internal/service/environment.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/environment_test.go b/internal/service/environment_test.go index d4c89457..e5de3b62 100644 --- a/internal/service/environment_test.go +++ b/internal/service/environment_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/load.go b/internal/service/load.go index 7c49e367..250731df 100644 --- a/internal/service/load.go +++ b/internal/service/load.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/load_test.go b/internal/service/load_test.go index 01d6cb63..ad0f5be8 100644 --- a/internal/service/load_test.go +++ b/internal/service/load_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/snapshot.go b/internal/service/snapshot.go index 5421ef02..9a99f477 100644 --- a/internal/service/snapshot.go +++ b/internal/service/snapshot.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index c51da19e..11857c2c 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/upload.go b/internal/service/upload.go index 96ac7b2e..cb3108fb 100644 --- a/internal/service/upload.go +++ b/internal/service/upload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index c93f1524..119d2a54 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/doc.go b/internal/step/doc.go index e763b81d..333ebe65 100644 --- a/internal/step/doc.go +++ b/internal/step/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/environment.go b/internal/step/environment.go index 36821c4a..bff3cff9 100644 --- a/internal/step/environment.go +++ b/internal/step/environment.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/environment_test.go b/internal/step/environment_test.go index d8441374..9db02ae7 100644 --- a/internal/step/environment_test.go +++ b/internal/step/environment_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/load.go b/internal/step/load.go index 52b8a08f..e6f92075 100644 --- a/internal/step/load.go +++ b/internal/step/load.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/load_test.go b/internal/step/load_test.go index 74bb1e7c..09f41c82 100644 --- a/internal/step/load_test.go +++ b/internal/step/load_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/skip.go b/internal/step/skip.go index cc7a8fac..a4491228 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index c1c8fc3c..0e2449cb 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go index d1a155cc..a426b4cb 100644 --- a/internal/step/snapshot.go +++ b/internal/step/snapshot.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index 385e22e9..5fc4cf83 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/upload.go b/internal/step/upload.go index f0c29897..47e36390 100644 --- a/internal/step/upload.go +++ b/internal/step/upload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index fdbe740c..10bf7dac 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/volume/doc.go b/internal/volume/doc.go index e1f59b80..1d433f7b 100644 --- a/internal/volume/doc.go +++ b/internal/volume/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/volume/volume.go b/internal/volume/volume.go index d2f531ea..ad18c647 100644 --- a/internal/volume/volume.go +++ b/internal/volume/volume.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/volume/volume_test.go b/internal/volume/volume_test.go index f1fa9f22..f7f458c4 100644 --- a/internal/volume/volume_test.go +++ b/internal/volume/volume_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/doc.go b/mock/doc.go index b301891e..fa9536ea 100644 --- a/mock/doc.go +++ b/mock/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/config.go b/mock/docker/config.go index 6ccbc2bf..e7786e2b 100644 --- a/mock/docker/config.go +++ b/mock/docker/config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/container.go b/mock/docker/container.go index 773b7259..32d0d2ac 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/distribution.go b/mock/docker/distribution.go index eb78ce76..fa1e0ebf 100644 --- a/mock/docker/distribution.go +++ b/mock/docker/distribution.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/doc.go b/mock/docker/doc.go index 04e8f801..bf56572d 100644 --- a/mock/docker/doc.go +++ b/mock/docker/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/docker.go b/mock/docker/docker.go index 96b60895..3528846e 100644 --- a/mock/docker/docker.go +++ b/mock/docker/docker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/image.go b/mock/docker/image.go index 23dac612..eecd81ab 100644 --- a/mock/docker/image.go +++ b/mock/docker/image.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/mock.go b/mock/docker/mock.go index 08a139d7..5a4014ac 100644 --- a/mock/docker/mock.go +++ b/mock/docker/mock.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/network.go b/mock/docker/network.go index 56df60d5..9ec142c0 100644 --- a/mock/docker/network.go +++ b/mock/docker/network.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/node.go b/mock/docker/node.go index 168f0f01..f582d7f1 100644 --- a/mock/docker/node.go +++ b/mock/docker/node.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/plugin.go b/mock/docker/plugin.go index 396250a0..22c63dd2 100644 --- a/mock/docker/plugin.go +++ b/mock/docker/plugin.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/secret.go b/mock/docker/secret.go index 04f4495a..88059c22 100644 --- a/mock/docker/secret.go +++ b/mock/docker/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/service.go b/mock/docker/service.go index 750a1522..e33be0db 100644 --- a/mock/docker/service.go +++ b/mock/docker/service.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/swarm.go b/mock/docker/swarm.go index bf45b893..c43bf6ca 100644 --- a/mock/docker/swarm.go +++ b/mock/docker/swarm.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/system.go b/mock/docker/system.go index bac9f756..850f10fb 100644 --- a/mock/docker/system.go +++ b/mock/docker/system.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/docker/volume.go b/mock/docker/volume.go index 36009818..db64c804 100644 --- a/mock/docker/volume.go +++ b/mock/docker/volume.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/mock/mock.go b/mock/mock.go index 7ff45c76..9b5d8104 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/build.go b/router/build.go index 2338727a..9035840f 100644 --- a/router/build.go +++ b/router/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/build_test.go b/router/build_test.go index 745840a6..19eac607 100644 --- a/router/build_test.go +++ b/router/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/doc.go b/router/doc.go index c6912704..e43cf3f4 100644 --- a/router/doc.go +++ b/router/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/executor.go b/router/executor.go index 54d923c2..a5c572b5 100644 --- a/router/executor.go +++ b/router/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/executor_test.go b/router/executor_test.go index 4893176c..90456e9d 100644 --- a/router/executor_test.go +++ b/router/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/doc.go b/router/middleware/doc.go index 1fbfa2c8..8fb02358 100644 --- a/router/middleware/doc.go +++ b/router/middleware/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor.go b/router/middleware/executor.go index c5f53eb1..3ea92897 100644 --- a/router/middleware/executor.go +++ b/router/middleware/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index 3b558b27..f58682d9 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index a1839000..fde97dbb 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/executor_test.go b/router/middleware/executor_test.go index 7e4d40a0..65611db0 100644 --- a/router/middleware/executor_test.go +++ b/router/middleware/executor_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header.go b/router/middleware/header.go index 19cd47f2..5a7d8519 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index aa0b3ea5..248d43d9 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 7de05d50..754e401a 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 620b9637..d20b400d 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload.go b/router/middleware/payload.go index e84ca1f7..2ef7e5e2 100644 --- a/router/middleware/payload.go +++ b/router/middleware/payload.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/payload_test.go b/router/middleware/payload_test.go index 6edb7db1..235cec5b 100644 --- a/router/middleware/payload_test.go +++ b/router/middleware/payload_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go index 29469464..e68e1c71 100644 --- a/router/middleware/perm/doc.go +++ b/router/middleware/perm/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index 675b224c..ee989c2d 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index 64f55951..64eb967c 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/secret.go b/router/middleware/secret.go index 1fcc5195..c880a425 100644 --- a/router/middleware/secret.go +++ b/router/middleware/secret.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/secret_test.go b/router/middleware/secret_test.go index 9b454d78..1f37a084 100644 --- a/router/middleware/secret_test.go +++ b/router/middleware/secret_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go index 8ebe0e2a..63e877fe 100644 --- a/router/middleware/token/doc.go +++ b/router/middleware/token/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 310a2d80..0327c607 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/token/token_test.go b/router/middleware/token/token_test.go index 41a51298..98a5ac7f 100644 --- a/router/middleware/token/token_test.go +++ b/router/middleware/token/token_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context.go b/router/middleware/user/context.go index 70625cc4..944a1f3e 100644 --- a/router/middleware/user/context.go +++ b/router/middleware/user/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go index 5e233863..6cfe188a 100644 --- a/router/middleware/user/context_test.go +++ b/router/middleware/user/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go index 2d64d5d2..b476b5e2 100644 --- a/router/middleware/user/doc.go +++ b/router/middleware/user/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go index 3f451603..817aa0e9 100644 --- a/router/middleware/user/user.go +++ b/router/middleware/user/user.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index c2f2837f..b4f8b52f 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/pipeline.go b/router/pipeline.go index 6fb9fadd..a738b6f0 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this pipelinesitory. diff --git a/router/pipeline_test.go b/router/pipeline_test.go index a6d73135..f5a3e090 100644 --- a/router/pipeline_test.go +++ b/router/pipeline_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/repo.go b/router/repo.go index b4dec747..ca27b3f6 100644 --- a/router/repo.go +++ b/router/repo.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/repo_test.go b/router/repo_test.go index c44857ef..613c5963 100644 --- a/router/repo_test.go +++ b/router/repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/router.go b/router/router.go index 26ae94d0..7268ec9f 100644 --- a/router/router.go +++ b/router/router.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/router/router_test.go b/router/router_test.go index 18218111..549369a9 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/context.go b/runtime/context.go index f85d972d..88c08303 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/context_test.go b/runtime/context_test.go index 1ae77b45..9621cad7 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/doc.go b/runtime/doc.go index a0024770..78ea790f 100644 --- a/runtime/doc.go +++ b/runtime/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/build.go b/runtime/docker/build.go index 260573b3..305422ba 100644 --- a/runtime/docker/build.go +++ b/runtime/docker/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/build_test.go b/runtime/docker/build_test.go index 4ac26f25..685d5238 100644 --- a/runtime/docker/build_test.go +++ b/runtime/docker/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 02cf0a4d..870360bc 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index 24fb4063..da704f0f 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/doc.go b/runtime/docker/doc.go index 78dfe7b0..9edb7dc0 100644 --- a/runtime/docker/doc.go +++ b/runtime/docker/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 74eb8a06..6b13a443 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/docker_test.go b/runtime/docker/docker_test.go index ba5d9c89..84552ec8 100644 --- a/runtime/docker/docker_test.go +++ b/runtime/docker/docker_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/driver.go b/runtime/docker/driver.go index 52e037d4..13872594 100644 --- a/runtime/docker/driver.go +++ b/runtime/docker/driver.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/driver_test.go b/runtime/docker/driver_test.go index 3ed51c78..917cccae 100644 --- a/runtime/docker/driver_test.go +++ b/runtime/docker/driver_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/image.go b/runtime/docker/image.go index d311a350..e53f7be3 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go index cefa0757..7181dcf1 100644 --- a/runtime/docker/image_test.go +++ b/runtime/docker/image_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/network.go b/runtime/docker/network.go index e1c20679..9140eaf5 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 9b8bbe56..61ce91ab 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/opts.go b/runtime/docker/opts.go index d1b4884c..de1b46be 100644 --- a/runtime/docker/opts.go +++ b/runtime/docker/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go index 5970a293..456df3b4 100644 --- a/runtime/docker/opts_test.go +++ b/runtime/docker/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 0226f859..0f8552ad 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 6219b651..c6202316 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/engine.go b/runtime/engine.go index 6f57d0e9..918f55c1 100644 --- a/runtime/engine.go +++ b/runtime/engine.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/flags.go b/runtime/flags.go index afa05cd7..9c2331b6 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index 4d0b8a12..3b2c5f74 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 63f6e3f6..8dbea5cc 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index f354850a..752c7316 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index aef5249c..07728893 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/doc.go b/runtime/kubernetes/doc.go index b9bf7b5d..76f0ff73 100644 --- a/runtime/kubernetes/doc.go +++ b/runtime/kubernetes/doc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/driver.go b/runtime/kubernetes/driver.go index 216e2d55..9b7594fc 100644 --- a/runtime/kubernetes/driver.go +++ b/runtime/kubernetes/driver.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/driver_test.go b/runtime/kubernetes/driver_test.go index 2010ff45..e744471b 100644 --- a/runtime/kubernetes/driver_test.go +++ b/runtime/kubernetes/driver_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index 46ed168a..0fe98dd2 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/image_test.go b/runtime/kubernetes/image_test.go index 78c9cf7a..ea95678c 100644 --- a/runtime/kubernetes/image_test.go +++ b/runtime/kubernetes/image_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 86df5844..34818d01 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 9027085b..45d08068 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/network.go b/runtime/kubernetes/network.go index 86fe8250..7c3ee37c 100644 --- a/runtime/kubernetes/network.go +++ b/runtime/kubernetes/network.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/network_test.go b/runtime/kubernetes/network_test.go index 2428da27..39828f29 100644 --- a/runtime/kubernetes/network_test.go +++ b/runtime/kubernetes/network_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go index d751f37b..ccfd09a6 100644 --- a/runtime/kubernetes/opts.go +++ b/runtime/kubernetes/opts.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/opts_test.go b/runtime/kubernetes/opts_test.go index 45a149c1..aaff223d 100644 --- a/runtime/kubernetes/opts_test.go +++ b/runtime/kubernetes/opts_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go index 72709ee5..8cf7cd2d 100644 --- a/runtime/kubernetes/volume.go +++ b/runtime/kubernetes/volume.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/volume_test.go b/runtime/kubernetes/volume_test.go index 0821a26b..eecfbd21 100644 --- a/runtime/kubernetes/volume_test.go +++ b/runtime/kubernetes/volume_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/runtime.go b/runtime/runtime.go index 39cdfafc..4ec77e21 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index ba0f4a56..e25d1f7e 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/setup.go b/runtime/setup.go index 42624b68..06a344f5 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/setup_test.go b/runtime/setup_test.go index 3966472a..24aba2c6 100644 --- a/runtime/setup_test.go +++ b/runtime/setup_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/version/version.go b/version/version.go index d62ce117..3368f7a6 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. From 0696d69fe414116e85060324353c22aac357723f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:14:40 -0600 Subject: [PATCH 233/430] fix(deps): update module github.com/prometheus/client_golang to v1.12.0 (#259) Co-authored-by: Renovate Bot --- go.mod | 8 ++++---- go.sum | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index edbf5c53..7e1b48bb 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/google/go-cmp v0.5.6 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.12.0 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c @@ -76,8 +76,8 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect @@ -90,7 +90,7 @@ require ( golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect diff --git a/go.sum b/go.sum index 9a33d931..e54f6556 100644 --- a/go.sum +++ b/go.sum @@ -525,8 +525,9 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= +github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -535,14 +536,16 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -720,6 +723,7 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -734,6 +738,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -815,8 +820,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= From d5b7de2b9ab209839510b6bfd8acf40155df5aa3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:22:48 -0600 Subject: [PATCH 234/430] fix(deps): update module github.com/google/go-cmp to v0.5.7 (#260) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7e1b48bb..0b7d0e32 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9 - github.com/google/go-cmp v0.5.6 + github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.0 diff --git a/go.sum b/go.sum index e54f6556..fb67750b 100644 --- a/go.sum +++ b/go.sum @@ -265,8 +265,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= From 25299498c0440325ec0bf23a6db6a2d50568c6d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:22:30 -0600 Subject: [PATCH 235/430] fix(deps): update deps (patch) to v0.23.2 (#262) Co-authored-by: Renovate Bot --- go.mod | 8 ++++---- go.sum | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0b7d0e32..901d918d 100644 --- a/go.mod +++ b/go.mod @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 - k8s.io/api v0.23.1 - k8s.io/apimachinery v0.23.1 - k8s.io/client-go v0.23.1 + k8s.io/api v0.23.2 + k8s.io/apimachinery v0.23.2 + k8s.io/client-go v0.23.2 ) require ( @@ -105,6 +105,6 @@ require ( k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index fb67750b..b866603f 100644 --- a/go.sum +++ b/go.sum @@ -1065,14 +1065,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.1 h1:ncu/qfBfUoClqwkTGbeRqqOqBCRoUAflMuOaOD7J0c8= -k8s.io/api v0.23.1/go.mod h1:WfXnOnwSqNtG62Y1CdjoMxh7r7u9QXGCkA1u0na2jgo= +k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= +k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.22.4/go.mod h1:yU6oA6Gnax9RrxGzVvPFFJ+mpnW6PBSqp0sx0I0HHW0= -k8s.io/apimachinery v0.23.1 h1:sfBjlDFwj2onG0Ijx5C+SrAoeUscPrmghm7wHP+uXlo= -k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= -k8s.io/client-go v0.23.1 h1:Ma4Fhf/p07Nmj9yAB1H7UwbFHEBrSPg8lviR24U2GiQ= -k8s.io/client-go v0.23.1/go.mod h1:6QSI8fEuqD4zgFK0xbdwfB/PthBsIxCJMa3s17WlcO0= +k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= +k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= +k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= +k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -1093,7 +1093,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From a4c9fd15fbddf90543cd82b18eca0ca57691e8b6 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:33:29 -0600 Subject: [PATCH 236/430] chore(step): clean up masking routine due to types change (#261) * first commit * adding new name due to types change --- executor/linux/service.go | 4 ++-- executor/linux/step.go | 43 +++++++++++++-------------------- executor/linux/step_test.go | 47 ------------------------------------- executor/local/service.go | 4 ++-- go.mod | 2 +- go.sum | 5 ++-- 6 files changed, 24 insertions(+), 81 deletions(-) diff --git a/executor/linux/service.go b/executor/linux/service.go index c1a38200..cfd49eae 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -373,8 +373,8 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er if err != nil { // create the service from the container // - // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainer - _service = library.ServiceFromContainer(ctn) + // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainerEnvironment + _service = library.ServiceFromContainerEnvironment(ctn) } // defer an upload of the service diff --git a/executor/linux/step.go b/executor/linux/step.go index 181b27b9..c67f7585 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -10,7 +10,6 @@ import ( "context" "fmt" "io/ioutil" - "regexp" "strings" "time" @@ -243,14 +242,16 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error return } - // mask secrets in logs before setting them in the database. - data = maskSecrets(data, secretValues) - // overwrite the existing log with all bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.SetData _log.SetData(data) + // mask secrets in the log data + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData + _log.MaskData(secretValues) + logger.Debug("uploading logs") // send API call to update the logs for the step // @@ -312,10 +313,12 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // update the existing log with the new bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) - data := maskSecrets(logs.Bytes(), secretValues) - - _log.AppendData(data) + // mask secrets within the logs before updating database + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData + _log.MaskData(secretValues) logger.Debug("appending logs") // send API call to append the logs for the step @@ -372,13 +375,15 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error if logs.Len() > 1000 { logger.Trace(logs.String()) - // mask secrets before updating logs - data := maskSecrets(logs.Bytes(), secretValues) - // update the existing log with the new bytes // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(data) + _log.AppendData(logs.Bytes()) + + // mask secrets within the logs before updating database + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData + _log.MaskData(secretValues) logger.Debug("appending logs") // send API call to append the logs for the step @@ -471,19 +476,3 @@ func getSecretValues(ctn *pipeline.Container) []string { } return secretValues } - -// maskSecrets is a helper function that takes in a byte array -// and a slice of secret values to mask. -func maskSecrets(log []byte, secrets []string) []byte { - strData := string(log) - for _, secret := range secrets { - re := regexp.MustCompile(`\s` + secret + `\s`) - matches := re.FindAllString(strData, -1) - for _, match := range matches { - mask := string(match[0]) + constants.SecretLogMask + string(match[len(match)-1]) - strData = strings.Replace(strData, match, mask, 1) - } - strData = re.ReplaceAllString(strData, constants.SecretLogMask) - } - return []byte(strData) -} diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index df1450e0..0caa1d5b 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -609,50 +609,3 @@ func TestLinux_getSecretValues(t *testing.T) { } } } - -func TestLinux_maskSecrets(t *testing.T) { - // set up test secrets - sVals := []string{"secret", "bigsecret", "littlesecret", "extrasecret"} - - // set up test logs - s1 := "$ echo $NO_SECRET\nnosecret\n" - s2 := "$ echo $SECRET\nbigsecret\n" - s2Masked := "$ echo $SECRET\n***\n" - s3 := "$ echo $SECRET1\nbigsecret\n$ echo $SECRET2\nlittlesecret\n" - s3Masked := "$ echo $SECRET1\n***\n$ echo $SECRET2\n***\n" - - tests := []struct { - want []byte - log []byte - secrets []string - }{ - { // no secrets in log - want: []byte(s1), - log: []byte(s1), - secrets: sVals, - }, - { // one secret in log - want: []byte(s2Masked), - log: []byte(s2), - secrets: sVals, - }, - { // multiple secrets in log - want: []byte(s3Masked), - log: []byte(s3), - secrets: sVals, - }, - { // empty secrets slice - want: []byte(s3), - log: []byte(s3), - secrets: []string{}, - }, - } - // run tests - for _, test := range tests { - got := maskSecrets(test.log, test.secrets) - - if !reflect.DeepEqual(got, test.want) { - t.Errorf("maskSecrets is %v, want %v", string(got), string(test.want)) - } - } -} diff --git a/executor/local/service.go b/executor/local/service.go index b90ca91d..bc5269c5 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -140,8 +140,8 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er if err != nil { // create the service from the container // - // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainer - _service = library.ServiceFromContainer(ctn) + // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainerEnvironment + _service = library.ServiceFromContainerEnvironment(ctn) } // defer an upload of the service diff --git a/go.mod b/go.mod index 901d918d..c4a35fd5 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.11.0 github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 - github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9 + github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index b866603f..3166c290 100644 --- a/go.sum +++ b/go.sum @@ -208,8 +208,8 @@ github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 h1:5a2t2rh2/zD/+ github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06/go.mod h1:CG7MFRFVZ4s2ov4B2XRJles4R+vLD+3AMQw7O9qzk1c= github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= -github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9 h1:wvbQB5W9P5F9etlG3T0bLfJd8Ct/SYWnCKCysqF6n1w= -github.com/go-vela/types v0.11.1-0.20211221194436-28210cfa70c9/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= +github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da h1:OiPwVjGdDFWl9rb+bIGZgMWtBVswBGjEpe0cVg4b09g= +github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -461,6 +461,7 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= +github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= From 0c2ebca07b2d66533460224d11e7aa49a98e2998 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 24 Jan 2022 16:36:52 +0000 Subject: [PATCH 237/430] enhance(spec): automate worker api spec generation (#258) --- .github/workflows/spec.yml | 33 ++ .github/workflows/validate.yml | 5 + .gitignore | 2 + Makefile | 68 +++ api-spec/vela-worker-v0.5.0.json | 930 ------------------------------- api/build.go | 16 +- api/executor.go | 17 +- api/health.go | 1 - api/metrics.go | 1 - api/pipeline.go | 8 +- api/repo.go | 8 +- api/shutdown.go | 9 +- api/version.go | 1 - router/router.go | 5 +- 14 files changed, 125 insertions(+), 979 deletions(-) create mode 100644 .github/workflows/spec.yml delete mode 100644 api-spec/vela-worker-v0.5.0.json diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml new file mode 100644 index 00000000..0411ccf5 --- /dev/null +++ b/.github/workflows/spec.yml @@ -0,0 +1,33 @@ +# name of the action +name: spec + +# trigger on release events +on: + release: + types: [ created ] + +# pipeline to execute +jobs: + schema: + runs-on: ubuntu-latest + container: + image: golang:1.17 + steps: + - name: clone + uses: actions/checkout@v2 + + - name: tags + run: | + git fetch --tags + + - name: create spec + run: | + make spec-install + make spec + + - name: upload spec + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: 'api-spec.json' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 7ace2e23..273c8361 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -26,3 +26,8 @@ jobs: go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fix ./... produces a zero diff; clean up any changes afterwards. go fix ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + + - name: validate spec + run: | + make spec-install + make spec diff --git a/.gitignore b/.gitignore index f2e68bdc..68b918a3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ secrets.env # Files to be excluded. .DS_Store + +api-spec.json diff --git a/Makefile b/Makefile index 290035ef..09fa099f 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ # capture the current date we build the application from BUILD_DATE = $(shell date +%Y-%m-%dT%H:%M:%SZ) +# set the filename for the api spec +SPEC_FILE = api-spec.json + # check if a git commit sha is already set ifndef GITHUB_SHA # capture the current git commit sha we build the application from @@ -243,3 +246,68 @@ compose-down: @echo @echo "### Destroying containers for docker-compose stack" @docker-compose -f docker-compose.yml down + +# The `spec-install` target is intended to install the +# the needed dependencies to generate the api spec. +# +# Tools used: +# - go-swagger (https://goswagger.io/install.html) +# - jq (https://stedolan.github.io/jq/download/) +# - sponge (part of moreutils - https://packages.debian.org/sid/moreutils) +# +# Limit use of this make target to CI. +# Debian-based environment is assumed. +# +# Usage: `make spec-install` +.PHONY: spec-install +spec-install: + $(if $(shell command -v apt-get 2> /dev/null),,$(error 'apt-get' not found - install jq, sponge, and go-swagger manually)) + @echo + @echo "### Installing utilities (jq and sponge)" + @apt-get update + @apt-get install -y jq moreutils + @echo "### Downloading and installing go-swagger" + @curl -o /usr/local/bin/swagger -L "https://github.com/go-swagger/go-swagger/releases/download/v0.27.0/swagger_linux_amd64" + @chmod +x /usr/local/bin/swagger + +# The `spec-gen` target is intended to create an api-spec +# using go-swagger (https://goswagger.io) +# +# Usage: `make spec-gen` +.PHONY: spec-gen +spec-gen: + @echo + @echo "### Generating api spec using go-swagger" + @swagger generate spec -m --exclude github.com/docker/docker/api/types --exclude-tag definitions/Step -o ${SPEC_FILE} + @echo "### ${SPEC_FILE} created successfully" + +# The `spec-validate` target is intended to validate +# an api-spec using go-swagger (https://goswagger.io) +# +# Usage: `make spec-validate` +.PHONY: spec-validate +spec-validate: + @echo + @echo "### Validating api spec using go-swagger" + @swagger validate ${SPEC_FILE} + +# The `spec-version-update` target is intended to update +# the api-spec version in the generated api-spec +# using the latest git tag. +# +# Usage: `make spec-version-update` +.PHONY: spec-version-update +spec-version-update: APPS = jq sponge +spec-version-update: + $(foreach app,$(APPS),\ + $(if $(shell command -v $(app) 2> /dev/null),,$(error skipping update of spec version - '$(app)' not found))) + @echo + @echo "### Updating api-spec version" + @jq '.info.version = "$(subst v,,${GITHUB_TAG})"' ${SPEC_FILE} | sponge ${SPEC_FILE} + +# The `spec` target will call spec-gen, spec-version-update +# and spec-validate to create and validate an api-spec. +# +# Usage: `make spec` +.PHONY: spec +spec: spec-gen spec-version-update spec-validate diff --git a/api-spec/vela-worker-v0.5.0.json b/api-spec/vela-worker-v0.5.0.json deleted file mode 100644 index f1ca5d3a..00000000 --- a/api-spec/vela-worker-v0.5.0.json +++ /dev/null @@ -1,930 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "swagger": "2.0", - "info": { - "description": "API for a Vela worker", - "title": "Vela worker", - "version": "0.4.3" - }, - "paths": { - "/api/v1/executors": { - "get": { - "description": "Get all currently running executors", - "produces": [ - "application/json" - ], - "tags": [ - "executor" - ], - "operationId": "GetExecutors", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved all running executors", - "schema": { - "$ref": "#/definitions/Executor" - } - }, - "500": { - "description": "Unable to retrieve all running executors" - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/executors/{executor}": { - "get": { - "description": "Get a currently running executor", - "produces": [ - "application/json" - ], - "tags": [ - "executor" - ], - "operationId": "GetExecutor", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "The executor to retrieve", - "name": "executor", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the executor", - "schema": { - "$ref": "#/definitions/Executor" - } - }, - "500": { - "description": "Unable to retrieve the executor" - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/executors/{executor}/build": { - "get": { - "description": "Get the currently running build", - "produces": [ - "application/json" - ], - "tags": [ - "build" - ], - "operationId": "GetBuild", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "The executor running the build", - "name": "executor", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the build", - "schema": { - "$ref": "#/definitions/Build" - } - }, - "500": { - "description": "Unable to retrieve the build", - "schema": { - "type": "string" - } - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/executors/{executor}/build/cancel": { - "delete": { - "description": "Cancel the currently running build", - "produces": [ - "application/json" - ], - "tags": [ - "build" - ], - "operationId": "CancelBuild", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "The executor running the build", - "name": "executor", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully cancelled the build" - }, - "500": { - "description": "Unable to cancel the build" - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/executors/{executor}/pipeline": { - "get": { - "description": "Get a currently running pipeline", - "produces": [ - "application/json" - ], - "tags": [ - "pipeline" - ], - "operationId": "GetPipeline", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "The executor running the pipeline", - "name": "executor", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the pipeline", - "schema": { - "$ref": "#/definitions/PipelineBuild" - } - }, - "500": { - "description": "Unable to retrieve the pipeline" - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/executors/{executor}/repo": { - "get": { - "description": "Get a currently running repo", - "produces": [ - "application/json" - ], - "tags": [ - "repo" - ], - "operationId": "GetRepo", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "The executor running the build", - "name": "executor", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the repo", - "schema": { - "$ref": "#/definitions/Repo" - } - }, - "500": { - "description": "Unable to retrieve the repo" - } - }, - "x-success_http_code": "200" - } - }, - "/api/v1/shutdown": { - "post": { - "description": "Perform a soft shutdown of the worker", - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "operationId": "Shutdown", - "parameters": [ - { - "type": "string", - "description": "Vela server token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "501": { - "description": "Endpoint is not yet implemented", - "schema": { - "type": "string" - } - } - }, - "x-success_http_code": "501" - } - }, - "/health": { - "get": { - "description": "Check if the worker API is available", - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "operationId": "Health", - "responses": { - "200": { - "description": "Successful 'ping' of Vela worker API", - "schema": { - "type": "string" - } - } - }, - "x-success_http_code": "200" - } - }, - "/metrics": { - "get": { - "description": "Retrieve metrics from the worker", - "produces": [ - "application/json" - ], - "tags": [ - "system" - ], - "operationId": "Metrics", - "responses": { - "200": { - "description": "Successful retrieval of worker metrics", - "schema": { - "type": "string" - } - } - }, - "x-success_http_code": "200" - } - } - }, - "definitions": { - "Build": { - "type": "object", - "title": "Build is the library representation of a build for a pipeline.", - "properties": { - "author": { - "type": "string", - "x-go-name": "Author" - }, - "base_ref": { - "type": "string", - "x-go-name": "BaseRef" - }, - "branch": { - "type": "string", - "x-go-name": "Branch" - }, - "clone": { - "type": "string", - "x-go-name": "Clone" - }, - "commit": { - "type": "string", - "x-go-name": "Commit" - }, - "created": { - "type": "integer", - "format": "int64", - "x-go-name": "Created" - }, - "deploy": { - "type": "string", - "x-go-name": "Deploy" - }, - "distribution": { - "type": "string", - "x-go-name": "Distribution" - }, - "email": { - "type": "string", - "x-go-name": "Email" - }, - "enqueued": { - "type": "integer", - "format": "int64", - "x-go-name": "Enqueued" - }, - "error": { - "type": "string", - "x-go-name": "Error" - }, - "event": { - "type": "string", - "x-go-name": "Event" - }, - "finished": { - "type": "integer", - "format": "int64", - "x-go-name": "Finished" - }, - "host": { - "type": "string", - "x-go-name": "Host" - }, - "id": { - "type": "integer", - "format": "int64", - "x-go-name": "ID" - }, - "link": { - "type": "string", - "x-go-name": "Link" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, - "number": { - "type": "integer", - "format": "int64", - "x-go-name": "Number" - }, - "parent": { - "type": "integer", - "format": "int64", - "x-go-name": "Parent" - }, - "ref": { - "type": "string", - "x-go-name": "Ref" - }, - "repo_id": { - "type": "integer", - "format": "int64", - "x-go-name": "RepoID" - }, - "runtime": { - "type": "string", - "x-go-name": "Runtime" - }, - "sender": { - "type": "string", - "x-go-name": "Sender" - }, - "source": { - "type": "string", - "x-go-name": "Source" - }, - "started": { - "type": "integer", - "format": "int64", - "x-go-name": "Started" - }, - "status": { - "type": "string", - "x-go-name": "Status" - }, - "title": { - "type": "string", - "x-go-name": "Title" - } - }, - "x-go-package": "github.com/go-vela/types/library" - }, - "Container": { - "type": "object", - "properties": { - "commands": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Commands" - }, - "detach": { - "type": "boolean", - "x-go-name": "Detach" - }, - "directory": { - "type": "string", - "x-go-name": "Directory" - }, - "entrypoint": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Entrypoint" - }, - "environment": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-go-name": "Environment" - }, - "exit_code": { - "type": "integer", - "format": "int64", - "x-go-name": "ExitCode" - }, - "id": { - "type": "string", - "x-go-name": "ID" - }, - "image": { - "type": "string", - "x-go-name": "Image" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "needs": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Needs" - }, - "networks": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Networks" - }, - "number": { - "type": "integer", - "format": "int64", - "x-go-name": "Number" - }, - "ports": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Ports" - }, - "privileged": { - "type": "boolean", - "x-go-name": "Privileged" - }, - "pull": { - "type": "boolean", - "x-go-name": "Pull" - }, - "ruleset": { - "$ref": "#/definitions/Ruleset" - }, - "secrets": { - "$ref": "#/definitions/StepSecretSlice" - }, - "ulimits": { - "$ref": "#/definitions/UlimitSlice" - }, - "volumes": { - "$ref": "#/definitions/VolumeSlice" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "ContainerSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/Container" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Executor": { - "type": "object", - "title": "Executor is the library representation of an executor for a worker.", - "properties": { - "build": { - "$ref": "#/definitions/Build" - }, - "distribution": { - "type": "string", - "x-go-name": "Distribution" - }, - "host": { - "type": "string", - "x-go-name": "Host" - }, - "id": { - "type": "integer", - "format": "int64", - "x-go-name": "ID" - }, - "pipeline": { - "$ref": "#/definitions/PipelineBuild" - }, - "repo": { - "$ref": "#/definitions/Repo" - }, - "runtime": { - "type": "string", - "x-go-name": "Runtime" - } - }, - "x-go-package": "github.com/go-vela/types/library" - }, - "PipelineBuild": { - "type": "object", - "title": "Build is the pipeline representation of a build for a pipeline.", - "properties": { - "id": { - "type": "string", - "x-go-name": "ID" - }, - "metadata": { - "$ref": "#/definitions/PipelineMetadata" - }, - "secrets": { - "$ref": "#/definitions/SecretSlice" - }, - "services": { - "$ref": "#/definitions/ContainerSlice" - }, - "stages": { - "$ref": "#/definitions/StageSlice" - }, - "steps": { - "$ref": "#/definitions/ContainerSlice" - }, - "version": { - "type": "string", - "x-go-name": "Version" - }, - "worker": { - "$ref": "#/definitions/PipelineWorker" - } - }, - "x-go-name": "Build", - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "PipelineMetadata": { - "type": "object", - "title": "Metadata is the yaml representation of the metadata block for a pipeline.", - "properties": { - "template": { - "type": "boolean", - "x-go-name": "Template" - } - }, - "x-go-name": "Metadata", - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "PipelineWorker": { - "type": "object", - "title": "Worker is the yaml representation of the worker block for a pipeline.", - "properties": { - "flavor": { - "type": "string", - "x-go-name": "Flavor" - }, - "platform": { - "type": "string", - "x-go-name": "Platform" - } - }, - "x-go-name": "Worker", - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Repo": { - "type": "object", - "title": "Repo is the library representation of a repo.", - "properties": { - "active": { - "type": "boolean", - "x-go-name": "Active" - }, - "allow_comment": { - "type": "boolean", - "x-go-name": "AllowComment" - }, - "allow_deploy": { - "type": "boolean", - "x-go-name": "AllowDeploy" - }, - "allow_pull": { - "type": "boolean", - "x-go-name": "AllowPull" - }, - "allow_push": { - "type": "boolean", - "x-go-name": "AllowPush" - }, - "allow_tag": { - "type": "boolean", - "x-go-name": "AllowTag" - }, - "branch": { - "type": "string", - "x-go-name": "Branch" - }, - "clone": { - "type": "string", - "x-go-name": "Clone" - }, - "full_name": { - "type": "string", - "x-go-name": "FullName" - }, - "id": { - "type": "integer", - "format": "int64", - "x-go-name": "ID" - }, - "link": { - "type": "string", - "x-go-name": "Link" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "org": { - "type": "string", - "x-go-name": "Org" - }, - "private": { - "type": "boolean", - "x-go-name": "Private" - }, - "timeout": { - "type": "integer", - "format": "int64", - "x-go-name": "Timeout" - }, - "trusted": { - "type": "boolean", - "x-go-name": "Trusted" - }, - "user_id": { - "type": "integer", - "format": "int64", - "x-go-name": "UserID" - }, - "visibility": { - "type": "string", - "x-go-name": "Visibility" - } - }, - "x-go-package": "github.com/go-vela/types/library" - }, - "Rules": { - "type": "object", - "properties": { - "branch": { - "$ref": "#/definitions/Ruletype" - }, - "comment": { - "$ref": "#/definitions/Ruletype" - }, - "event": { - "$ref": "#/definitions/Ruletype" - }, - "path": { - "$ref": "#/definitions/Ruletype" - }, - "repo": { - "$ref": "#/definitions/Ruletype" - }, - "status": { - "$ref": "#/definitions/Ruletype" - }, - "tag": { - "$ref": "#/definitions/Ruletype" - }, - "target": { - "$ref": "#/definitions/Ruletype" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Ruleset": { - "type": "object", - "properties": { - "continue": { - "type": "boolean", - "x-go-name": "Continue" - }, - "if": { - "$ref": "#/definitions/Rules" - }, - "operator": { - "type": "string", - "x-go-name": "Operator" - }, - "unless": { - "$ref": "#/definitions/Rules" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Ruletype": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Secret": { - "type": "object", - "title": "Secret is the library representation of a secret.", - "properties": { - "engine": { - "type": "string", - "x-go-name": "Engine" - }, - "key": { - "type": "string", - "x-go-name": "Key" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "type": { - "type": "string", - "x-go-name": "Type" - }, - "value": { - "type": "string", - "x-go-name": "Value" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "SecretSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/Secret" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Stage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-go-name": "Name" - }, - "needs": { - "type": "array", - "items": { - "type": "string" - }, - "x-go-name": "Needs" - }, - "steps": { - "$ref": "#/definitions/ContainerSlice" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "StageSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/Stage" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "StepSecret": { - "type": "object", - "properties": { - "source": { - "type": "string", - "x-go-name": "Source" - }, - "target": { - "type": "string", - "x-go-name": "Target" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "StepSecretSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/StepSecret" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Ulimit": { - "type": "object", - "properties": { - "hard": { - "type": "integer", - "format": "int64", - "x-go-name": "Hard" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "soft": { - "type": "integer", - "format": "int64", - "x-go-name": "Soft" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "UlimitSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/Ulimit" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "Volume": { - "type": "object", - "properties": { - "access_mode": { - "type": "string", - "x-go-name": "AccessMode" - }, - "destination": { - "type": "string", - "x-go-name": "Destination" - }, - "source": { - "type": "string", - "x-go-name": "Source" - } - }, - "x-go-package": "github.com/go-vela/types/pipeline" - }, - "VolumeSlice": { - "type": "array", - "items": { - "$ref": "#/definitions/Volume" - }, - "x-go-package": "github.com/go-vela/types/pipeline" - } - }, - "securityDefinitions": { - "ApiKeyAuth": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - } -} \ No newline at end of file diff --git a/api/build.go b/api/build.go index e552a815..71e70d60 100644 --- a/api/build.go +++ b/api/build.go @@ -19,20 +19,16 @@ import ( // Get the currently running build // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string // - in: path // name: executor // description: The executor running the build // required: true // type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the build @@ -66,20 +62,16 @@ func GetBuild(c *gin.Context) { // Cancel the currently running build // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string // - in: path // name: executor // description: The executor running the build // required: true // type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully canceled the build diff --git a/api/executor.go b/api/executor.go index d7880a63..b9ff3949 100644 --- a/api/executor.go +++ b/api/executor.go @@ -21,20 +21,16 @@ import ( // Get a currently running executor // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string // - in: path // name: executor // description: The executor to retrieve // required: true // type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the executor @@ -96,15 +92,10 @@ func GetExecutor(c *gin.Context) { // Get all currently running executors // // --- -// x-success_http_code: '200' // produces: // - application/json -// parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved all running executors diff --git a/api/health.go b/api/health.go index 5609fb75..daa61090 100644 --- a/api/health.go +++ b/api/health.go @@ -15,7 +15,6 @@ import ( // Check if the worker API is available // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: diff --git a/api/metrics.go b/api/metrics.go index 67585339..02bb550f 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -15,7 +15,6 @@ import ( // Retrieve metrics from the worker // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: diff --git a/api/pipeline.go b/api/pipeline.go index 3755bd6f..7f266478 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -19,20 +19,16 @@ import ( // Get a currently running pipeline // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string // - in: path // name: executor // description: The executor running the pipeline // required: true // type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the pipeline diff --git a/api/repo.go b/api/repo.go index 1a79af62..473e9295 100644 --- a/api/repo.go +++ b/api/repo.go @@ -19,20 +19,16 @@ import ( // Get a currently running repo // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string // - in: path // name: executor // description: The executor running the build // required: true // type: string +// security: +// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the repo diff --git a/api/shutdown.go b/api/shutdown.go index 82e8aa2f..e4d19351 100644 --- a/api/shutdown.go +++ b/api/shutdown.go @@ -15,15 +15,10 @@ import ( // Perform a soft shutdown of the worker // // --- -// x-success_http_code: '501' // produces: // - application/json -// parameters: -// - in: header -// name: Authorization -// description: Vela server token -// required: true -// type: string +// security: +// - ApiKeyAuth: [] // responses: // '501': // description: Endpoint is not yet implemented diff --git a/api/version.go b/api/version.go index a7400fa9..acbbb82b 100644 --- a/api/version.go +++ b/api/version.go @@ -17,7 +17,6 @@ import ( // Get the version of the Vela API // // --- -// x-success_http_code: '200' // produces: // - application/json // parameters: diff --git a/router/router.go b/router/router.go index 7268ec9f..c515f5c9 100644 --- a/router/router.go +++ b/router/router.go @@ -6,9 +6,9 @@ // // API for a Vela worker // -// Version: 0.4.3 +// Version: 0.0.0-dev // Schemes: http, https -// BasePath: "" +// Host: localhost // // Consumes: // - application/json @@ -18,6 +18,7 @@ // // SecurityDefinitions: // ApiKeyAuth: +// description: Bearer token // type: apiKey // in: header // name: Authorization From 2b093a4919b5a2b0b82de24dc19dd601de5ce918 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 24 Jan 2022 17:56:20 +0000 Subject: [PATCH 238/430] chore(release): v0.12.0-rc1 (#264) --- go.mod | 16 ++++++------ go.sum | 81 +++++++++++++++++++++++++--------------------------------- 2 files changed, 43 insertions(+), 54 deletions(-) diff --git a/go.mod b/go.mod index c4a35fd5..50519d9b 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.11.0 - github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 - github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da + github.com/go-vela/sdk-go v0.12.0-rc1 + github.com/go-vela/server v0.12.0-rc1 + github.com/go-vela/types v0.12.0-rc1 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.17.0 // indirect + github.com/alicebob/miniredis/v2 v2.18.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/containerd v1.4.4 // indirect @@ -53,7 +53,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.2.0 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-github/v39 v39.2.0 // indirect + github.com/google/go-github/v42 v42.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -81,14 +81,14 @@ require ( github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/afero v1.8.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.1.11 // indirect github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect go.starlark.net v0.0.0-20211203141949-70c0e40ae128 // indirect - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect + golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect diff --git a/go.sum b/go.sum index 3166c290..a66ff198 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,6 +16,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -35,6 +37,7 @@ 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.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -74,22 +77,21 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.16.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= -github.com/alicebob/miniredis/v2 v2.17.0 h1:EwLdrIS50uczw71Jc7iVSxZluTKj5nfSP8n7ARRnJy0= -github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.18.0 h1:EPUGD69ou4Uw4c81t9NLh0+dSou46k4tFEvf498FJ0g= +github.com/alicebob/miniredis/v2 v2.18.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.41.14/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.42.19/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bradleyfalzon/ghinstallation/v2 v2.0.3/go.mod h1:tlgi+JWCXnKFx/Y4WtnDbZEINo31N5bcvnCoqieefmk= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= @@ -145,7 +147,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= @@ -165,7 +166,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -181,7 +181,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -201,20 +200,17 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.11.0 h1:TnbmGBppx1Ux7GPUXv1qDk5DuKKlmurjfex1debH0UM= -github.com/go-vela/sdk-go v0.11.0/go.mod h1:48WCgfDktF90VMvzQ7EZjMFxSSBEsr2kEVtDUwErcqI= -github.com/go-vela/server v0.11.0/go.mod h1:0phuhEP09iKIiNKpO+cfOa6qU+epgr9Oon1MAZ1nIJ0= -github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06 h1:5a2t2rh2/zD/+NMVrGw9UyILryaF9naG4cGF+WDWuj4= -github.com/go-vela/server v0.11.1-0.20211213155322-eeba06d5ce06/go.mod h1:CG7MFRFVZ4s2ov4B2XRJles4R+vLD+3AMQw7O9qzk1c= -github.com/go-vela/types v0.11.0/go.mod h1:8Oml/G1ATFTJsKdsIsstUuHVLsUv7pl6+EiIyOaUqH0= -github.com/go-vela/types v0.11.1-0.20211117152001-4dc404f4aabc/go.mod h1:W00S1BayYQhCVqI4GuuhGjg173MOfU9UvK3JEDCr1aw= -github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da h1:OiPwVjGdDFWl9rb+bIGZgMWtBVswBGjEpe0cVg4b09g= -github.com/go-vela/types v0.11.1-0.20220119192503-0787a67e56da/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= +github.com/go-vela/sdk-go v0.12.0-rc1 h1:Phu3At9XWynDEethh6QF5MforPmrWK6nnewFs5LsDPg= +github.com/go-vela/sdk-go v0.12.0-rc1/go.mod h1:1f9W+5l9GnZSCwYeNnOeVG8jVoBvk/uqKQpLTyyjlSY= +github.com/go-vela/server v0.12.0-rc1 h1:+7sc734zzLklAgIEkKMD7wpf3C7VKjqM6kfP02G5jxA= +github.com/go-vela/server v0.12.0-rc1/go.mod h1:hSSrVEd878/lAfqk2b5uOlwBiHoVG+Q71/dIVmw0bhA= +github.com/go-vela/types v0.12.0-rc1 h1:/qXnZ10AAlJ7l4Rr/FkAfhGFz8G9ww1VkedAXJatHu8= +github.com/go-vela/types v0.12.0-rc1/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -268,8 +264,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= +github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= +github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= +github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -288,6 +285,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -300,6 +298,7 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -343,7 +342,7 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.3.0/go.mod h1:EabNQLI0VWbWoGlA+oBLC8PXmR9D60aUVgQGvangFWQ= +github.com/hashicorp/vault/api v1.3.1/go.mod h1:QeJoWxMFt+MsuWcYhmwRLwKEXrjwAFFywzhptMsTIUw= github.com/hashicorp/vault/sdk v0.3.0/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -364,7 +363,6 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= @@ -384,13 +382,11 @@ github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01C github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= github.com/jackc/pgx/v4 v4.14.0/go.mod h1:jT3ibf/A0ZVCp89rtCIN0zCJxcE74ypROmHEZYsG/j8= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -438,7 +434,6 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -460,7 +455,6 @@ github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -519,7 +513,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -571,11 +565,10 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= +github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -617,7 +610,6 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.starlark.net v0.0.0-20211203141949-70c0e40ae128 h1:bxH+EXOo87zEOwKDdZ8Tevgi6irRbqheRm/fr293c58= go.starlark.net v0.0.0-20211203141949-70c0e40ae128/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -643,11 +635,13 @@ golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa h1:idItI2DDfCokpg0N51B2VtiLdJ4vAuXC9fnCb2gACo4= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -719,16 +713,17 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -811,17 +806,17 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -901,6 +896,7 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -976,7 +972,9 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1048,12 +1046,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.2.1/go.mod h1:SHRZhu+D0tLOHV5qbxZRUM6kBcf3jp/kxPz2mYMTsNY= gorm.io/driver/postgres v1.2.3/go.mod h1:pJV6RgYQPG47aM1f0QeOzFH9HxQc8JcmAgjRCgS0wjs= -gorm.io/driver/sqlite v1.2.3/go.mod h1:wkiGvZF3le/8vjCRYg0bT8TSw6APZ5rtgKW8uQYE3sc= gorm.io/driver/sqlite v1.2.6/go.mod h1:gyoX0vHiiwi0g49tv+x2E7l8ksauLK0U/gShcdUsjWY= -gorm.io/gorm v1.22.0/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gorm.io/gorm v1.22.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= @@ -1068,21 +1062,16 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= -k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.4/go.mod h1:yU6oA6Gnax9RrxGzVvPFFJ+mpnW6PBSqp0sx0I0HHW0= +k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= From dedd6550c146bb1884c0231970cfa280d6bdec3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:36:55 -0600 Subject: [PATCH 239/430] fix(deps): update deps (patch) (#265) Co-authored-by: Renovate Bot --- go.mod | 10 +++++----- go.sum | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 50519d9b..16e8648d 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.12.0-rc1 - github.com/go-vela/server v0.12.0-rc1 + github.com/go-vela/server v0.12.0-rc2 github.com/go-vela/types v0.12.0-rc1 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 - k8s.io/api v0.23.2 - k8s.io/apimachinery v0.23.2 - k8s.io/client-go v0.23.2 + k8s.io/api v0.23.3 + k8s.io/apimachinery v0.23.3 + k8s.io/client-go v0.23.3 ) require ( @@ -103,7 +103,7 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/klog/v2 v2.30.0 // indirect k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect + k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.2.0 // indirect diff --git a/go.sum b/go.sum index a66ff198..63a59e13 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.12.0-rc1 h1:Phu3At9XWynDEethh6QF5MforPmrWK6nnewFs5LsDPg= github.com/go-vela/sdk-go v0.12.0-rc1/go.mod h1:1f9W+5l9GnZSCwYeNnOeVG8jVoBvk/uqKQpLTyyjlSY= -github.com/go-vela/server v0.12.0-rc1 h1:+7sc734zzLklAgIEkKMD7wpf3C7VKjqM6kfP02G5jxA= github.com/go-vela/server v0.12.0-rc1/go.mod h1:hSSrVEd878/lAfqk2b5uOlwBiHoVG+Q71/dIVmw0bhA= +github.com/go-vela/server v0.12.0-rc2 h1:u0ehMThk50nV2aMPgYWTbzFCDoOE094M7JDzSd8yCFY= +github.com/go-vela/server v0.12.0-rc2/go.mod h1:hSSrVEd878/lAfqk2b5uOlwBiHoVG+Q71/dIVmw0bhA= github.com/go-vela/types v0.12.0-rc1 h1:/qXnZ10AAlJ7l4Rr/FkAfhGFz8G9ww1VkedAXJatHu8= github.com/go-vela/types v0.12.0-rc1/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1060,13 +1061,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= -k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= +k8s.io/api v0.23.3 h1:KNrME8KHGr12Ozjf8ytOewKzZh6hl/hHUZeHddT3a38= +k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= -k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= -k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= -k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= -k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= +k8s.io/apimachinery v0.23.3 h1:7IW6jxNzrXTsP0c8yXz2E5Yx/WTzVPTsHIx/2Vm0cIk= +k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/client-go v0.23.3 h1:23QYUmCQ/W6hW78xIwm3XqZrrKZM+LWDqW2zfo+szJs= +k8s.io/client-go v0.23.3/go.mod h1:47oMd+YvAOqZM7pcQ6neJtBiFH7alOyfunYN48VsmwE= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -1075,8 +1076,9 @@ k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From c8de9bc15694bb289a6289afbdff7834f4a66e25 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 08:45:41 -0700 Subject: [PATCH 240/430] fix(deps): update module github.com/prometheus/client_golang to v1.12.1 (#266) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 16e8648d..fa0e7702 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.12.0 + github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c diff --git a/go.sum b/go.sum index 63a59e13..d5211115 100644 --- a/go.sum +++ b/go.sum @@ -523,8 +523,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= From 4ad282ff9a9a041e55d4865623263bdfb6af0f23 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 2 Feb 2022 22:11:13 +0000 Subject: [PATCH 241/430] chore(deps): bump server and sdk to latest rc (#268) --- go.mod | 4 ++-- go.sum | 19 +++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index fa0e7702..930ba135 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.12.0-rc1 - github.com/go-vela/server v0.12.0-rc2 + github.com/go-vela/sdk-go v0.12.0-rc2 + github.com/go-vela/server v0.12.0-rc3 github.com/go-vela/types v0.12.0-rc1 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index d5211115..690b4066 100644 --- a/go.sum +++ b/go.sum @@ -84,7 +84,7 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= +github.com/aws/aws-sdk-go v1.42.44/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -200,11 +200,10 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.12.0-rc1 h1:Phu3At9XWynDEethh6QF5MforPmrWK6nnewFs5LsDPg= -github.com/go-vela/sdk-go v0.12.0-rc1/go.mod h1:1f9W+5l9GnZSCwYeNnOeVG8jVoBvk/uqKQpLTyyjlSY= -github.com/go-vela/server v0.12.0-rc1/go.mod h1:hSSrVEd878/lAfqk2b5uOlwBiHoVG+Q71/dIVmw0bhA= -github.com/go-vela/server v0.12.0-rc2 h1:u0ehMThk50nV2aMPgYWTbzFCDoOE094M7JDzSd8yCFY= -github.com/go-vela/server v0.12.0-rc2/go.mod h1:hSSrVEd878/lAfqk2b5uOlwBiHoVG+Q71/dIVmw0bhA= +github.com/go-vela/sdk-go v0.12.0-rc2 h1:qy9IrIQKEeYJMy91I6n7Fr2sdqW2X8CVapL3silWfmw= +github.com/go-vela/sdk-go v0.12.0-rc2/go.mod h1:ZKETgZVHxj5BOXifzWH7fPmCND4qi4kZSJpwhz3kzb0= +github.com/go-vela/server v0.12.0-rc3 h1:kplmxfSxGwiX7kKMeGzL8ONyYpJ6BeHrNZYuFnzc7no= +github.com/go-vela/server v0.12.0-rc3/go.mod h1:ssQ7x5VxAep4IfCHJBPVhUreyVZaMhCsO7aBQmLafco= github.com/go-vela/types v0.12.0-rc1 h1:/qXnZ10AAlJ7l4Rr/FkAfhGFz8G9ww1VkedAXJatHu8= github.com/go-vela/types v0.12.0-rc1/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -397,7 +396,7 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -523,7 +522,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1051,7 +1049,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gorm.io/driver/postgres v1.2.3/go.mod h1:pJV6RgYQPG47aM1f0QeOzFH9HxQc8JcmAgjRCgS0wjs= gorm.io/driver/sqlite v1.2.6/go.mod h1:gyoX0vHiiwi0g49tv+x2E7l8ksauLK0U/gShcdUsjWY= gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= +gorm.io/gorm v1.22.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= @@ -1064,7 +1062,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.3 h1:KNrME8KHGr12Ozjf8ytOewKzZh6hl/hHUZeHddT3a38= k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= -k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= k8s.io/apimachinery v0.23.3 h1:7IW6jxNzrXTsP0c8yXz2E5Yx/WTzVPTsHIx/2Vm0cIk= k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/client-go v0.23.3 h1:23QYUmCQ/W6hW78xIwm3XqZrrKZM+LWDqW2zfo+szJs= @@ -1077,7 +1074,6 @@ k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= @@ -1086,7 +1082,6 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= From 9f70506fcdd6cf16bdd74f0760734ee339606eb0 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 4 Feb 2022 20:21:01 +0000 Subject: [PATCH 242/430] chore(release): v0.12.0 (#269) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 930ba135..781c65fe 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.12.0-rc2 - github.com/go-vela/server v0.12.0-rc3 - github.com/go-vela/types v0.12.0-rc1 + github.com/go-vela/sdk-go v0.12.0 + github.com/go-vela/server v0.12.0 + github.com/go-vela/types v0.12.0 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 690b4066..0ae3e94c 100644 --- a/go.sum +++ b/go.sum @@ -200,12 +200,12 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.12.0-rc2 h1:qy9IrIQKEeYJMy91I6n7Fr2sdqW2X8CVapL3silWfmw= -github.com/go-vela/sdk-go v0.12.0-rc2/go.mod h1:ZKETgZVHxj5BOXifzWH7fPmCND4qi4kZSJpwhz3kzb0= -github.com/go-vela/server v0.12.0-rc3 h1:kplmxfSxGwiX7kKMeGzL8ONyYpJ6BeHrNZYuFnzc7no= -github.com/go-vela/server v0.12.0-rc3/go.mod h1:ssQ7x5VxAep4IfCHJBPVhUreyVZaMhCsO7aBQmLafco= -github.com/go-vela/types v0.12.0-rc1 h1:/qXnZ10AAlJ7l4Rr/FkAfhGFz8G9ww1VkedAXJatHu8= -github.com/go-vela/types v0.12.0-rc1/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= +github.com/go-vela/sdk-go v0.12.0 h1:McLqz6IVXeApO4/SWmmfsGzeqdU1NcR8LqYauDKJxos= +github.com/go-vela/sdk-go v0.12.0/go.mod h1:C0N4UOx7jz1bYu2Du48ns0uxPbZBidcac8jc4eOyON4= +github.com/go-vela/server v0.12.0 h1:QsmE5qN2l5pg9XETRpXHTQ1Zy4p/jtXrNa/pUYja1kQ= +github.com/go-vela/server v0.12.0/go.mod h1:+ebwdqxI6HnRpbfMYAyxOaQOAeHE0VhXETukhzH/cLk= +github.com/go-vela/types v0.12.0 h1:RnliZ5sZ0ceDRNyjp8o5uPKMIgLF7Gd7JRJWgOLgOPw= +github.com/go-vela/types v0.12.0/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From 8617f9ff4040833b3c1fd98982d6b343d140c087 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 10:22:23 -0600 Subject: [PATCH 243/430] fix(deps): update module github.com/docker/distribution to v2.8.0 (#270) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 781c65fe..c769fa3b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 - github.com/docker/distribution v2.7.1+incompatible + github.com/docker/distribution v2.8.0+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 diff --git a/go.sum b/go.sum index 0ae3e94c..5762a46f 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,8 @@ 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= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.0+incompatible h1:l9EaZDICImO1ngI+uTifW+ZYvvz7fKISBAKpg+MbWbY= +github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= From 91e15e28dc25d12a37bf31821b7e61f2d96e859c Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 15 Feb 2022 08:44:50 -0700 Subject: [PATCH 244/430] fix(step): add catch block for disallowed secrets (#272) * add catch block for unallowed secrets * adding test case --- executor/linux/step.go | 12 ++++++------ executor/linux/step_test.go | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/executor/linux/step.go b/executor/linux/step.go index c67f7585..3e76677b 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -464,15 +464,15 @@ func getSecretValues(ctn *pipeline.Container) []string { secretValues := []string{} // gather secrets' values from the environment map for masking for _, secret := range ctn.Secrets { - s := ctn.Environment[strings.ToUpper(secret.Target)] + // capture secret from environment + s, ok := ctn.Environment[strings.ToUpper(secret.Target)] + if !ok { + continue + } // handle multi line secrets from files s = strings.ReplaceAll(s, "\n", " ") - // drop any trailing spaces - if strings.HasSuffix(s, " ") { - s = s[:(len(s) - 1)] - } - secretValues = append(secretValues, s) + secretValues = append(secretValues, strings.TrimSuffix(s, " ")) } return secretValues } diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 0caa1d5b..9ce32591 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -570,6 +570,10 @@ func TestLinux_getSecretValues(t *testing.T) { Source: "someOtherSource", Target: "secret_password", }, + { + Source: "disallowedSecret", + Target: "cannot_find", + }, }, }, }, From 32e490ced7819c2e303981a00e08f0895c5e5416 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 15:31:45 -0600 Subject: [PATCH 245/430] fix(deps): update deps (patch) to v0.23.4 (#273) Co-authored-by: Renovate Bot --- go.mod | 6 +++--- go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index c769fa3b..1c050e69 100644 --- a/go.mod +++ b/go.mod @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.3.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 - k8s.io/api v0.23.3 - k8s.io/apimachinery v0.23.3 - k8s.io/client-go v0.23.3 + k8s.io/api v0.23.4 + k8s.io/apimachinery v0.23.4 + k8s.io/client-go v0.23.4 ) require ( diff --git a/go.sum b/go.sum index 5762a46f..88bc6add 100644 --- a/go.sum +++ b/go.sum @@ -1060,12 +1060,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.3 h1:KNrME8KHGr12Ozjf8ytOewKzZh6hl/hHUZeHddT3a38= -k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= -k8s.io/apimachinery v0.23.3 h1:7IW6jxNzrXTsP0c8yXz2E5Yx/WTzVPTsHIx/2Vm0cIk= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/client-go v0.23.3 h1:23QYUmCQ/W6hW78xIwm3XqZrrKZM+LWDqW2zfo+szJs= -k8s.io/client-go v0.23.3/go.mod h1:47oMd+YvAOqZM7pcQ6neJtBiFH7alOyfunYN48VsmwE= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= +k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From 96d36747c5f18b2ff89c0d3dd351c63edcecc1c8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 10:50:26 -0600 Subject: [PATCH 246/430] fix(deps): update module github.com/go-vela/server to v0.12.1 (#276) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1c050e69..4ca28c11 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.12.0 - github.com/go-vela/server v0.12.0 + github.com/go-vela/server v0.12.1 github.com/go-vela/types v0.12.0 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 diff --git a/go.sum b/go.sum index 88bc6add..d7eb3506 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.12.0 h1:McLqz6IVXeApO4/SWmmfsGzeqdU1NcR8LqYauDKJxos= github.com/go-vela/sdk-go v0.12.0/go.mod h1:C0N4UOx7jz1bYu2Du48ns0uxPbZBidcac8jc4eOyON4= -github.com/go-vela/server v0.12.0 h1:QsmE5qN2l5pg9XETRpXHTQ1Zy4p/jtXrNa/pUYja1kQ= github.com/go-vela/server v0.12.0/go.mod h1:+ebwdqxI6HnRpbfMYAyxOaQOAeHE0VhXETukhzH/cLk= +github.com/go-vela/server v0.12.1 h1:IWZhD5eE8m2sHuM/AY9VifZ1uDUYJa8h8hU9YUwa/CY= +github.com/go-vela/server v0.12.1/go.mod h1:+ebwdqxI6HnRpbfMYAyxOaQOAeHE0VhXETukhzH/cLk= github.com/go-vela/types v0.12.0 h1:RnliZ5sZ0ceDRNyjp8o5uPKMIgLF7Gd7JRJWgOLgOPw= github.com/go-vela/types v0.12.0/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= From 419803353052c239946253ac13d04a93ed0eb521 Mon Sep 17 00:00:00 2001 From: DaxJohnson Date: Wed, 2 Mar 2022 15:52:58 -0600 Subject: [PATCH 247/430] chore(dep): update containerd to 1.4.8 (#278) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4ca28c11..8c81b7a1 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/alicebob/miniredis/v2 v2.18.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/containerd/containerd v1.4.4 // indirect + github.com/containerd/containerd v1.4.8 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index d7eb3506..d785ca93 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= -github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.8 h1:H0wkS4AbVKTg9vyvBdCBrxoax8AMObKbNz9Fl2N0i4Y= +github.com/containerd/containerd v1.4.8/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= From f3a395164237e7490cf7b81d30e19513d03101fe Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 4 Mar 2022 01:45:14 -0600 Subject: [PATCH 248/430] refactor: docs for local setup (#275) --- .env.example | 32 ++++++++++++++++++++------------ DOCS.md | 44 +++++++++++++++++++++++++++++--------------- docker-compose.yml | 14 +++++++------- 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/.env.example b/.env.example index 8ab90001..c5bf492e 100644 --- a/.env.example +++ b/.env.example @@ -9,23 +9,32 @@ # # ################## -# These are used by the ui service -# defined in the docker compose stack +# These are used by the ui service defined in the docker compose stack -# customize the location where you want users to provide feedback +# customize the location for the Vela server address # -# default: https://github.com/go-vela/ui/issues/new -# VELA_FEEDBACK_URL= +# Should match the "VELA_ADDR" value in docker-compose.yml when running locally. +VELA_API=http://localhost:8080 # customize the location where users can review documentation # # default: https://go-vela.github.io/docs # VELA_DOCS_URL= -# customize the location for the Vela server address +# customize the location where you want users to provide feedback # -# Should match the "VELA_ADDR" value in docker-compose.yml when running locally. -VELA_API=http://localhost:8080 +# default: https://github.com/go-vela/ui/issues/new +# VELA_FEEDBACK_URL= + +# customize the number of bytes for size of logs the UI will attempt to render +# +# default: 20000 (2 MB) +# VELA_LOG_BYTES_LIMIT= + +# customize the number of concurrent builds for a repo the UI will allow configuring +# +# default: 30 +# VELA_MAX_BUILD_LIMIT= ############################################################ # _______ _______ ______ __ __ _______ ______ # @@ -38,8 +47,7 @@ VELA_API=http://localhost:8080 # # ############################################################ -# These are used by the server service -# defined in the docker compose stack +# These are used by the server service defined in the docker compose stack # github web url (only required if using GitHub Enterprise) # @@ -47,7 +55,7 @@ VELA_API=http://localhost:8080 # VELA_SCM_ADDR= # github client id from oauth application -VELA_SCM_CLIENT= +# VELA_SCM_CLIENT= # github client secret from oauth application -VELA_SCM_SECRET= +# VELA_SCM_SECRET= \ No newline at end of file diff --git a/DOCS.md b/DOCS.md index d65afb6e..d5a23f42 100644 --- a/DOCS.md +++ b/DOCS.md @@ -2,7 +2,7 @@ This document intends to provide information on how to get the Vela application running locally. -For more information, please see our [installation docs](https://go-vela.github.io/docs/install/). +For more information, please see our [administration docs](https://go-vela.github.io/docs/administration/). ## Prerequisites @@ -10,7 +10,7 @@ This section covers the dependencies required to get the Vela application runnin * [Docker](https://docs.docker.com/install/) - building block for local development * [Docker Compose](https://docs.docker.com/compose/install/) - start up local development -* [Github OAuth Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) - building block for local development +* [GitHub OAuth Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) - building block for local development * [Golang](https://golang.org/dl/) - for source code and [dependency management](https://github.com/golang/go/wiki/Modules) * [Make](https://www.gnu.org/software/make/) - start up local development @@ -34,7 +34,7 @@ git clone git@github.com:go-vela/worker.git $HOME/go-vela/worker cd $HOME/go-vela/worker ``` -* If using GitHub Enterprise (default: `https://github.com/`), add the Web URL to a local `.env` file: +* If using GitHub Enterprise (default: `https://github.com`), add the Web URL to a local `.env` file: ```bash # add Github Enterprise Web URL to local `.env` file for `docker-compose` @@ -43,7 +43,7 @@ echo "VELA_SCM_ADDR=" >> .env * Create an [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development: * `Application name` = `Vela - local` (name of the OAuth application shouldn't matter) - * `Homepage URL` = `http://localhost:8080` (base URL of the server) + * `Homepage URL` = `http://localhost:8888` (base URL of the web UI) * `Authorization callback URL` = `http://localhost:8080/authenticate` (authenticate endpoint of the base URL of the server) * Add OAuth client secrets to a local `.env` file: @@ -93,15 +93,15 @@ In order to run a build in Vela, you'll need to add a repo to the locally runnin

1. Navigate to the `Source Repositories` page @ http://localhost:8888/account/source-repos - * For convenience, you can reference our documentation to [learn how to enable a repo](https://go-vela.github.io/docs/usage/enable_repo/). + * For convenience, you can reference our documentation to [learn how to enable a repo](https://go-vela.github.io/docs/usage/enable_repo/). -2. Click the blue drop down arrow on the left side next to the org that contains the repo you want to enable. +2. Click the blue drop-down arrow on the left side next to the org that contains the repo you want to enable. -3. Find the repo you want to enable in the drop down list and click the blue `Enable` button on the right side. - * You should received a `success` message telling you `/ enabled.` +3. Find the repo you want to enable in the drop-down list and click the blue `Enable` button on the right side. + * You should receive a `success` message telling you `/ enabled.` 4. Click the blue `View` button to navigate directly to the repo. - * You should be redirected to http://localhost:8888// + * You should be redirected to http://localhost:8888//

@@ -116,7 +116,7 @@ In order to run a build in Vela, you'll need to add a pipeline to the repo that

1. Create a Vela [pipeline](https://go-vela.github.io/docs/tour/) to define a workflow for Vela to run. - * For conveinence, you can reference our documentation to use [one of our example pipelines](https://go-vela.github.io/docs/usage/examples/). + * For convenience, you can reference our documentation to use [one of our example pipelines](https://go-vela.github.io/docs/usage/examples/). 2. Add the pipeline to the repo that was enabled above. @@ -137,8 +137,8 @@ In order to run a build in Vela, you'll need to capture a valid webhook payload 2. Find the [recent delivery](https://developer.github.com/webhooks/testing/#listing-recent-deliveries) for the pipeline that was added to your repo. 3. Create a request locally for http://localhost:8080/webhook and replicate all parts from the recent delivery. - * You should use whatever tool feels most comfortable and natural to you (`curl`, `Postman`, `Insomnia` etc.). - * You should replicate all the request headers and the request body from the recent delivery. + * You should use whatever tool feels most comfortable and natural to you (`curl`, `Postman`, `Insomnia` etc.). + * You should replicate all the request headers and the request body from the recent delivery. 4. Send the request and navigate directly to the repo (http://localhost:8888//) to watch the build run live. @@ -156,19 +156,33 @@ This section covers the different services in the stack when the Vela applicatio The `server` Docker compose service hosts the Vela server and API. -This component is used for processing web requests and managing resources in the database and publishing builds to the FIFO queue. +Known as the brains of the Vela application, this service is responsible for managing the state of application resources. + +This includes managing resources in the system (repositories, users etc.) and storing resource data in the database. + +Additionally, the server responds to event-driven requests (webhooks) which creates new builds to run on a worker. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/administration/server/). ### Worker The `worker` Docker compose service hosts the Vela build daemon. -This component is used for pulling builds from the FIFO queue and executing them based off their configuration. +Known as the brawn of the Vela application, this service is responsible for managing the state of build resources. + +This includes pulling the build, provided by the server, from the queue to be run. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/administration/worker/). ### UI The `ui` Docker compose service hosts the Vela UI. -This component is used for providing a user-friendly interface for triggering actions in the Vela system. +Known as the user interface for the Vela application, often referred to as the Vela UI, this service provides a means for utilizing and interacting with the Vela platform. + +The Vela UI aims to provide users with an easy-to-use toolbox that supplies most of the functionality necessary for managing, investigating, and successfully troubleshooting Vela pipelines. + +For more information, please review [the official documentation](https://go-vela.github.io/docs/administration/ui/). ### Redis diff --git a/docker-compose.yml b/docker-compose.yml index 2050ae46..9f20ba9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: # This component is used for pulling builds from the FIFO # queue and executing them based off their configuration. # - # https://go-vela.github.io/docs/concepts/infrastructure/worker/ + # https://go-vela.github.io/docs/administration/worker/ worker: build: context: . @@ -31,8 +31,8 @@ services: VELA_RUNTIME_PRIVILEGED_IMAGES: 'target/vela-docker' VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' - WORKER_ADDR: http://worker:8080 - WORKER_CHECK_IN: 1m + WORKER_ADDR: 'http://worker:8080' + WORKER_CHECK_IN: 5m restart: always ports: - "8081:8080" @@ -47,7 +47,7 @@ services: # managing resources in the database and publishing # builds to the FIFO queue. # - # https://go-vela.github.io/docs/concepts/infrastructure/server/ + # https://go-vela.github.io/docs/administration/server/ server: container_name: server image: target/vela-server:latest @@ -69,8 +69,8 @@ services: VELA_WEBUI_ADDR: 'http://localhost:8888' VELA_LOG_LEVEL: trace VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' - VELA_REFRESH_TOKEN_DURATION: 5m - VELA_ACCESS_TOKEN_DURATION: 1m + VELA_REFRESH_TOKEN_DURATION: 90m + VELA_ACCESS_TOKEN_DURATION: 60m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' env_file: @@ -88,7 +88,7 @@ services: # This component is used for providing a user-friendly # interface for triggering actions in the Vela system. # - # https://go-vela.github.io/docs/concepts/infrastructure/ui/ + # https://go-vela.github.io/docs/administration/ui/ ui: container_name: ui image: target/vela-ui:latest From 6a27b36dee1538a861cd10229ffbd92e425a7bfd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 09:31:39 -0600 Subject: [PATCH 249/430] chore(deps): update actions/checkout action to v3 (#281) Co-authored-by: Renovate Bot --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/reviewdog.yml | 4 ++-- .github/workflows/spec.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfceca31..1840ce8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: build run: | diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5f2ba692..a60d441c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index d61948f5..843e7ae9 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -15,7 +15,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # ensures we fetch tag history for the repository fetch-depth: 0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 01871f0d..8f8bab9a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # ensures we fetch tag history for the repository fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8495c73..80904f91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: tags run: | diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 94d21fce..1e0515d0 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -13,7 +13,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 @@ -30,7 +30,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 0411ccf5..9cc2d9cc 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -14,7 +14,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: tags run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da268885..1d9bd91c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: install run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 273c8361..0310e8bc 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,7 +14,7 @@ jobs: image: golang:1.17 steps: - name: clone - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: validate run: | From 4e11ab60d26513c54aa2a64561d1e888dcc75d4e Mon Sep 17 00:00:00 2001 From: Kayla McKay <39921134+kaymckay@users.noreply.github.com> Date: Tue, 8 Mar 2022 10:51:38 -0600 Subject: [PATCH 250/430] chore: update Golangci config & clean repo (#282) * add new yml config * lint wsl * replace golint fals pos with revive false pos * remove nolintlints * lint funlen * noctx * govet -> goheader * errorlint * remove lll false pos, lint contextcheck * lint dupl * lint nilerr * remove false positives * clean * remove changelog code --- .chglog/CHANGELOG.tpl.md | 30 ----- .chglog/config.yml | 28 ---- .github/workflows/release.yml | 53 -------- .golangci.yml | 172 ++++++++++++++----------- cmd/vela-worker/exec.go | 3 +- cmd/vela-worker/operate.go | 3 +- cmd/vela-worker/register.go | 9 +- cmd/vela-worker/run.go | 2 - cmd/vela-worker/server.go | 2 + cmd/vela-worker/start.go | 6 +- executor/context.go | 2 +- executor/context_test.go | 6 +- executor/linux/build.go | 8 +- executor/linux/build_test.go | 2 +- executor/linux/linux.go | 2 +- executor/linux/secret.go | 5 +- executor/linux/service.go | 4 - executor/linux/stage.go | 1 + executor/linux/step.go | 5 +- executor/linux/step_test.go | 1 + executor/local/build.go | 4 +- executor/local/local.go | 2 +- executor/local/step_test.go | 2 +- internal/service/environment.go | 2 - internal/service/snapshot.go | 2 - internal/service/upload.go | 4 - internal/step/environment.go | 2 - internal/step/snapshot.go | 4 - internal/step/upload.go | 4 - internal/volume/volume.go | 2 - mock/docker/config.go | 1 + mock/docker/container.go | 24 ++-- mock/docker/docker.go | 1 - mock/docker/image.go | 6 +- mock/docker/network.go | 8 +- mock/docker/secret.go | 1 + mock/docker/volume.go | 12 +- router/middleware/executor/executor.go | 1 + router/middleware/header.go | 5 +- router/middleware/logger.go | 1 + router/middleware/perm/perm.go | 2 + router/middleware/token/token_test.go | 5 +- router/pipeline.go | 2 +- runtime/context.go | 2 +- runtime/context_test.go | 6 +- runtime/docker/container.go | 4 - runtime/docker/docker.go | 4 +- runtime/kubernetes/build.go | 9 ++ runtime/kubernetes/build_test.go | 3 +- runtime/kubernetes/container.go | 12 +- runtime/kubernetes/image.go | 1 - runtime/kubernetes/kubernetes.go | 5 +- runtime/kubernetes/network.go | 1 - version/version.go | 4 +- 54 files changed, 189 insertions(+), 303 deletions(-) delete mode 100755 .chglog/CHANGELOG.tpl.md delete mode 100755 .chglog/config.yml delete mode 100644 .github/workflows/release.yml diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100755 index 60a67d5b..00000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -1,30 +0,0 @@ -{{ range .Versions }} - -## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) - -{{ range .CommitGroups -}} -### {{ .Title }} - -{{ range .Commits -}} -* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{ end }} -{{ end -}} - -{{- if .RevertCommits -}} -### Reverts - -{{ range .RevertCommits -}} -* {{ .Revert.Header }} -{{ end }} -{{ end -}} - -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### {{ .Title }} - -{{ range .Notes }} -{{ .Body }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} \ No newline at end of file diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100755 index febd8d72..00000000 --- a/.chglog/config.yml +++ /dev/null @@ -1,28 +0,0 @@ -style: github -template: CHANGELOG.tpl.md -info: - title: CHANGELOG - repository_url: https://github.com/go-vela/worker -options: - commits: - # filters: - # Type: - # - feat - # - fix - # - perf - # - refactor - commit_groups: - # title_maps: - # feat: Features - # fix: Bug Fixes - # perf: Performance Improvements - # refactor: Code Refactoring - header: - pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" - pattern_maps: - - Type - - Scope - - Subject - notes: - keywords: - - BREAKING CHANGE \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 80904f91..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,53 +0,0 @@ -# name of the action -name: release - -# trigger on push events with `v*` in tag -# ignore push events with `v*-rc*` in tag -on: - push: - tags: - - 'v*' - - '!v*-rc*' - -# pipeline to execute -jobs: - release: - runs-on: ubuntu-latest - container: - image: golang:1.17 - steps: - - name: clone - uses: actions/checkout@v3 - - - name: tags - run: | - git fetch --tags - - - name: version - id: version - run: | - echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - - - name: install - run: | - go get github.com/git-chglog/git-chglog/cmd/git-chglog - go get github.com/github-release/github-release - - - name: changelog - run: | - # https://github.com/git-chglog/git-chglog#git-chglog - $(go env GOPATH)/bin/git-chglog \ - -o $GITHUB_WORKSPACE/CHANGELOG.md \ - ${{ steps.version.outputs.VERSION }} - - - name: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # https://github.com/github-release/github-release#how-to-use - $(go env GOPATH)/bin/github-release edit \ - --user go-vela \ - --repo worker \ - --tag ${{ steps.version.outputs.VERSION }} \ - --name ${{ steps.version.outputs.VERSION }} \ - --description "$(cat $GITHUB_WORKSPACE/CHANGELOG.md)" diff --git a/.golangci.yml b/.golangci.yml index 85c783b6..97b6d15a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,27 +28,16 @@ linters-settings: # https://github.com/ultraware/funlen funlen: - lines: 100 - statements: 50 + # accounting for comments + lines: 160 + statements: 70 - # https://github.com/golang/lint - golint: - min-confidence: 0 - - # https://github.com/tommy-muehle/go-mnd - gomnd: - settings: - mnd: - # don't include the "operation" and "assign" - checks: argument,case,condition,return - - # https://github.com/walle/lll - lll: - line-length: 100 - - # https://github.com/mdempsky/maligned - maligned: - suggest-new: true + # https://github.com/denis-tingaikin/go-header + goheader: + template: |- + Copyright (c) {{ YEAR }} Target Brands, Inc. All rights reserved. + + Use of this source code is governed by the LICENSE file in this repository. # https://github.com/client9/misspell misspell: @@ -56,10 +45,10 @@ linters-settings: # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint nolintlint: - allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space) - allow-unused: false # allow nolint directives that don't address a linting issue - require-explanation: true # require an explanation for nolint directives - require-specific: true # require nolint directives to be specific about which linter is being skipped + allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space) + allow-unused: false # allow nolint directives that don't address a linting issue + require-explanation: true # require an explanation for nolint directives + require-specific: true # require nolint directives to be specific about which linter is being skipped # This section provides the configuration for which linters # golangci will execute. Several of them were disabled by @@ -70,58 +59,91 @@ linters: # enable a specific set of linters to run enable: - - bodyclose - - deadcode # enabled by default - - dupl - - errcheck # enabled by default - - funlen - - goconst - - gocyclo - - godot - - gofmt - - goimports - - golint - - gomnd - - goprintffuncname - - gosec - - gosimple # enabled by default - - govet # enabled by default - - ineffassign # enabled by default - - lll - - maligned - - misspell - - nakedret - - nolintlint - - staticcheck # enabled by default - - structcheck # enabled by default - - stylecheck - - typecheck # enabled by default - - unconvert - - unparam - - unused # enabled by default - - varcheck # enabled by default - - whitespace - + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - contextcheck # check the function whether use a non-inherited context + - deadcode # finds unused code + - dupl # code clone detection + - errcheck # checks for unchecked errors + - errorlint # find misuses of errors + - exportloopref # check for exported loop vars + - funlen # detects long functions + - goconst # finds repeated strings that could be replaced by a constant + - gocyclo # computes and checks the cyclomatic complexity of functions + - godot # checks if comments end in a period + - gofmt # checks whether code was gofmt-ed + - goheader # checks is file header matches to pattern + - goimports # fixes imports and formats code in same style as gofmt + - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects code for security problems + - gosimple # linter that specializes in simplifying a code + - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string + - ineffassign # detects when assignments to existing variables aren't used + - makezero # finds slice declarations with non-zero initial length + - misspell # finds commonly misspelled English words in comments + - nakedret # finds naked returns in functions greater than a specified function length + - nilerr # finds the code that returns nil even if it checks that the error is not nil + - noctx # noctx finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives + - revive # linter for go + - staticcheck # applies static analysis checks, go vet on steroids + - structcheck # finds unused struct fields + - stylecheck # replacement for golint + - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 + - typecheck # parses and type-checks go code, like the front-end of a go compiler + - unconvert # remove unnecessary type conversions + - unparam # reports unused function parameters + - unused # checks for unused constants, variables, functions and types + - varcheck # finds unused global variables and constants + - whitespace # detects leading and trailing whitespace + - wsl # forces code to use empty lines + # static list of linters we know golangci can run but we've # chosen to leave disabled for now - # - asciicheck - # - depguard - # - dogsled - # - exhaustive - # - gochecknoinits - # - gochecknoglobals - # - gocognit - # - gocritic - # - godox - # - goerr113 - # - interfacer - # - nestif - # - noctx - # - prealloc - # - rowserrcheck - # - scopelint - # - testpackage - # - wsl + # - asciicheck - non-critical + # - cyclop - unused complexity metric + # - depguard - unused + # - dogsled - blanks allowed + # - durationcheck - unused + # - errname - unused + # - exhaustive - unused + # - exhaustivestruct - style preference + # - forbidigo - unused + # - forcetypeassert - unused + # - gci - use goimports + # - gochecknoinits - unused + # - gochecknoglobals - global variables allowed + # - gocognit - unused complexity metric + # - gocritic - style preference + # - godox - to be used in the future + # - goerr113 - to be used in the future + # - golint - archived, replaced with revive + # - gofumpt - use gofmt + # - gomnd - get too many false-positives + # - gomodguard - unused + # - ifshort - use both styles + # - ireturn - allow interfaces to be returned + # - importas - want flexibility with naming + # - lll - not too concerned about line length + # - interfacer - archived + # - nestif - non-critical + # - nilnil - style preference + # - nlreturn - style preference + # - maligned - archived, replaced with govet 'fieldalignment' + # - paralleltest - false-positives + # - prealloc - don't use + # - predeclared - unused + # - promlinter - style preference + # - rowserrcheck - unused + # - scopelint - deprecated - replaced with exportloopref + # - sqlclosecheck - unused + # - tagliatelle - use a mix of variable naming + # - testpackage - don't use this style of testing + # - thelper - false-positives + # - varnamelen - unused + # - wastedassign - duplicate functionality + # - wrapcheck - style preference # This section provides the configuration for how golangci # will report the issues it finds. @@ -135,5 +157,3 @@ issues: - funlen - goconst - gocyclo - - gomnd - - lll diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 50d70f9d..4f9d0c14 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -17,8 +17,7 @@ import ( // exec is a helper function to poll the queue // and execute Vela pipelines for the Worker. -// -// nolint:funlen // ignore function length due to comments and log messages +// nolint: nilerr // ignore returning nil - don't want to crash worker func (w *Worker) exec(index int) error { var err error diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 53a522d6..4d7b9196 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -19,7 +19,6 @@ import ( // operate is a helper function to initiate all // subprocesses for the operator to poll the // queue and execute Vela pipelines. -// nolint: funlen // ignore function length func (w *Worker) operate(ctx context.Context) error { var err error @@ -63,7 +62,6 @@ func (w *Worker) operate(ctx context.Context) error { // if unable to update the worker, log the error but allow the worker to continue running if err != nil { - // nolint: lll // ignore long line length due to error message logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) } @@ -107,6 +105,7 @@ func (w *Worker) operate(ctx context.Context) error { return nil default: // exec operator subprocess to poll and execute builds + // nolint: contextcheck // ignore passing context err = w.exec(id) if err != nil { // log the error received from the executor diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index e147b83a..8c40d9b2 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -16,9 +16,10 @@ import ( func (w *Worker) checkIn(config *library.Worker) error { // check to see if the worker already exists in the database logrus.Infof("retrieving worker %s from the server", config.GetHostname()) + _, resp, err := w.VelaClient.Worker.Get(config.GetHostname()) if err != nil { - respErr := fmt.Errorf("unable to retrieve worker %s from the server: %v", config.GetHostname(), err) + respErr := fmt.Errorf("unable to retrieve worker %s from the server: %w", config.GetHostname(), err) if resp == nil { return respErr } @@ -32,9 +33,10 @@ func (w *Worker) checkIn(config *library.Worker) error { // if we were able to GET the worker, update it logrus.Infof("checking worker %s into the server", config.GetHostname()) + _, _, err = w.VelaClient.Worker.Update(config.GetHostname(), config) if err != nil { - return fmt.Errorf("unable to update worker %s on the server: %v", config.GetHostname(), err) + return fmt.Errorf("unable to update worker %s on the server: %w", config.GetHostname(), err) } return nil @@ -43,10 +45,11 @@ func (w *Worker) checkIn(config *library.Worker) error { // register is a helper function to register the worker with the server. func (w *Worker) register(config *library.Worker) error { logrus.Infof("worker %s not found, registering it with the server", config.GetHostname()) + _, _, err := w.VelaClient.Worker.Add(config) if err != nil { // log the error instead of returning so the operation doesn't block worker deployment - return fmt.Errorf("unable to register worker %s with the server: %v", config.GetHostname(), err) + return fmt.Errorf("unable to register worker %s with the server: %w", config.GetHostname(), err) } // successfully added the worker so return nil diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index e519531d..76ecb8a8 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -23,8 +23,6 @@ import ( // run executes the worker based // off the configuration provided. -// -// nolint: funlen // ignore function length due to comments func run(c *cli.Context) error { // set log format for the worker switch c.String("log.format") { diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 876c8064..ee79aa95 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -47,6 +47,7 @@ func (w *Worker) server() (http.Handler, bool) { if err != nil { logrus.Fatalf("expecting certificate file at %s, got %v", w.Config.Certificate.Cert, err) } + _, err = os.Stat(w.Config.Certificate.Key) if err != nil { logrus.Fatalf("expecting certificate key at %s, got %v", w.Config.Certificate.Key, err) @@ -54,6 +55,7 @@ func (w *Worker) server() (http.Handler, bool) { } else { logrus.Fatal("unable to run with TLS: No certificate provided") } + return _server, true } diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 74f8cca5..45422423 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -6,6 +6,7 @@ package main import ( "context" + "errors" "fmt" "net/http" "os" @@ -67,15 +68,14 @@ func (w *Worker) Start() error { var err error logrus.Info("starting worker server") if tls { - // nolint: lll // ignore long line length due to error message - if err := server.ListenAndServeTLS(w.Config.Certificate.Cert, w.Config.Certificate.Key); err != http.ErrServerClosed { + if err := server.ListenAndServeTLS(w.Config.Certificate.Cert, w.Config.Certificate.Key); !errors.Is(err, http.ErrServerClosed) { // log a message indicating the start of the server // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info logrus.Errorf("failing worker server: %v", err) } } else { - if err := server.ListenAndServe(); err != http.ErrServerClosed { + if err := server.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) { // log a message indicating the start of the server // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info diff --git a/executor/context.go b/executor/context.go index f06e77b6..0ee583ab 100644 --- a/executor/context.go +++ b/executor/context.go @@ -54,7 +54,7 @@ func FromGinContext(c *gin.Context) Engine { func WithContext(c context.Context, e Engine) context.Context { // set the executor Engine in the context.Context // - // nolint: golint,staticcheck // ignore using string with context value + // nolint: revive,staticcheck // ignore using string with context value return context.WithValue(c, key, e) } diff --git a/executor/context_test.go b/executor/context_test.go index 790e5ff3..10607ba9 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -55,7 +55,7 @@ func TestExecutor_FromContext(t *testing.T) { want Engine }{ { - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -64,7 +64,7 @@ func TestExecutor_FromContext(t *testing.T) { want: nil, }, { - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -173,7 +173,7 @@ func TestExecutor_WithContext(t *testing.T) { t.Errorf("unable to create linux engine: %v", err) } - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test diff --git a/executor/linux/build.go b/executor/linux/build.go index fa31f65d..5806e06f 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -38,7 +38,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update c.build, _, c.err = c.Vela.Build.Update(c.repo.GetOrg(), c.repo.GetName(), c.build) if c.err != nil { - return fmt.Errorf("unable to upload build state: %v", c.err) + return fmt.Errorf("unable to upload build state: %w", c.err) } // setup the runtime build @@ -73,8 +73,6 @@ func (c *client) CreateBuild(ctx context.Context) error { } // PlanBuild prepares the build for execution. -// -// nolint: funlen // ignore function length due to comments and logging messages func (c *client) PlanBuild(ctx context.Context) error { // defer taking a snapshot of the build // @@ -386,8 +384,6 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // ExecBuild runs a pipeline for a build. -// -// nolint: funlen // ignore function length due to comments and log messages func (c *client) ExecBuild(ctx context.Context) error { // defer an upload of the build // @@ -489,7 +485,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait c.err = stages.Wait() if c.err != nil { - return fmt.Errorf("unable to wait for stages: %v", c.err) + return fmt.Errorf("unable to wait for stages: %w", c.err) } return c.err diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 86279bfb..d690e65e 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -431,7 +431,7 @@ func TestLinux_ExecBuild(t *testing.T) { // in a privileged fashion. err = _runtime.CreateVolume(context.Background(), _pipeline) if err != nil { - t.Errorf("unable to create runtime volume: %w", err) + t.Errorf("unable to create runtime volume: %v", err) } // TODO: hack - remove this diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 50e490ea..71ccd041 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -54,7 +54,7 @@ type ( // New returns an Executor implementation that integrates with a Linux instance. // -// nolint: golint // ignore unexported type as it is intentional +// nolint: revive // ignore unexported type as it is intentional func New(opts ...Opt) (*client, error) { // create new Linux client c := new(client) diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 0d0be10a..ad2c2b25 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -243,7 +243,7 @@ func (s *secretSvc) pull(secret *pipeline.Secret) (*library.Secret, error) { secret.Value = _secret.GetValue() default: - return nil, fmt.Errorf("%s: %s", ErrUnrecognizedSecretType, secret.Type) + return nil, fmt.Errorf("%w: %s", ErrUnrecognizedSecretType, secret.Type) } return _secret, nil @@ -303,8 +303,6 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { logs.Write(append(scanner.Bytes(), []byte("\n")...)) // if we have at least 1000 bytes in our buffer - // - // nolint: gomnd // ignore magic number if logs.Len() > 1000 { logger.Trace(logs.String()) @@ -317,7 +315,6 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // send API call to append the logs for the init step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep - // nolint: lll // skip line length due to variable names _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), s.client.init.Number, _log) if err != nil { return err diff --git a/executor/linux/service.go b/executor/linux/service.go index cfd49eae..66fa3309 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -230,13 +230,11 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // create new buffer for uploading logs logs := new(bytes.Buffer) - // nolint: dupl // ignore similar code with step switch c.logMethod { case "time-chunks": // create new channel for processing logs done := make(chan bool) - // nolint: dupl // ignore similar code go func() { logger.Debug("polling logs for container") @@ -322,8 +320,6 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err logs.Write(append(scanner.Bytes(), []byte("\n")...)) // if we have at least 1000 bytes in our buffer - // - // nolint: gomnd // ignore magic number if logs.Len() > 1000 { logger.Trace(logs.String()) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 21b738f0..b52b5f82 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -151,6 +151,7 @@ func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField logger := c.Logger.WithField("stage", s.Name) + var err error // destroy the steps for the stage diff --git a/executor/linux/step.go b/executor/linux/step.go index 3e76677b..f823aede 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -273,13 +273,11 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // create new buffer for uploading logs logs := new(bytes.Buffer) - // nolint: dupl // ignore similar code with service switch c.logMethod { case "time-chunks": // create new channel for processing logs done := make(chan bool) - // nolint: dupl // ignore similar code go func() { logger.Debug("polling logs for container") @@ -370,8 +368,6 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error logs.Write(append(scanner.Bytes(), []byte("\n")...)) // if we have at least 1000 bytes in our buffer - // - // nolint: gomnd // ignore magic number if logs.Len() > 1000 { logger.Trace(logs.String()) @@ -474,5 +470,6 @@ func getSecretValues(ctn *pipeline.Container) []string { secretValues = append(secretValues, strings.TrimSuffix(s, " ")) } + return secretValues } diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 9ce32591..ace74ba0 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -531,6 +531,7 @@ func TestLinux_getSecretValues(t *testing.T) { if err != nil { t.Errorf("unable to read from test data file secret. Err: %v", err) } + tests := []struct { want []string container *pipeline.Container diff --git a/executor/local/build.go b/executor/local/build.go index 312ba8c8..488bc931 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -133,8 +133,6 @@ func (c *client) PlanBuild(ctx context.Context) error { } // AssembleBuild prepares the containers within a build for execution. -// -// nolint: funlen // ignore function length due to comments func (c *client) AssembleBuild(ctx context.Context) error { // defer taking a snapshot of the build // @@ -340,7 +338,7 @@ func (c *client) ExecBuild(ctx context.Context) error { // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group.Wait c.err = stages.Wait() if c.err != nil { - return fmt.Errorf("unable to wait for stages: %v", c.err) + return fmt.Errorf("unable to wait for stages: %w", c.err) } return c.err diff --git a/executor/local/local.go b/executor/local/local.go index c922a1af..6674931a 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -35,7 +35,7 @@ type ( // New returns an Executor implementation that integrates with the local system. // -// nolint: golint // ignore unexported type as it is intentional +// nolint: revive // ignore unexported type as it is intentional func New(opts ...Opt) (*client, error) { // create new local client c := new(client) diff --git a/executor/local/step_test.go b/executor/local/step_test.go index 6d94dbc2..c6dad3b4 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 1011 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/internal/service/environment.go b/internal/service/environment.go index 312f686a..53051edc 100644 --- a/internal/service/environment.go +++ b/internal/service/environment.go @@ -14,8 +14,6 @@ import ( // Environment attempts to update the environment variables // for the container based off the library resources. -// -// nolint: lll // ignore long line length due to parameters func Environment(c *pipeline.Container, b *library.Build, r *library.Repo, s *library.Service, version string) error { // check if container or container environment are empty if c == nil || c.Environment == nil { diff --git a/internal/service/snapshot.go b/internal/service/snapshot.go index 9a99f477..c42e03b1 100644 --- a/internal/service/snapshot.go +++ b/internal/service/snapshot.go @@ -17,8 +17,6 @@ import ( // Snapshot creates a moment in time record of the // service and attempts to upload it to the server. -// -// nolint: lll // ignore long line length due to parameters func Snapshot(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Service) { // check if the build is not in a canceled status if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { diff --git a/internal/service/upload.go b/internal/service/upload.go index cb3108fb..40eac48b 100644 --- a/internal/service/upload.go +++ b/internal/service/upload.go @@ -16,8 +16,6 @@ import ( // Upload tracks the final state of the service // and attempts to upload it to the server. -// -// nolint: lll // ignore long line length due to parameters func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Service) { // handle the service based off the status provided switch s.GetStatus() { @@ -41,8 +39,6 @@ func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus // SHOULD NOT happen // // TODO: consider making this a constant - // - // nolint: gomnd // ignore magic number 137 s.SetExitCode(137) s.SetFinished(time.Now().UTC().Unix()) s.SetStatus(constants.StatusKilled) diff --git a/internal/step/environment.go b/internal/step/environment.go index bff3cff9..057004b9 100644 --- a/internal/step/environment.go +++ b/internal/step/environment.go @@ -14,8 +14,6 @@ import ( // Environment attempts to update the environment variables // for the container based off the library resources. -// -// nolint: lll // ignore long line length due to parameters func Environment(c *pipeline.Container, b *library.Build, r *library.Repo, s *library.Step, version string) error { // check if container or container environment are empty if c == nil || c.Environment == nil { diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go index a426b4cb..92c030ec 100644 --- a/internal/step/snapshot.go +++ b/internal/step/snapshot.go @@ -17,8 +17,6 @@ import ( // Snapshot creates a moment in time record of the // step and attempts to upload it to the server. -// -// nolint: lll // ignore long line length due to parameters func Snapshot(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step) { // check if the build is not in a canceled status if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { @@ -67,8 +65,6 @@ func Snapshot(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logr // SnapshotInit creates a moment in time record of the // init step and attempts to upload it to the server. -// -// nolint: lll // ignore long line length due to parameters func SnapshotInit(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step, lg *library.Log) { // check if the build is not in a canceled status if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { diff --git a/internal/step/upload.go b/internal/step/upload.go index 47e36390..3a917dc5 100644 --- a/internal/step/upload.go +++ b/internal/step/upload.go @@ -16,8 +16,6 @@ import ( // Upload tracks the final state of the step // and attempts to upload it to the server. -// -// nolint: lll // ignore long line length due to parameters func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus.Entry, r *library.Repo, s *library.Step) { // handle the step based off the status provided switch s.GetStatus() { @@ -41,8 +39,6 @@ func Upload(ctn *pipeline.Container, b *library.Build, c *vela.Client, l *logrus // SHOULD NOT happen // // TODO: consider making this a constant - // - // nolint: gomnd // ignore magic number 137 s.SetExitCode(137) s.SetFinished(time.Now().UTC().Unix()) s.SetStatus(constants.StatusKilled) diff --git a/internal/volume/volume.go b/internal/volume/volume.go index ad18c647..697a4524 100644 --- a/internal/volume/volume.go +++ b/internal/volume/volume.go @@ -48,7 +48,6 @@ func ParseWithError(_volume string) (*Volume, error) { Destination: parts[0], AccessMode: "ro", }, nil - // nolint: gomnd // ignore magic number case 2: // return the read-only volume with different source and destination return &Volume{ @@ -56,7 +55,6 @@ func ParseWithError(_volume string) (*Volume, error) { Destination: parts[1], AccessMode: "ro", }, nil - // nolint: gomnd // ignore magic number case 3: // return the full volume with source, destination and access mode return &Volume{ diff --git a/mock/docker/config.go b/mock/docker/config.go index e7786e2b..e1d2878e 100644 --- a/mock/docker/config.go +++ b/mock/docker/config.go @@ -2,6 +2,7 @@ // // Use of this source code is governed by the LICENSE file in this repository. +// nolint: dupl // ignore similar code package docker import ( diff --git a/mock/docker/container.go b/mock/docker/container.go index 32d0d2ac..d17c1ab7 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -63,7 +63,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe if strings.Contains(ctn, "notfound") && !strings.Contains(ctn, "ignorenotfound") { return container.ContainerCreateCreatedBody{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -72,7 +72,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe if strings.Contains(ctn, "not-found") && !strings.Contains(ctn, "ignore-not-found") { return container.ContainerCreateCreatedBody{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -81,7 +81,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe strings.Contains(config.Image, "not-found") { return container.ContainerCreateCreatedBody{}, errdefs.NotFound( - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", config.Image), ) } @@ -172,7 +172,7 @@ func (c *ContainerService) ContainerInspect(ctx context.Context, ctn string) (ty if strings.Contains(ctn, "notfound") && !strings.Contains(ctn, "ignorenotfound") { return types.ContainerJSON{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -181,7 +181,7 @@ func (c *ContainerService) ContainerInspect(ctx context.Context, ctn string) (ty if strings.Contains(ctn, "not-found") && !strings.Contains(ctn, "ignore-not-found") { return types.ContainerJSON{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -217,7 +217,7 @@ func (c *ContainerService) ContainerInspectWithRaw(ctx context.Context, ctn stri strings.Contains(ctn, "not-found") { return types.ContainerJSON{}, nil, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -256,7 +256,7 @@ func (c *ContainerService) ContainerKill(ctx context.Context, ctn, signal string // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -285,7 +285,7 @@ func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, option // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages return nil, errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -331,7 +331,7 @@ func (c *ContainerService) ContainerRemove(ctx context.Context, ctn string, opti // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -375,7 +375,7 @@ func (c *ContainerService) ContainerStart(ctx context.Context, ctn string, optio // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -412,7 +412,7 @@ func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, timeou // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -464,7 +464,7 @@ func (c *ContainerService) ContainerWait(ctx context.Context, ctn string, condit // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { // propagate the error to the error channel - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errCh <- errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) return ctnCh, errCh diff --git a/mock/docker/docker.go b/mock/docker/docker.go index 3528846e..5b6a0604 100644 --- a/mock/docker/docker.go +++ b/mock/docker/docker.go @@ -23,7 +23,6 @@ const Version = "v1.40" // New returns a client that is capable of handling // Docker client calls and returning stub responses. -// nolint:golint // returning unexported type intentionally func New() (*mock, error) { return &mock{ ConfigService: ConfigService{}, diff --git a/mock/docker/image.go b/mock/docker/image.go index eecd81ab..887d399a 100644 --- a/mock/docker/image.go +++ b/mock/docker/image.go @@ -90,7 +90,7 @@ func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (t return types.ImageInspect{}, nil, errdefs.NotFound( - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } @@ -165,7 +165,7 @@ func (i *ImageService) ImagePull(ctx context.Context, image string, options type !strings.Contains(image, "ignorenotfound") { return nil, errdefs.NotFound( - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } @@ -176,7 +176,7 @@ func (i *ImageService) ImagePull(ctx context.Context, image string, options type !strings.Contains(image, "ignore-not-found") { return nil, errdefs.NotFound( - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } diff --git a/mock/docker/network.go b/mock/docker/network.go index 9ec142c0..a82b8ef7 100644 --- a/mock/docker/network.go +++ b/mock/docker/network.go @@ -47,7 +47,7 @@ func (n *NetworkService) NetworkCreate(ctx context.Context, name string, options if strings.Contains(name, "notfound") && !strings.Contains(name, "ignorenotfound") { return types.NetworkCreateResponse{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) } @@ -56,7 +56,7 @@ func (n *NetworkService) NetworkCreate(ctx context.Context, name string, options if strings.Contains(name, "not-found") && !strings.Contains(name, "ignore-not-found") { return types.NetworkCreateResponse{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) } @@ -89,14 +89,14 @@ func (n *NetworkService) NetworkInspect(ctx context.Context, network string, opt // check if the network is notfound if strings.Contains(network, "notfound") { return types.NetworkResource{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) } // check if the network is not-found if strings.Contains(network, "not-found") { return types.NetworkResource{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) } diff --git a/mock/docker/secret.go b/mock/docker/secret.go index 88059c22..ca5286c0 100644 --- a/mock/docker/secret.go +++ b/mock/docker/secret.go @@ -2,6 +2,7 @@ // // Use of this source code is governed by the LICENSE file in this repository. +// nolint: dupl // ignore similar code package docker import ( diff --git a/mock/docker/volume.go b/mock/docker/volume.go index db64c804..18bb14e8 100644 --- a/mock/docker/volume.go +++ b/mock/docker/volume.go @@ -39,7 +39,7 @@ func (v *VolumeService) VolumeCreate(ctx context.Context, options volume.VolumeC if strings.Contains(options.Name, "notfound") && !strings.Contains(options.Name, "ignorenotfound") { return types.Volume{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) } @@ -48,7 +48,7 @@ func (v *VolumeService) VolumeCreate(ctx context.Context, options volume.VolumeC if strings.Contains(options.Name, "not-found") && !strings.Contains(options.Name, "ignore-not-found") { return types.Volume{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) } @@ -79,14 +79,14 @@ func (v *VolumeService) VolumeInspect(ctx context.Context, volumeID string) (typ // check if the volume is notfound if strings.Contains(volumeID, "notfound") { return types.Volume{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } // check if the volume is not-found if strings.Contains(volumeID, "not-found") { return types.Volume{}, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } @@ -116,14 +116,14 @@ func (v *VolumeService) VolumeInspectWithRaw(ctx context.Context, volumeID strin // check if the volume is notfound if strings.Contains(volumeID, "notfound") { return types.Volume{}, nil, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } // check if the volume is not-found if strings.Contains(volumeID, "not-found") { return types.Volume{}, nil, - // nolint:golint,stylecheck // messsage is capitalized to match Docker messages + // nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index f58682d9..b8e3d65c 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -64,6 +64,7 @@ func Establish() gin.HandlerFunc { } logrus.Debugf("Reading executor %s", param) + e, ok := executors[number] if !ok { msg := fmt.Sprintf("unable to get executor %s", param) diff --git a/router/middleware/header.go b/router/middleware/header.go index 5a7d8519..57eedcce 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -40,6 +40,8 @@ func Options(c *gin.Context) { // Secure is a middleware function that appends security // and resource access headers. func Secure(c *gin.Context) { + // Also consider adding Content-Security-Policy headers + // c.Header("Content-Security-Policy", "script-src 'self' https://cdnjs.cloudflare.com") c.Header("Access-Control-Allow-Origin", "*") c.Header("X-Frame-Options", "DENY") c.Header("X-Content-Type-Options", "nosniff") @@ -48,9 +50,6 @@ func Secure(c *gin.Context) { if c.Request.TLS != nil { c.Header("Strict-Transport-Security", "max-age=31536000") } - - // Also consider adding Content-Security-Policy headers - // c.Header("Content-Security-Policy", "script-src 'self' https://cdnjs.cloudflare.com") } // RequestVersion is a middleware function that injects the Vela API version diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 754e401a..b9431515 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -29,6 +29,7 @@ func Logger(logger *logrus.Logger, timeFormat string, utc bool) gin.HandlerFunc end := time.Now() latency := end.Sub(start) + if utc { end = end.UTC() } diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index ee989c2d..135d452c 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -26,10 +26,12 @@ func MustServer() gin.HandlerFunc { } msg := fmt.Sprintf("User %s is not a platform admin", u.GetName()) + err := c.Error(fmt.Errorf(msg)) if err != nil { logrus.Error(err) } + c.AbortWithStatusJSON(http.StatusUnauthorized, types.Error{Message: &msg}) } } diff --git a/router/middleware/token/token_test.go b/router/middleware/token/token_test.go index 98a5ac7f..5dc5f3ee 100644 --- a/router/middleware/token/token_test.go +++ b/router/middleware/token/token_test.go @@ -5,6 +5,7 @@ package token import ( + "context" "fmt" "net/http" "strings" @@ -16,7 +17,7 @@ func TestToken_Retrieve(t *testing.T) { want := "foobar" header := fmt.Sprintf("Bearer %s", want) - request, _ := http.NewRequest(http.MethodGet, "/test", nil) + request, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "/test", nil) request.Header.Set("Authorization", header) // run test @@ -32,7 +33,7 @@ func TestToken_Retrieve(t *testing.T) { func TestToken_Retrieve_Error(t *testing.T) { // setup types - request, _ := http.NewRequest(http.MethodGet, "/test", nil) + request, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "/test", nil) // run test got, err := Retrieve(request) diff --git a/router/pipeline.go b/router/pipeline.go index a738b6f0..59b406ee 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -1,6 +1,6 @@ // Copyright (c) 2022 Target Brands, Inc. All rights reserved. // -// Use of this source code is governed by the LICENSE file in this pipelinesitory. +// Use of this source code is governed by the LICENSE file in this repository. package router diff --git a/runtime/context.go b/runtime/context.go index 88c08303..0579fe60 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -54,7 +54,7 @@ func FromGinContext(c *gin.Context) Engine { func WithContext(c context.Context, e Engine) context.Context { // set the runtime Engine in the context.Context // - // nolint: golint,staticcheck // ignore using string with context value + // nolint: revive,staticcheck // ignore using string with context value return context.WithValue(c, key, e) } diff --git a/runtime/context_test.go b/runtime/context_test.go index 9621cad7..6145d73f 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -29,7 +29,7 @@ func TestRuntime_FromContext(t *testing.T) { want Engine }{ { - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -38,7 +38,7 @@ func TestRuntime_FromContext(t *testing.T) { want: nil, }, { - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -109,7 +109,7 @@ func TestRuntime_WithContext(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } - // nolint: golint,staticcheck // ignore using string with context value + // nolint: staticcheck // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 870360bc..9f5106ec 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -89,8 +89,6 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e } // RunContainer creates and starts the pipeline container. -// -// nolint: lll // ignore long line length due to variable names func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { c.Logger.Tracef("running container %s", ctn.ID) @@ -235,8 +233,6 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er } // TailContainer captures the logs for the pipeline container. -// -// nolint: lll // ignore long line length due to variable names func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { c.Logger.Tracef("tailing output for container %s", ctn.ID) diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index 6b13a443..c286c31f 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -45,7 +45,7 @@ type client struct { // New returns an Engine implementation that // integrates with a Docker runtime. // -// nolint: golint // ignore returning unexported client +// nolint: revive // ignore returning unexported client func New(opts ...ClientOpt) (*client, error) { // create new Docker client c := new(client) @@ -98,7 +98,7 @@ func New(opts ...ClientOpt) (*client, error) { // // This function is intended for running tests only. // -// nolint: golint // ignore returning unexported client +// nolint: revive // ignore returning unexported client func NewMock(opts ...ClientOpt) (*client, error) { // create new Docker runtime client c, err := New(opts...) diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index 3b2c5f74..d2fa7171 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -65,6 +65,7 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { // before running AssembleBuild. func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { c.Logger.Tracef("assembling build %s", b.ID) + var err error // last minute Environment setup @@ -74,11 +75,13 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { return err } } + for _, _stage := range b.Stages { // TODO: remove hardcoded reference if _stage.Name == "init" { continue } + for _, _step := range _stage.Steps { err = c.setupContainerEnvironment(_step) if err != nil { @@ -86,20 +89,24 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { } } } + for _, _step := range b.Steps { // TODO: remove hardcoded reference if _step.Name == "init" { continue } + err = c.setupContainerEnvironment(_step) if err != nil { return err } } + for _, _secret := range b.Secrets { if _secret.Origin.Empty() { continue } + err = c.setupContainerEnvironment(_secret.Origin) if err != nil { return err @@ -115,6 +122,7 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { // send API call to create the pod // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + // nolint: contextcheck // ignore non-inherited new context _, err = c.Kubernetes.CoreV1(). Pods(c.config.Namespace). Create(context.Background(), c.Pod, metav1.CreateOptions{}) @@ -155,6 +163,7 @@ func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { c.Logger.Infof("removing pod %s", c.Pod.ObjectMeta.Name) // send API call to delete the pod + // nolint: contextcheck // ignore non-inherited new context err := c.Kubernetes.CoreV1(). Pods(c.config.Namespace). Delete(context.Background(), c.Pod.ObjectMeta.Name, opts) diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 8dbea5cc..bec9ac11 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -135,6 +135,7 @@ func TestKubernetes_AssembleBuild(t *testing.T) { for _, test := range tests { _engine, err := NewMock(test.k8sPod) _engine.Pod = test.enginePod + if err != nil { t.Errorf("unable to create runtime engine: %v", err) } @@ -207,10 +208,10 @@ func TestKubernetes_RemoveBuild(t *testing.T) { if err != nil { t.Errorf("unable to create runtime engine: %v", err) } + _engine.createdPod = test.createdPod err = _engine.RemoveBuild(context.Background(), test.pipeline) - if test.failure { if err == nil { t.Errorf("RemoveBuild should have returned err") diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 752c7316..87f68cef 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -33,6 +33,7 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // send API call to capture the container // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + // nolint: contextcheck // ignore non-inherited new context pod, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Get( context.Background(), c.Pod.ObjectMeta.Name, @@ -70,8 +71,6 @@ func (c *client) RemoveContainer(ctx context.Context, ctn *pipeline.Container) e } // RunContainer creates and starts the pipeline container. -// -// nolint: lll // ignore long line length func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *pipeline.Build) error { c.Logger.Tracef("running container %s", ctn.ID) // parse image from step @@ -87,6 +86,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // send API call to patch the pod with the new container image // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface + // nolint: contextcheck // ignore non-inherited new context _, err = c.Kubernetes.CoreV1().Pods(c.config.Namespace).Patch( context.Background(), c.Pod.ObjectMeta.Name, @@ -156,6 +156,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er if err != nil { return err } + container.VolumeMounts = volumeMounts // check if the image is allowed to run privileged @@ -215,12 +216,11 @@ func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { container.Env = append(container.Env, v1.EnvVar{Name: k, Value: v}) } } + return nil } // TailContainer captures the logs for the pipeline container. -// -// nolint: lll // ignore long line length due to variable names func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { c.Logger.Tracef("tailing output for container %s", ctn.ID) @@ -264,10 +264,9 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io reader := bufio.NewReader(stream) // peek at container logs from the stream - // - // nolint: gomnd // ignore magic number bytes, err := reader.Peek(5) if err != nil { + // nolint: nilerr // ignore nil return // skip so we resend API call to capture stream return false, nil } @@ -325,6 +324,7 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface // -> // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface + // nolint: contextcheck // ignore non-inherited new context watch, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Watch(context.Background(), opts) if err != nil { return err diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index 0fe98dd2..c0f88dc9 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -42,7 +42,6 @@ func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]b // // create output for inspecting image output := []byte( - // nolint: lll // ignore line length due to string formatting with parameters fmt.Sprintf("$ kubectl get pod -o=jsonpath='{.spec.containers[%d].image}' %s\n", ctn.Number, ctn.ID), ) diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 34818d01..99b27cf0 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -42,7 +42,7 @@ type client struct { // New returns an Engine implementation that // integrates with a Kubernetes runtime. // -// nolint: golint // ignore returning unexported client +// nolint: revive // ignore returning unexported client func New(opts ...ClientOpt) (*client, error) { // create new Kubernetes client c := new(client) @@ -77,6 +77,7 @@ func New(opts ...ClientOpt) (*client, error) { config *rest.Config err error ) + if c.config.File == "" { // https://pkg.go.dev/k8s.io/client-go/rest?tab=doc#InClusterConfig config, err = rest.InClusterConfig() @@ -111,7 +112,7 @@ func New(opts ...ClientOpt) (*client, error) { // // This function is intended for running tests only. // -// nolint: golint // ignore returning unexported client +// nolint: revive // ignore returning unexported client func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { // create new Kubernetes client c := new(client) diff --git a/runtime/kubernetes/network.go b/runtime/kubernetes/network.go index 7c3ee37c..81ccfac1 100644 --- a/runtime/kubernetes/network.go +++ b/runtime/kubernetes/network.go @@ -18,7 +18,6 @@ import ( func (c *client) CreateNetwork(ctx context.Context, b *pipeline.Build) error { c.Logger.Tracef("creating network for pipeline %s", b.ID) - // nolint: lll // ignore long line length due to link // create the network for the pod // // This is done due to the nature of how networking works inside the diff --git a/version/version.go b/version/version.go index 3368f7a6..30312ee2 100644 --- a/version/version.go +++ b/version/version.go @@ -34,7 +34,7 @@ var ( func New() *version.Version { // check if a semantic tag was provided if len(Tag) == 0 { - logrus.Warningf("no semantic tag provided - defaulting to v0.0.0") + logrus.Warning("no semantic tag provided - defaulting to v0.0.0") // set a fallback default for the tag Tag = "v0.0.0" @@ -42,7 +42,7 @@ func New() *version.Version { v, err := semver.NewVersion(Tag) if err != nil { - fmt.Println(fmt.Errorf("unable to parse semantic version for %s: %v", Tag, err)) + fmt.Println(fmt.Errorf("unable to parse semantic version for %s: %w", Tag, err)) } return &version.Version{ From 8dfd7fdcaae8345a6097930a97e4bc75309ffe2a Mon Sep 17 00:00:00 2001 From: DaxJohnson Date: Wed, 9 Mar 2022 12:05:13 -0600 Subject: [PATCH 251/430] chore(dep): update containerd to 1.4.13 (#283) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8c81b7a1..39bd2604 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/alicebob/miniredis/v2 v2.18.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/containerd/containerd v1.4.8 // indirect + github.com/containerd/containerd v1.4.13 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index d785ca93..78214665 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/containerd/containerd v1.4.8 h1:H0wkS4AbVKTg9vyvBdCBrxoax8AMObKbNz9Fl2N0i4Y= -github.com/containerd/containerd v1.4.8/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.13 h1:Z0CbagVdn9VN4K6htOCY/jApSw8YKP+RdLZ5dkXF8PM= +github.com/containerd/containerd v1.4.13/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= From a769eb5a41e618f619c7b514b99c8bcc404bb9c8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Mar 2022 14:32:34 -0600 Subject: [PATCH 252/430] fix(deps): update module github.com/docker/distribution to v2.8.1 (#284) Co-authored-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 39bd2604..bde4b66b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 - github.com/docker/distribution v2.8.0+incompatible + github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 diff --git a/go.sum b/go.sum index 78214665..2e16c0c3 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,8 @@ 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= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/docker/distribution v2.8.0+incompatible h1:l9EaZDICImO1ngI+uTifW+ZYvvz7fKISBAKpg+MbWbY= -github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= +github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= From 9856b9b69e94e5c4e566cd27042bb6eb5bd2e5d2 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:21:15 -0600 Subject: [PATCH 253/430] chore: release v0.13.0-rc1 (#285) --- go.mod | 18 +++++++++--------- go.sum | 58 ++++++++++++++++++++++++++++------------------------------ 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index bde4b66b..e76e954e 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.12.0 - github.com/go-vela/server v0.12.1 - github.com/go-vela/types v0.12.0 + github.com/go-vela/sdk-go v0.13.0-rc1 + github.com/go-vela/server v0.13.0-rc1 + github.com/go-vela/types v0.13.0-rc1 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -51,7 +51,7 @@ require ( github.com/go-playground/validator/v10 v10.4.1 // indirect github.com/go-redis/redis/v8 v8.11.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.2.0 // indirect + github.com/golang-jwt/jwt/v4 v4.3.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v42 v42.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -81,17 +81,17 @@ require ( github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/spf13/afero v1.8.0 // indirect + github.com/spf13/afero v1.8.1 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.1.11 // indirect github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect - go.starlark.net v0.0.0-20211203141949-70c0e40ae128 // indirect + go.starlark.net v0.0.0-20220302181546-5411bad688d1 // indirect golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect - golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 2e16c0c3..c49eab1f 100644 --- a/go.sum +++ b/go.sum @@ -84,7 +84,7 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.42.44/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= +github.com/aws/aws-sdk-go v1.43.10/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -200,20 +200,19 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.12.0 h1:McLqz6IVXeApO4/SWmmfsGzeqdU1NcR8LqYauDKJxos= -github.com/go-vela/sdk-go v0.12.0/go.mod h1:C0N4UOx7jz1bYu2Du48ns0uxPbZBidcac8jc4eOyON4= -github.com/go-vela/server v0.12.0/go.mod h1:+ebwdqxI6HnRpbfMYAyxOaQOAeHE0VhXETukhzH/cLk= -github.com/go-vela/server v0.12.1 h1:IWZhD5eE8m2sHuM/AY9VifZ1uDUYJa8h8hU9YUwa/CY= -github.com/go-vela/server v0.12.1/go.mod h1:+ebwdqxI6HnRpbfMYAyxOaQOAeHE0VhXETukhzH/cLk= -github.com/go-vela/types v0.12.0 h1:RnliZ5sZ0ceDRNyjp8o5uPKMIgLF7Gd7JRJWgOLgOPw= -github.com/go-vela/types v0.12.0/go.mod h1:nMZJ/0tb0HO8/AVaJXHuR5slG9UPuP9or+CnkuyFcL4= +github.com/go-vela/sdk-go v0.13.0-rc1 h1:GvmEs0T3ePVN5t9RfD0fABPWo4P/YXkrliuVYuBv19c= +github.com/go-vela/sdk-go v0.13.0-rc1/go.mod h1:4LWFl8oouiS7CpVpUH9Oi1y0RHJpSJRD+wnaA2jKGGE= +github.com/go-vela/server v0.13.0-rc1 h1:BWSx+V1fkC/Yz2P7DoUFqqDp2TPpP4x+13Xg0tBTu/0= +github.com/go-vela/server v0.13.0-rc1/go.mod h1:F2CFqqo2maVAhB3yyg3Do+f3T9ihxFsVFBko/bP1yyk= +github.com/go-vela/types v0.13.0-rc1 h1:y4A5R/zbjlz/XXdwDE7iOdl+/6hgB0B/jVz9LFDfznw= +github.com/go-vela/types v0.13.0-rc1/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -343,8 +342,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.3.1/go.mod h1:QeJoWxMFt+MsuWcYhmwRLwKEXrjwAFFywzhptMsTIUw= -github.com/hashicorp/vault/sdk v0.3.0/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= +github.com/hashicorp/vault/api v1.4.1/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= +github.com/hashicorp/vault/sdk v0.4.1/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -383,12 +382,12 @@ github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01C github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.14.0/go.mod h1:jT3ibf/A0ZVCp89rtCIN0zCJxcE74ypROmHEZYsG/j8= +github.com/jackc/pgx/v4 v4.14.1/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -396,7 +395,6 @@ github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -456,7 +454,7 @@ github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.17/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= +github.com/microcosm-cc/bluemonday v1.0.18/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -566,8 +564,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= -github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.8.1 h1:izYHOT71f9iZ7iq37Uqjael60/vYC6vMtzedudZ0zEk= +github.com/spf13/afero v1.8.1/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -611,8 +609,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20211203141949-70c0e40ae128 h1:bxH+EXOo87zEOwKDdZ8Tevgi6irRbqheRm/fr293c58= -go.starlark.net v0.0.0-20211203141949-70c0e40ae128/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20220302181546-5411bad688d1 h1:i0Sz4b+qJi5xwOaFZqZ+RNHkIpaKLDofei/Glt+PMNc= +go.starlark.net v0.0.0-20220302181546-5411bad688d1/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -723,8 +721,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -738,8 +736,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -819,12 +817,14 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/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 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1047,10 +1047,9 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.2.3/go.mod h1:pJV6RgYQPG47aM1f0QeOzFH9HxQc8JcmAgjRCgS0wjs= -gorm.io/driver/sqlite v1.2.6/go.mod h1:gyoX0vHiiwi0g49tv+x2E7l8ksauLK0U/gShcdUsjWY= -gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gorm.io/gorm v1.22.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= +gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= @@ -1063,7 +1062,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= From a031e9dcec9fc509a55b74695a63573bf9d9471a Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 15 Mar 2022 08:31:25 -0500 Subject: [PATCH 254/430] refactor(logs): Replace "Pulling" with "Preparing" in init step logs (#287) --- executor/linux/build.go | 10 +++++----- executor/linux/stage.go | 2 +- executor/local/build.go | 6 +++--- executor/local/stage.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index 5806e06f..2b5ba4a1 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -151,7 +151,7 @@ func (c *client) PlanBuild(ctx context.Context) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte("> Pulling secrets...\n")) + _log.AppendData([]byte("> Preparing secrets...\n")) // iterate through each secret provided in the pipeline for _, secret := range c.pipeline.Secrets { @@ -231,7 +231,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte("> Pulling service images...\n")) + _log.AppendData([]byte("> Preparing service images...\n")) // create the services for the pipeline for _, s := range c.pipeline.Services { @@ -262,7 +262,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte("> Pulling stage images...\n")) + _log.AppendData([]byte("> Preparing stage images...\n")) // create the stages for the pipeline for _, s := range c.pipeline.Stages { @@ -284,7 +284,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte("> Pulling step images...\n")) + _log.AppendData([]byte("> Preparing step images...\n")) // create the steps for the pipeline for _, s := range c.pipeline.Steps { @@ -317,7 +317,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte("> Pulling secret images...\n")) + _log.AppendData([]byte("> Preparing secret images...\n")) // create the secrets for the pipeline for _, s := range c.pipeline.Secrets { diff --git a/executor/linux/stage.go b/executor/linux/stage.go index b52b5f82..ddab1b86 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -31,7 +31,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { // update the init log with progress // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData([]byte(fmt.Sprintf("> Pulling step images for stage %s...\n", s.Name))) + _log.AppendData([]byte(fmt.Sprintf("> Preparing step images for stage %s...\n", s.Name))) // create the steps for the stage for _, _step := range s.Steps { diff --git a/executor/local/build.go b/executor/local/build.go index 488bc931..21c3efaf 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -162,7 +162,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Pulling service images...") + fmt.Fprintln(os.Stdout, _pattern, "> Preparing service images...") // create the services for the pipeline for _, _service := range c.pipeline.Services { @@ -187,7 +187,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Pulling stage images...") + fmt.Fprintln(os.Stdout, _pattern, "> Preparing stage images...") // create the stages for the pipeline for _, _stage := range c.pipeline.Stages { @@ -206,7 +206,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Pulling step images...") + fmt.Fprintln(os.Stdout, _pattern, "> Preparing step images...") // create the steps for the pipeline for _, _step := range c.pipeline.Steps { diff --git a/executor/local/stage.go b/executor/local/stage.go index 16d27ee7..668580d1 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -23,7 +23,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { _pattern := fmt.Sprintf(stagePattern, c.init.Name, c.init.Name) // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Pulling step images for stage", s.Name, "...") + fmt.Fprintln(os.Stdout, _pattern, "> Preparing step images for stage", s.Name, "...") // create the steps for the stage for _, _step := range s.Steps { From caf8a9dda016c5df9a3c83783d69f86a12e99791 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 15 Mar 2022 09:09:09 -0500 Subject: [PATCH 255/430] refactor(kubernetes): Refactor watch related code (#288) --- runtime/kubernetes/container.go | 9 ++++-- runtime/kubernetes/container_test.go | 40 +++++---------------------- runtime/kubernetes/kubernetes_test.go | 39 ++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 87f68cef..d40c1a9c 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -19,6 +19,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" ) @@ -311,7 +312,7 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err c.Logger.Tracef("waiting for container %s", ctn.ID) // create label selector for watching the pod - selector := fmt.Sprintf("pipeline=%s", c.Pod.ObjectMeta.Name) + selector := fmt.Sprintf("pipeline=%s", fields.EscapeValue(c.Pod.ObjectMeta.Name)) // create options for watching the container opts := metav1.ListOptions{ @@ -325,16 +326,18 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // -> // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface // nolint: contextcheck // ignore non-inherited new context - watch, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Watch(context.Background(), opts) + podWatch, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Watch(context.Background(), opts) if err != nil { return err } + defer podWatch.Stop() + for { // capture new result from the channel // // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface - result := <-watch.ResultChan() + result := <-podWatch.ResultChan() // convert the object from the result to a pod pod, ok := result.Object.(*v1.Pod) diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 07728893..a7c38442 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -13,9 +13,6 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/fake" - testcore "k8s.io/client-go/testing" ) func TestKubernetes_InspectContainer(t *testing.T) { @@ -225,35 +222,6 @@ func TestKubernetes_TailContainer(t *testing.T) { } func TestKubernetes_WaitContainer(t *testing.T) { - // setup types - _engine, err := NewMock(_pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - - // create a new fake kubernetes client - // - // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset - _kubernetes := fake.NewSimpleClientset(_pod) - - // create a new fake watcher - // - // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#NewFake - _watch := watch.NewFake() - - // create a new watch reactor with the fake watcher - // - // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#DefaultWatchReactor - reactor := testcore.DefaultWatchReactor(_watch, nil) - - // add watch reactor to beginning of the client chain - // - // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#Fake.PrependWatchReactor - _kubernetes.PrependWatchReactor("pods", reactor) - - // overwrite the mock kubernetes client - _engine.Kubernetes = _kubernetes - // setup tests tests := []struct { failure bool @@ -314,12 +282,18 @@ func TestKubernetes_WaitContainer(t *testing.T) { // run tests for _, test := range tests { + // setup types + _engine, _watch, err := newMockWithWatch(_pod, "pods") + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + go func() { // simulate adding a pod to the watcher _watch.Add(test.object) }() - err := _engine.WaitContainer(context.Background(), test.container) + err = _engine.WaitContainer(context.Background(), test.container) if test.failure { if err == nil { diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 45d08068..f479cad5 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -11,6 +11,9 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/kubernetes/fake" + testcore "k8s.io/client-go/testing" ) func TestKubernetes_New(t *testing.T) { @@ -314,3 +317,39 @@ var ( }, } ) + +// newMockWithWatch returns an Engine implementation that +// integrates with a Kubernetes runtime and a FakeWatcher +// that can be used to inject resource events into it. +func newMockWithWatch(pod *v1.Pod, watchResource string, opts ...ClientOpt) (*client, *watch.RaceFreeFakeWatcher, error) { + // setup types + _engine, err := NewMock(pod, opts...) + if err != nil { + return nil, nil, err + } + + // create a new fake kubernetes client + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset + _kubernetes := fake.NewSimpleClientset(pod) + + // create a new fake watcher + // + // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#NewRaceFreeFake + _watch := watch.NewRaceFreeFake() + + // create a new watch reactor with the fake watcher + // + // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#DefaultWatchReactor + reactor := testcore.DefaultWatchReactor(_watch, nil) + + // add watch reactor to beginning of the client chain + // + // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#Fake.PrependWatchReactor + _kubernetes.PrependWatchReactor(watchResource, reactor) + + // overwrite the mock kubernetes client + _engine.Kubernetes = _kubernetes + + return _engine, _watch, nil +} From 50d9555112bf49a423cb38aa7c5c9d76f2789e85 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 15 Mar 2022 09:22:32 -0500 Subject: [PATCH 256/430] test(kubernetes): Test TailContainer happy path (#289) --- runtime/kubernetes/container_test.go | 53 +++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index a7c38442..46a53950 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -208,17 +208,54 @@ func TestKubernetes_SetupContainer(t *testing.T) { } } -// TODO: implement this once they resolve the bug -// -// https://github.com/kubernetes/kubernetes/issues/84203 func TestKubernetes_TailContainer(t *testing.T) { - // Unfortunately, we can't implement this test using - // the native Kubernetes fake. This is because there - // is a bug in that code where an "empty" request is - // always returned when calling the GetLogs function. + // Unfortunately, we can't test failures using the native Kubernetes fake. + // k8s.client-go v0.19.0 added a mock GetLogs() response so that + // it no longer panics with an "empty" request, but now it always returns + // a successful response with Body: "fake logs". // // https://github.com/kubernetes/kubernetes/issues/84203 - // fixed in k8s.io/client-go v0.19.0; we already have v0.22.2 + // https://github.com/kubernetes/kubernetes/pulls/91485 + // + // setup types + _engine, err := NewMock(_pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + // setup tests + tests := []struct { + failure bool + container *pipeline.Container + }{ + { + failure: false, + container: _container, + }, + // We cannot test failures, because the mock GetLogs() always + // returns a successful response with logs body: "fake logs" + //{ + // failure: true, + // container: new(pipeline.Container), + //}, + } + + // run tests + for _, test := range tests { + _, err = _engine.TailContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("TailContainer should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("TailContainer returned err: %v", err) + } + } } func TestKubernetes_WaitContainer(t *testing.T) { From 6f0805826d9a0374b3614e8d87102cf52a838660 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:27:58 -0500 Subject: [PATCH 257/430] fix(deps): update module github.com/urfave/cli/v2 to v2.4.0 (#290) --- go.mod | 7 +++---- go.sum | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index e76e954e..4b5be681 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.3.0 + github.com/urfave/cli/v2 v2.4.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 k8s.io/api v0.23.4 @@ -37,7 +37,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/containerd v1.4.13 // indirect github.com/coreos/go-semver v0.3.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect @@ -78,9 +78,8 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/afero v1.8.1 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/go.sum b/go.sum index c49eab1f..7207e3fb 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,9 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -547,15 +548,15 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -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/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -589,8 +590,9 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -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/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I= +github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= 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= From 4f442129fa5c480daadbcd8c944c863519916185 Mon Sep 17 00:00:00 2001 From: Kayla McKay <39921134+kaymckay@users.noreply.github.com> Date: Wed, 16 Mar 2022 15:19:13 -0500 Subject: [PATCH 258/430] chore: update contributing (#291) --- .github/CONTRIBUTING.md | 61 ++++------------------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5be6cc36..8625ad9e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,29 +1,14 @@ # Contributing -We'd love to accept your contributions to this project! - -There are just a few guidelines you need to follow. - -## Bugs - -Bug reports should be opened up as [issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues) on the [go-vela/community](https://github.com/go-vela/community) repository! - -## Feature Requests - -Feature Requests should be opened up as [issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues) on the [go-vela/community](https://github.com/go-vela/community) repository! - -## Pull Requests - -**NOTE: We recommend you start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, it's helpful to know what people are working on.** - -We are always open to new PRs! You can follow the below guide for learning how you can contribute to the project! - ## Getting Started +We'd love to accept your contributions to this project! If you are a first time contributor, please review our [Contributing Guidelines](https://go-vela.github.io/docs/community/contributing_guidelines/) before proceeding. + ### Prerequisites -* [Review the commit guide we follow](https://chris.beams.io/posts/git-commit/#seven-rules) - ensure your commits follow our standards * [Review the local development docs](../DOCS.md) - ensures you have the Vela application stack running locally +* [Review the commit guide we follow](https://chris.beams.io/posts/git-commit/#seven-rules) - ensure your commits follow our standards +* Review our [style guide](https://go-vela.github.io/docs/community/contributing_guidelines/#style-guide) to ensure your code is clean and consistent. ### Setup @@ -62,24 +47,7 @@ cd $HOME/go-vela/worker ``` * Write your code and tests to implement the changes you desire. - * Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules) - * Please address linter warnings appropriately. If you are intentionally violating a rule that triggers a linter, please annotate the respective code with `nolint` declarations [[docs](https://golangci-lint.run/usage/false-positives/)]. we are using the following format for `nolint` declarations: - - ```go - // nolint: // - ``` - Example: - - ```go - // nolint:gocyclo // legacy function is complex, needs simplification - func superComplexFunction() error { - // .. - } - ``` - - Check the [documentation for more examples](https://golangci-lint.run/usage/false-positives/). - * Run the repository code (ensures your changes perform as you desire): ```bash @@ -108,25 +76,6 @@ make clean git push fork master ``` -* Open a pull request! - * For the title of the pull request, please use the following format for the title: - - ```text - feat(wobble): add hat wobble - ^--^^------^ ^------------^ - | | | - | | +---> Summary in present tense. - | +---> Scope: a noun describing a section of the codebase (optional) - +---> Type: chore, docs, feat, fix, refactor, or test. - ``` - - * feat: adds a new feature (equivalent to a MINOR in Semantic Versioning) - * fix: fixes a bug (equivalent to a PATCH in Semantic Versioning) - * docs: changes to the documentation - * refactor: refactors production code, eg. renaming a variable; doesn't change public API - * test: adds missing tests, refactors tests; no production code change - * chore: updates something without impacting the user (ex: bump a dependency in package.json or go.mod); no production code change - - If a code change introduces a breaking change, place ! suffix after type, ie. feat(change)!: adds breaking change. correlates with MAJOR in semantic versioning. +* Make sure to follow our [PR process](https://go-vela.github.io/docs/community/contributing_guidelines/#development-workflow) when opening a pull request Thank you for your contribution! From fe0f95f156fa4e283ecc4b1ea828e3147a8f85c1 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 16 Mar 2022 15:35:26 -0500 Subject: [PATCH 259/430] chore(release): updates for v0.13.0-rc2 (#292) --- go.mod | 8 +++++--- go.sum | 19 ++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 4b5be681..17129320 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.13.0-rc1 - github.com/go-vela/server v0.13.0-rc1 - github.com/go-vela/types v0.13.0-rc1 + github.com/go-vela/sdk-go v0.13.0-rc2 + github.com/go-vela/server v0.13.0-rc2 + github.com/go-vela/types v0.13.0-rc2 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -59,7 +59,9 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect github.com/goware/urlx v0.3.1 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.11 // indirect diff --git a/go.sum b/go.sum index 7207e3fb..e6b5653c 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -201,12 +199,12 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.13.0-rc1 h1:GvmEs0T3ePVN5t9RfD0fABPWo4P/YXkrliuVYuBv19c= -github.com/go-vela/sdk-go v0.13.0-rc1/go.mod h1:4LWFl8oouiS7CpVpUH9Oi1y0RHJpSJRD+wnaA2jKGGE= -github.com/go-vela/server v0.13.0-rc1 h1:BWSx+V1fkC/Yz2P7DoUFqqDp2TPpP4x+13Xg0tBTu/0= -github.com/go-vela/server v0.13.0-rc1/go.mod h1:F2CFqqo2maVAhB3yyg3Do+f3T9ihxFsVFBko/bP1yyk= -github.com/go-vela/types v0.13.0-rc1 h1:y4A5R/zbjlz/XXdwDE7iOdl+/6hgB0B/jVz9LFDfznw= -github.com/go-vela/types v0.13.0-rc1/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= +github.com/go-vela/sdk-go v0.13.0-rc2 h1:qUXtbGA+NBobouXndl2ftVterpigP4HRNvMJpn2dRog= +github.com/go-vela/sdk-go v0.13.0-rc2/go.mod h1:UWWzAjaNslDrExso17RZ7YWqIUH1fUl2lN8My9FwzYs= +github.com/go-vela/server v0.13.0-rc2 h1:ZeUYtltHGzKC2FZM4A8AWbXUGHp3yOX+qJo8K+xo9bg= +github.com/go-vela/server v0.13.0-rc2/go.mod h1:ltr/Ied01GTID566AmJreo79kFU/zVeIpSiQoLvwHIM= +github.com/go-vela/types v0.13.0-rc2 h1:NPlRRnew8qFW/lz6rpYbk8CZXUs8VjjCVJBI6dlk9fg= +github.com/go-vela/types v0.13.0-rc2/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -309,6 +307,7 @@ github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLc github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -322,6 +321,7 @@ github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -548,7 +548,6 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -557,7 +556,6 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -590,7 +588,6 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I= github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 4489fe3a35487ea4bf58581f9197ac562caef14d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:13:15 -0600 Subject: [PATCH 260/430] fix(deps): update deps (patch) to v0.23.5 (#293) Co-authored-by: Renovate Bot --- go.mod | 6 +++--- go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 17129320..b6535e70 100644 --- a/go.mod +++ b/go.mod @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.4.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 - k8s.io/api v0.23.4 - k8s.io/apimachinery v0.23.4 - k8s.io/client-go v0.23.4 + k8s.io/api v0.23.5 + k8s.io/apimachinery v0.23.5 + k8s.io/client-go v0.23.5 ) require ( diff --git a/go.sum b/go.sum index e6b5653c..a80d0ea3 100644 --- a/go.sum +++ b/go.sum @@ -1059,12 +1059,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= -k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= +k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= -k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= +k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= +k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= +k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From fc92918722b9a6af9471c8b1cad1329c65e19f9c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 23 Mar 2022 00:33:13 -0500 Subject: [PATCH 261/430] chore: Add tests for runtime WithLogger opt (#295) --- runtime/docker/opts_test.go | 45 ++++++++++++++++++++++++++++++++ runtime/kubernetes/opts_test.go | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go index 456df3b4..4d1a8c35 100644 --- a/runtime/docker/opts_test.go +++ b/runtime/docker/opts_test.go @@ -5,6 +5,7 @@ package docker import ( + "github.com/sirupsen/logrus" "reflect" "testing" ) @@ -72,3 +73,47 @@ func TestDocker_ClientOpt_WithHostVolumes(t *testing.T) { } } } + +func TestDocker_ClientOpt_WithLogger(t *testing.T) { + // setup tests + tests := []struct { + failure bool + logger *logrus.Entry + }{ + { + failure: false, + logger: &logrus.Entry{}, + }, + { + failure: false, + logger: nil, + }, + } + + // run tests + for _, test := range tests { + _service, err := New( + WithLogger(test.logger), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogger should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithLogger returned err: %v", err) + } + + if test.logger == nil && _service.Logger == nil { + t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") + } + + if test.logger != nil && !reflect.DeepEqual(_service.Logger, test.logger) { + t.Errorf("WithLogger set %v, want %v", _service.Logger, test.logger) + } + } +} diff --git a/runtime/kubernetes/opts_test.go b/runtime/kubernetes/opts_test.go index aaff223d..f1131cee 100644 --- a/runtime/kubernetes/opts_test.go +++ b/runtime/kubernetes/opts_test.go @@ -5,6 +5,7 @@ package kubernetes import ( + "github.com/sirupsen/logrus" "reflect" "testing" ) @@ -161,3 +162,48 @@ func TestKubernetes_ClientOpt_WithPrivilegedImages(t *testing.T) { } } } + +func TestKubernetes_ClientOpt_WithLogger(t *testing.T) { + // setup tests + tests := []struct { + failure bool + logger *logrus.Entry + }{ + { + failure: false, + logger: &logrus.Entry{}, + }, + { + failure: false, + logger: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile("testdata/config"), + WithLogger(test.logger), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogger should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithLogger returned err: %v", err) + } + + if test.logger == nil && _engine.Logger == nil { + t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") + } + + if test.logger != nil && !reflect.DeepEqual(_engine.Logger, test.logger) { + t.Errorf("WithLogger set %v, want %v", _engine.Logger, test.logger) + } + } +} From fc430656475ef8ad18e9b29adaba4dd3b1ee6097 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Thu, 24 Mar 2022 13:51:17 -0500 Subject: [PATCH 262/430] chore(release): dependency updates for v0.13.0 (#297) --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index b6535e70..0c8fbfcd 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.13.0-rc2 - github.com/go-vela/server v0.13.0-rc2 - github.com/go-vela/types v0.13.0-rc2 + github.com/go-vela/sdk-go v0.13.0 + github.com/go-vela/server v0.13.0 + github.com/go-vela/types v0.13.0 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.18.0 // indirect + github.com/alicebob/miniredis/v2 v2.19.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/containerd v1.4.13 // indirect @@ -51,7 +51,7 @@ require ( github.com/go-playground/validator/v10 v10.4.1 // indirect github.com/go-redis/redis/v8 v8.11.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.3.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v42 v42.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect diff --git a/go.sum b/go.sum index a80d0ea3..e16deace 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.18.0 h1:EPUGD69ou4Uw4c81t9NLh0+dSou46k4tFEvf498FJ0g= -github.com/alicebob/miniredis/v2 v2.18.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.19.0 h1:oexn9tOmXrfpceZsMvH6lKiOOoo/hLop7d5q6grNQrM= +github.com/alicebob/miniredis/v2 v2.19.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -199,19 +199,19 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.13.0-rc2 h1:qUXtbGA+NBobouXndl2ftVterpigP4HRNvMJpn2dRog= -github.com/go-vela/sdk-go v0.13.0-rc2/go.mod h1:UWWzAjaNslDrExso17RZ7YWqIUH1fUl2lN8My9FwzYs= -github.com/go-vela/server v0.13.0-rc2 h1:ZeUYtltHGzKC2FZM4A8AWbXUGHp3yOX+qJo8K+xo9bg= -github.com/go-vela/server v0.13.0-rc2/go.mod h1:ltr/Ied01GTID566AmJreo79kFU/zVeIpSiQoLvwHIM= -github.com/go-vela/types v0.13.0-rc2 h1:NPlRRnew8qFW/lz6rpYbk8CZXUs8VjjCVJBI6dlk9fg= -github.com/go-vela/types v0.13.0-rc2/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= +github.com/go-vela/sdk-go v0.13.0 h1:aHC6RWXr664GtmlLHs2IW59gmSNk3jcLXuxfZwM51ks= +github.com/go-vela/sdk-go v0.13.0/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= +github.com/go-vela/server v0.13.0 h1:wcPH5fcu4QP7srVkJXXrftyHpVCCD4q6KnkLmmxVWfs= +github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= +github.com/go-vela/types v0.13.0 h1:PX/0wtKMXbtqHbrWgwlCDzuBzeh+4V042k56siDSm1o= +github.com/go-vela/types v0.13.0/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.0 h1:EmVIxB5jzbllGIjiCV5JG4VylbK3KE400tLGLI1cdfU= +github.com/golang-jwt/jwt/v4 v4.4.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= From 3415305d193e013c03cd81e857b9a3154c190c4a Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 7 Apr 2022 11:23:16 -0500 Subject: [PATCH 263/430] feat(kubernetes): Add PipelinePodsTemplate CRD to define worker-specific Pod defaults for Kubernetes Runtime (#294) --- .gitignore | 2 + Makefile | 81 ++ PROJECT | 21 + cmd/vela-worker/exec.go | 2 + cmd/vela-worker/run.go | 2 + go.mod | 4 +- runtime/docker/opts_test.go | 3 +- runtime/flags.go | 12 + runtime/kubernetes/apis/doc.go | 10 + runtime/kubernetes/apis/vela/register.go | 10 + runtime/kubernetes/apis/vela/v1alpha1/doc.go | 15 + .../kubernetes/apis/vela/v1alpha1/register.go | 44 + .../kubernetes/apis/vela/v1alpha1/types.go | 141 ++ .../vela/v1alpha1/zz_generated.deepcopy.go | 249 ++++ runtime/kubernetes/build.go | 80 +- runtime/kubernetes/build_test.go | 277 +++- runtime/kubernetes/codegen/header.go.txt | 3 + runtime/kubernetes/container.go | 26 +- runtime/kubernetes/container_test.go | 79 +- .../clientset/versioned/clientset.go | 105 ++ .../generated/clientset/versioned/doc.go | 8 + .../versioned/fake/clientset_generated.go | 73 ++ .../generated/clientset/versioned/fake/doc.go | 8 + .../clientset/versioned/fake/register.go | 44 + .../clientset/versioned/scheme/doc.go | 8 + .../clientset/versioned/scheme/register.go | 44 + .../versioned/typed/vela/v1alpha1/doc.go | 8 + .../versioned/typed/vela/v1alpha1/fake/doc.go | 8 + .../fake/fake_pipelinepodstemplate.go | 118 ++ .../vela/v1alpha1/fake/fake_vela_client.go | 28 + .../vela/v1alpha1/generated_expansion.go | 9 + .../vela/v1alpha1/pipelinepodstemplate.go | 166 +++ .../typed/vela/v1alpha1/vela_client.go | 95 ++ ...-vela.github.io_pipelinepodstemplates.yaml | 1148 +++++++++++++++++ runtime/kubernetes/kubernetes.go | 30 + runtime/kubernetes/opts.go | 43 + runtime/kubernetes/opts_test.go | 96 +- .../testdata/pipeline-pods-template-dns.yaml | 19 + .../pipeline-pods-template-empty.yaml | 6 + .../pipeline-pods-template-malformed.yaml | 11 + ...pipeline-pods-template-node-selection.yaml | 64 + ...peline-pods-template-security-context.yaml | 23 + .../testdata/pipeline-pods-template.yaml | 13 + runtime/setup.go | 5 + 44 files changed, 3201 insertions(+), 40 deletions(-) create mode 100644 PROJECT create mode 100644 runtime/kubernetes/apis/doc.go create mode 100644 runtime/kubernetes/apis/vela/register.go create mode 100644 runtime/kubernetes/apis/vela/v1alpha1/doc.go create mode 100644 runtime/kubernetes/apis/vela/v1alpha1/register.go create mode 100644 runtime/kubernetes/apis/vela/v1alpha1/types.go create mode 100644 runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go create mode 100644 runtime/kubernetes/codegen/header.go.txt create mode 100644 runtime/kubernetes/generated/clientset/versioned/clientset.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/doc.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/fake/clientset_generated.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/fake/doc.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/fake/register.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/scheme/doc.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/scheme/register.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/doc.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/doc.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_pipelinepodstemplate.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_vela_client.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/generated_expansion.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/pipelinepodstemplate.go create mode 100644 runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/vela_client.go create mode 100644 runtime/kubernetes/generated/go-vela.github.io_pipelinepodstemplates.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template-dns.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template-empty.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template-malformed.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template-node-selection.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template-security-context.yaml create mode 100644 runtime/kubernetes/testdata/pipeline-pods-template.yaml diff --git a/.gitignore b/.gitignore index 68b918a3..e050907a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ *.dll *.so *.dylib +# install makefile required bins in the bin/ dir +bin # Test binary, build with `go test -c` *.test diff --git a/Makefile b/Makefile index 09fa099f..06d2f890 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,14 @@ endif # create a list of linker flags for building the golang application LD_FLAGS = -X github.com/go-vela/worker/version.Commit=${GITHUB_SHA} -X github.com/go-vela/worker/version.Date=${BUILD_DATE} -X github.com/go-vela/worker/version.Tag=${GITHUB_TAG} +# Misc settings for the generating the Kubernetes CRD for the Kubernetes Runtime +K8S_CRD_OUTPUT_PKG=github.com/go-vela/worker/runtime/kubernetes/generated +K8S_CRD_INPUT_PKG=github.com/go-vela/worker/runtime/kubernetes/apis +K8S_CRD_CLIENTSET_PKG_NAME=clientset +K8S_CRD_CLIENTSET_NAME_VERSIONED=versioned +K8S_CRD_GROUP=vela +K8S_CRD_VERSION=v1alpha1 + # The `clean` target is intended to clean the workspace # and prepare the local changes for submission. # @@ -311,3 +319,76 @@ spec-version-update: # Usage: `make spec` .PHONY: spec spec: spec-gen spec-version-update spec-validate + +# The `crd-gen` target is intended to create a k8s CRD client +# for the kubernetes runtime using k8s.io/code-generator +# +# Usage: `make crd-gen` +.PHONY: crd-client-gen +crd-client-gen: controller-gen client-gen + $(eval TMP := $(shell mktemp -d)) + @echo + @echo "### Generating CRD deepcopy funcs using sig.k8s.io/controller-tools" + $(CONTROLLER_GEN) \ + object:headerFile="runtime/kubernetes/codegen/header.go.txt" \ + paths="${K8S_CRD_INPUT_PKG}/${K8S_CRD_GROUP}/${K8S_CRD_VERSION}" + @echo "### Generating CRD clientset using k8s.io/code-generator" + @echo "Generating clientset for ${K8S_CRD_GROUP}:${K8S_CRD_VERSION} at ${K8S_CRD_OUTPUT_PKG}/${K8S_CRD_CLIENTSET_PKG_NAME}" + $(CLIENT_GEN) \ + --clientset-name "${K8S_CRD_CLIENTSET_NAME_VERSIONED}" \ + --input-base "" \ + --input \ + "${K8S_CRD_INPUT_PKG}/${K8S_CRD_GROUP}/${K8S_CRD_VERSION}" \ + --output-package \ + "${K8S_CRD_OUTPUT_PKG}/${K8S_CRD_CLIENTSET_PKG_NAME}" \ + --output-base "${TMP}" \ + --go-header-file runtime/kubernetes/codegen/header.go.txt + @echo "### Copying generated files" + rm -rf runtime/kubernetes/generated/clientset + cp -r ${TMP}/github.com/go-vela/worker/runtime/kubernetes/* runtime/kubernetes/ + rm -rf $(TMP) + @echo "### CRD clientset created successfully" + +# The `crd-manifest` target will call crd-gen to create a k8s crd +# for the kubernetes runtime. +# +# Usage: `make crd` +.PHONY: crd-manifest +crd-manifest: controller-gen ## Generate CustomResourceDefinition object. + @echo + @echo "### Generating CRD manifest using sig.k8s.io/controller-tools" + @echo "Generating CRD manifest in runtime/kubernetes/generated" + $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=runtime/kubernetes/generated + @echo "### CRD manifest created successfully" + +# The `crd` target will call crd-client-gen and crd-manifest +# to create a k8s CRD for the kubernetes runtime. +# +# Usage: `make crd` +.PHONY: crd +crd: crd-client-gen crd-manifest + +CONTROLLER_GEN = $(shell pwd)/bin/controller-gen +.PHONY: controller-gen +controller-gen: ## Download controller-gen locally if necessary. + $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0) + +CLIENT_GEN = $(shell pwd)/bin/client-gen +.PHONY: client-gen +client-gen: ## Download client-gen locally if necessary. + $(eval K8S_LIB_VERSION := $(shell go mod graph | grep 'github.com/go-vela/worker k8s.io/client-go@' | sed 's/.*@//')) + $(call go-get-tool,$(CLIENT_GEN),k8s.io/code-generator/cmd/client-gen@$(K8S_LIB_VERSION)) + +# go-get-tool will 'go get' any package $2 and install it to $1. +PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) +define go-get-tool +@[ -f $(1) ] || { \ +set -e ;\ +TMP_DIR=$$(mktemp -d) ;\ +cd $$TMP_DIR ;\ +go mod init tmp ;\ +echo "Downloading $(2)" ;\ +GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ +rm -rf $$TMP_DIR ;\ +} +endef diff --git a/PROJECT b/PROJECT new file mode 100644 index 00000000..df013502 --- /dev/null +++ b/PROJECT @@ -0,0 +1,21 @@ +--- +# This file is used in generating code for the Kubernetes Runtime. +# Look in runtime/kubernetes/apis/ and runtime/kubernetes/generated/ +# for the code that is used or generated by the code generators. +# +# For more about this file see: +# https://book.kubebuilder.io/reference/project-config.html +domain: go-vela.github.io +layout: +- go.kubebuilder.io/v3 +projectName: worker +repo: github.com/go-vela/worker +resources: +- api: + crdVersion: v1 + namespaced: true + domain: go-vela.github.io + kind: PipelinePodsTemplate + path: pkg/runtime/kubernetes/apis/vela/v1alpha1 + version: v1alpha1 +version: "3" diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 4f9d0c14..f369c27c 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -56,6 +56,8 @@ func (w *Worker) exec(index int) error { ConfigFile: w.Config.Runtime.ConfigFile, HostVolumes: w.Config.Runtime.HostVolumes, Namespace: w.Config.Runtime.Namespace, + PodsTemplateName: w.Config.Runtime.PodsTemplateName, + PodsTemplateFile: w.Config.Runtime.PodsTemplateFile, PrivilegedImages: w.Config.Runtime.PrivilegedImages, }) if err != nil { diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 76ecb8a8..a709e27e 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -107,6 +107,8 @@ func run(c *cli.Context) error { Driver: c.String("runtime.driver"), ConfigFile: c.String("runtime.config"), Namespace: c.String("runtime.namespace"), + PodsTemplateName: c.String("runtime.pods-template-name"), + PodsTemplateFile: c.Path("runtime.pods-template-file"), HostVolumes: c.StringSlice("runtime.volumes"), PrivilegedImages: c.StringSlice("runtime.privileged-images"), }, diff --git a/go.mod b/go.mod index 0c8fbfcd..33762e47 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.17 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 @@ -23,6 +22,7 @@ require ( k8s.io/api v0.23.5 k8s.io/apimachinery v0.23.5 k8s.io/client-go v0.23.5 + sigs.k8s.io/yaml v1.2.0 ) require ( @@ -34,6 +34,7 @@ require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/alicebob/miniredis/v2 v2.19.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/containerd v1.4.13 // indirect github.com/coreos/go-semver v0.3.0 // indirect @@ -107,5 +108,4 @@ require ( k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go index 4d1a8c35..53438714 100644 --- a/runtime/docker/opts_test.go +++ b/runtime/docker/opts_test.go @@ -5,9 +5,10 @@ package docker import ( - "github.com/sirupsen/logrus" "reflect" "testing" + + "github.com/sirupsen/logrus" ) func TestDocker_ClientOpt_WithPrivilegedImages(t *testing.T) { diff --git a/runtime/flags.go b/runtime/flags.go index 9c2331b6..2e01350b 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -36,6 +36,18 @@ var Flags = []cli.Flag{ Name: "runtime.namespace", Usage: "namespace to use for the runtime (only used by kubernetes)", }, + &cli.StringFlag{ + EnvVars: []string{"VELA_RUNTIME_PODS_TEMPLATE_NAME", "RUNTIME_PODS_TEMPLATE_NAME"}, + FilePath: "/vela/runtime/pods_template_name", + Name: "runtime.pods-template-name", + Usage: "name of the PipelinePodsTemplate to retrieve from the runtime.namespace (only used by kubernetes)", + }, + &cli.PathFlag{ + EnvVars: []string{"VELA_RUNTIME_PODS_TEMPLATE_FILE", "RUNTIME_PODS_TEMPLATE_FILE"}, + FilePath: "/vela/runtime/pods_template_file", + Name: "runtime.pods-template-file", + Usage: "path to local fallback file containing a PipelinePodsTemplate in YAML (only used by kubernetes; only used if runtime.pods-template-name is not defined)", + }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_RUNTIME_PRIVILEGED_IMAGES", "RUNTIME_PRIVILEGED_IMAGES"}, FilePath: "/vela/runtime/privileged_images", diff --git a/runtime/kubernetes/apis/doc.go b/runtime/kubernetes/apis/doc.go new file mode 100644 index 00000000..e45ff9ac --- /dev/null +++ b/runtime/kubernetes/apis/doc.go @@ -0,0 +1,10 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package apis defines the worker-config CRD and related utilities. +// +// Usage: +// +// import "github.com/go-vela/worker/runtime/kubernetes/apis" +package apis diff --git a/runtime/kubernetes/apis/vela/register.go b/runtime/kubernetes/apis/vela/register.go new file mode 100644 index 00000000..7c08bd25 --- /dev/null +++ b/runtime/kubernetes/apis/vela/register.go @@ -0,0 +1,10 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package vela + +const ( + // GroupName is the group name used in this package. + GroupName = "go-vela.github.io" +) diff --git a/runtime/kubernetes/apis/vela/v1alpha1/doc.go b/runtime/kubernetes/apis/vela/v1alpha1/doc.go new file mode 100644 index 00000000..b0a6f8d1 --- /dev/null +++ b/runtime/kubernetes/apis/vela/v1alpha1/doc.go @@ -0,0 +1,15 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// +kubebuilder:object:generate=true +// +kubebuilder:validation:Optional +// +groupName=go-vela.github.io +// +groupGoName=Vela + +// Package v1alpha1 defines version 1alpha1 of the worker-config CRD. +// +// Usage: +// +// import "github.com/go-vela/worker/runtime/kubernetes/apis/v1alpha1" +package v1alpha1 diff --git a/runtime/kubernetes/apis/vela/v1alpha1/register.go b/runtime/kubernetes/apis/vela/v1alpha1/register.go new file mode 100644 index 00000000..f6ec17a4 --- /dev/null +++ b/runtime/kubernetes/apis/vela/v1alpha1/register.go @@ -0,0 +1,44 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/go-vela/worker/runtime/kubernetes/apis/vela" +) + +// SchemeGroupVersion is group version used to register these objects. +var SchemeGroupVersion = schema.GroupVersion{Group: vela.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind. +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder initializes a scheme builder. + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a global function that registers this API group & version to a scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// addKnownTypes adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &PipelinePodsTemplate{}, + &PipelinePodsTemplateList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + + return nil +} diff --git a/runtime/kubernetes/apis/vela/v1alpha1/types.go b/runtime/kubernetes/apis/vela/v1alpha1/types.go new file mode 100644 index 00000000..d0979d9e --- /dev/null +++ b/runtime/kubernetes/apis/vela/v1alpha1/types.go @@ -0,0 +1,141 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Important: Run "make crd" after editing this file. + +// Helpful hints on adjusting the CRD generated from these types: +// +// - Use "+kubebuilder:object" tags on top-level structs: +// https://book.kubebuilder.io/reference/markers/object.html +// +// - Some fields (list, map, or struct types) may need additional tags. +// https://book.kubebuilder.io/reference/markers/crd-processing.html +// +// - Use "+kubebuilder:validation:*" tags to add more validation rules. +// https://book.kubebuilder.io/reference/generating-crd.html#validation +// https://book.kubebuilder.io/reference/markers/crd-validation.html +// +// - Use "+kubebuilder:printercolumn:*" tags to change the "kubectl get" columns. +// https://book.kubebuilder.io/reference/generating-crd.html#additional-printer-columns + +// +genclient +// +kubebuilder:object:root=true + +// PipelinePodsTemplate defines the config for a given worker. +type PipelinePodsTemplate struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the PipelinePodsTemplate configuration for Vela Workers. + Spec PipelinePodsTemplateSpec `json:"spec,omitempty"` +} + +// PipelinePodsTemplateSpec configures creation of Pipeline Pods by Vela Workers. +type PipelinePodsTemplateSpec struct { + // Template defines defaults for Pipeline Pod creation in Vela Workers. + // +kubebuilder:validation:Required + Template PipelinePodTemplate `json:"template"` +} + +// PipelinePodTemplate describes the data defaults to use when creating each pipeline pod. +type PipelinePodTemplate struct { + // Metadata contains a subset of the standard object metadata (see: metav1.ObjectMeta). + Metadata PipelinePodTemplateMeta `json:"metadata,omitempty"` + + // Spec contains a subset of the pod configuration options (see: v1.PodSpec). + Spec PipelinePodTemplateSpec `json:"spec,omitempty"` +} + +// PipelinePodTemplateMeta is a subset of metav1.ObjectMeta with meta defaults for pipeline pods. +type PipelinePodTemplateMeta struct { + // Labels is a key value map of strings to organize and categorize pods. + // More info: http://kubernetes.io/docs/user-guide/labels + Labels map[string]string `json:"labels,omitempty"` + + // Annotations is a key value map of strings to store additional info on pods. + // More info: http://kubernetes.io/docs/user-guide/annotations + Annotations map[string]string `json:"annotations,omitempty"` +} + +// PipelinePodTemplateSpec is (loosely) a subset of v1.PodSpec with spec defaults for pipeline pods. +type PipelinePodTemplateSpec struct { + // NodeSelector is a selector which must be true for the pipeline pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +mapType=atomic + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // Affinity specifies the pipeline pod's scheduling constraints, if any. + Affinity *v1.Affinity `json:"affinity,omitempty"` + // Affinity specifies the pipeline pod's tolerations, if any. + Tolerations []v1.Toleration `json:"tolerations,omitempty"` + + // DNSPolicy sets DNS policy for the pipeline pod. + // Defaults to "ClusterFirst". + // Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. + // +kubebuilder:validation:Enum={"ClusterFirstWithHostNet","ClusterFirst","Default","None"} + DNSPolicy v1.DNSPolicy `json:"dnsPolicy,omitempty"` + // DNSConfig specifies the DNS parameters of a pod. + // Parameters specified here will be merged to the generated DNS + // configuration based on DNSPolicy. + DNSConfig *v1.PodDNSConfig `json:"dnsConfig,omitempty"` + + // Container defines a limited set of defaults to apply to each PipelinePodsTemplate container. + // This is analogous to one entry in v1.PodSpec.Containers. + Container *PipelineContainer `json:"container,omitempty"` + + // SecurityContext holds pod-level security attributes and common container settings. + // Optional: Defaults to empty. See type description for default values of each field. + SecurityContext *PipelinePodSecurityContext `json:"securityContext,omitempty"` +} + +// PipelineContainer has defaults for containers in a PipelinePodsTemplate. +type PipelineContainer struct { + // SecurityContext defines the security options the container should be run with. + // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + SecurityContext *PipelineContainerSecurityContext `json:"securityContext,omitempty"` +} + +// PipelinePodSecurityContext holds pod-level security attributes and common container settings. +type PipelinePodSecurityContext struct { + // RunAsNonRoot indicates that the container must run as a non-root user. + // If true, the Kubelet will validate the image at runtime to ensure that it + // does not run as UID 0 (root) and fail to start the container if it does. + // If unset or false, no such validation will be performed. + RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` + // Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported + // sysctls (by the container runtime) might fail to launch. + // Note that this field cannot be set when spec.os.name is windows. + Sysctls []v1.Sysctl `json:"sysctls,omitempty"` +} + +// PipelineContainerSecurityContext holds container-level security configuration. +type PipelineContainerSecurityContext struct { + // Capabilities contains the capabilities to add/drop when running containers. + // Defaults to the default set of capabilities granted by the container runtime. + // Note that this field cannot be set when spec.os.name is windows. + Capabilities *v1.Capabilities `json:"capabilities,omitempty"` +} + +// +kubebuilder:object:root=true + +// PipelinePodsTemplateList is a list of Deployments. +type PipelinePodsTemplateList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + metav1.ListMeta `json:"metadata,omitempty"` + + // Items is the list of Deployments. + // +kubebuilder:validation:Required + Items []PipelinePodsTemplate `json:"items"` +} diff --git a/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go b/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000..ab2a4fa1 --- /dev/null +++ b/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,249 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelineContainer) DeepCopyInto(out *PipelineContainer) { + *out = *in + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(PipelineContainerSecurityContext) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineContainer. +func (in *PipelineContainer) DeepCopy() *PipelineContainer { + if in == nil { + return nil + } + out := new(PipelineContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelineContainerSecurityContext) DeepCopyInto(out *PipelineContainerSecurityContext) { + *out = *in + if in.Capabilities != nil { + in, out := &in.Capabilities, &out.Capabilities + *out = new(v1.Capabilities) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineContainerSecurityContext. +func (in *PipelineContainerSecurityContext) DeepCopy() *PipelineContainerSecurityContext { + if in == nil { + return nil + } + out := new(PipelineContainerSecurityContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodSecurityContext) DeepCopyInto(out *PipelinePodSecurityContext) { + *out = *in + if in.RunAsNonRoot != nil { + in, out := &in.RunAsNonRoot, &out.RunAsNonRoot + *out = new(bool) + **out = **in + } + if in.Sysctls != nil { + in, out := &in.Sysctls, &out.Sysctls + *out = make([]v1.Sysctl, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodSecurityContext. +func (in *PipelinePodSecurityContext) DeepCopy() *PipelinePodSecurityContext { + if in == nil { + return nil + } + out := new(PipelinePodSecurityContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodTemplate) DeepCopyInto(out *PipelinePodTemplate) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodTemplate. +func (in *PipelinePodTemplate) DeepCopy() *PipelinePodTemplate { + if in == nil { + return nil + } + out := new(PipelinePodTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodTemplateMeta) DeepCopyInto(out *PipelinePodTemplateMeta) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodTemplateMeta. +func (in *PipelinePodTemplateMeta) DeepCopy() *PipelinePodTemplateMeta { + if in == nil { + return nil + } + out := new(PipelinePodTemplateMeta) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodTemplateSpec) DeepCopyInto(out *PipelinePodTemplateSpec) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNSConfig != nil { + in, out := &in.DNSConfig, &out.DNSConfig + *out = new(v1.PodDNSConfig) + (*in).DeepCopyInto(*out) + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(PipelineContainer) + (*in).DeepCopyInto(*out) + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(PipelinePodSecurityContext) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodTemplateSpec. +func (in *PipelinePodTemplateSpec) DeepCopy() *PipelinePodTemplateSpec { + if in == nil { + return nil + } + out := new(PipelinePodTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodsTemplate) DeepCopyInto(out *PipelinePodsTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodsTemplate. +func (in *PipelinePodsTemplate) DeepCopy() *PipelinePodsTemplate { + if in == nil { + return nil + } + out := new(PipelinePodsTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PipelinePodsTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodsTemplateList) DeepCopyInto(out *PipelinePodsTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PipelinePodsTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodsTemplateList. +func (in *PipelinePodsTemplateList) DeepCopy() *PipelinePodsTemplateList { + if in == nil { + return nil + } + out := new(PipelinePodsTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PipelinePodsTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelinePodsTemplateSpec) DeepCopyInto(out *PipelinePodsTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelinePodsTemplateSpec. +func (in *PipelinePodsTemplateSpec) DeepCopy() *PipelinePodsTemplateSpec { + if in == nil { + return nil + } + out := new(PipelinePodsTemplateSpec) + in.DeepCopyInto(out) + return out +} diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index d2fa7171..5023deaf 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -9,10 +9,14 @@ import ( "fmt" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" - "github.com/buildkite/yaml" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + // The k8s libraries have some quirks around yaml marshaling (see opts.go). + // So, just use the same library for all kubernetes-related YAML. + "sigs.k8s.io/yaml" ) // InspectBuild displays details about the pod for the init step. @@ -39,22 +43,88 @@ func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, e func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { c.Logger.Tracef("setting up for build %s", b.ID) + if c.PipelinePodTemplate == nil { + if len(c.config.PipelinePodsTemplateName) > 0 { + // nolint: contextcheck // ignore non-inherited new context + podsTemplateResponse, err := c.VelaKubernetes.VelaV1alpha1().PipelinePodsTemplates(c.config.Namespace).Get( + context.Background(), c.config.PipelinePodsTemplateName, metav1.GetOptions{}, + ) + if err != nil { + return err + } + + // save the PipelinePodTemplate to use later in SetupContainer and other Setup methods + c.PipelinePodTemplate = &podsTemplateResponse.Spec.Template + } else { + c.PipelinePodTemplate = &v1alpha1.PipelinePodTemplate{} + } + } + + // These labels will be used to call k8s watch APIs. + labels := map[string]string{"pipeline": b.ID} + + if c.PipelinePodTemplate.Metadata.Labels != nil { + // merge the template labels into the worker-defined labels. + for k, v := range c.PipelinePodTemplate.Metadata.Labels { + // do not allow overwriting any of the worker-defined labels. + if _, ok := labels[k]; ok { + continue + } + + labels[k] = v + } + } + // create the object metadata for the pod // // https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1?tab=doc#ObjectMeta c.Pod.ObjectMeta = metav1.ObjectMeta{ - Name: b.ID, - Labels: map[string]string{"pipeline": b.ID}, + Name: b.ID, + Labels: labels, + Annotations: c.PipelinePodTemplate.Metadata.Annotations, } - // TODO: Vela admin defined worker-specific: - // NodeSelector, Tolerations, Affinity, AutomountServiceAccountToken + // TODO: Vela admin defined worker-specific: AutomountServiceAccountToken + + if c.PipelinePodTemplate.Spec.NodeSelector != nil { + c.Pod.Spec.NodeSelector = c.PipelinePodTemplate.Spec.NodeSelector + } + + if c.PipelinePodTemplate.Spec.Tolerations != nil { + c.Pod.Spec.Tolerations = c.PipelinePodTemplate.Spec.Tolerations + } + + if c.PipelinePodTemplate.Spec.Affinity != nil { + c.Pod.Spec.Affinity = c.PipelinePodTemplate.Spec.Affinity + } // create the restart policy for the pod // // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#RestartPolicy c.Pod.Spec.RestartPolicy = v1.RestartPolicyNever + if len(c.PipelinePodTemplate.Spec.DNSPolicy) > 0 { + c.Pod.Spec.DNSPolicy = c.PipelinePodTemplate.Spec.DNSPolicy + } + + if c.PipelinePodTemplate.Spec.DNSConfig != nil { + c.Pod.Spec.DNSConfig = c.PipelinePodTemplate.Spec.DNSConfig + } + + if c.PipelinePodTemplate.Spec.SecurityContext != nil { + if c.Pod.Spec.SecurityContext == nil { + c.Pod.Spec.SecurityContext = &v1.PodSecurityContext{} + } + + if c.PipelinePodTemplate.Spec.SecurityContext.RunAsNonRoot != nil { + c.Pod.Spec.SecurityContext.RunAsNonRoot = c.PipelinePodTemplate.Spec.SecurityContext.RunAsNonRoot + } + + if c.PipelinePodTemplate.Spec.SecurityContext.Sysctls != nil { + c.Pod.Spec.SecurityContext.Sysctls = c.PipelinePodTemplate.Spec.SecurityContext.Sysctls + } + } + return nil } diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index bec9ac11..70ca964a 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -6,11 +6,14 @@ package kubernetes import ( "context" + "reflect" "testing" "github.com/go-vela/types/pipeline" + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestKubernetes_InspectBuild(t *testing.T) { @@ -54,29 +57,222 @@ func TestKubernetes_InspectBuild(t *testing.T) { } func TestKubernetes_SetupBuild(t *testing.T) { - // setup types - _engine, err := NewMock(&v1.Pod{}) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + // needed to be able to make a pointers: + trueBool := true + twoString := "2" + + // testdata/pipeline-pods-template.yaml + wantFromTemplateMetadata := velav1alpha1.PipelinePodTemplateMeta{ + Annotations: map[string]string{"annotation/foo": "bar"}, + Labels: map[string]string{ + "foo": "bar", + "pipeline": _steps.ID, + }, + } + + // testdata/pipeline-pods-template-security-context.yaml + wantFromTemplateSecurityContext := velav1alpha1.PipelinePodSecurityContext{ + RunAsNonRoot: &trueBool, + Sysctls: []v1.Sysctl{ + {Name: "kernel.shm_rmid_forced", Value: "0"}, + {Name: "net.core.somaxconn", Value: "1024"}, + {Name: "kernel.msgmax", Value: "65536"}, + }, + } + + // testdata/pipeline-pods-template-node-selection.yaml + wantFromTemplateNodeSelection := velav1alpha1.PipelinePodTemplateSpec{ + NodeSelector: map[string]string{"disktype": "ssd"}, + Affinity: &v1.Affinity{ + NodeAffinity: &v1.NodeAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + {MatchExpressions: []v1.NodeSelectorRequirement{ + {Key: "kubernetes.io/os", Operator: v1.NodeSelectorOpIn, Values: []string{"linux"}}, + }}, + }, + }, + PreferredDuringSchedulingIgnoredDuringExecution: []v1.PreferredSchedulingTerm{ + {Weight: 1, Preference: v1.NodeSelectorTerm{ + MatchExpressions: []v1.NodeSelectorRequirement{ + {Key: "another-node-label-key", Operator: v1.NodeSelectorOpIn, Values: []string{"another-node-label-value"}}, + }, + }}, + }, + }, + PodAffinity: &v1.PodAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []v1.PodAffinityTerm{ + { + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{ + {Key: "security", Operator: metav1.LabelSelectorOpIn, Values: []string{"S1"}}, + }, + }, + TopologyKey: "topology.kubernetes.io/zone", + }, + }, + }, + PodAntiAffinity: &v1.PodAntiAffinity{ + PreferredDuringSchedulingIgnoredDuringExecution: []v1.WeightedPodAffinityTerm{ + { + Weight: 100, + PodAffinityTerm: v1.PodAffinityTerm{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{ + {Key: "security", Operator: metav1.LabelSelectorOpIn, Values: []string{"S2"}}, + }, + }, + TopologyKey: "topology.kubernetes.io/zone", + }, + }, + }, + }, + }, + Tolerations: []v1.Toleration{ + { + Key: "key1", + Operator: v1.TolerationOpEqual, + Value: "value1", + Effect: v1.TaintEffectNoSchedule, + }, + { + Key: "key1", + Operator: v1.TolerationOpEqual, + Value: "value1", + Effect: v1.TaintEffectNoExecute, + }, + }, + } + + // testdata/pipeline-pods-template-dns.yaml + wantFromTemplateDNS := velav1alpha1.PipelinePodTemplateSpec{ + DNSPolicy: v1.DNSNone, + DNSConfig: &v1.PodDNSConfig{ + Nameservers: []string{"1.2.3.4"}, + Searches: []string{ + "ns1.svc.cluster-domain.example", + "my.dns.search.suffix", + }, + Options: []v1.PodDNSConfigOption{ + {Name: "ndots", Value: &twoString}, + {Name: "edns0"}, + }, + }, } // setup tests tests := []struct { - failure bool - pipeline *pipeline.Build + failure bool + pipeline *pipeline.Build + opts []ClientOpt + wantFromTemplate interface{} }{ { - failure: false, - pipeline: _stages, + failure: false, + pipeline: _stages, + opts: nil, + wantFromTemplate: nil, }, { - failure: false, - pipeline: _steps, + failure: false, + pipeline: _steps, + opts: nil, + wantFromTemplate: nil, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-empty.yaml")}, + wantFromTemplate: nil, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-empty.yaml")}, + wantFromTemplate: nil, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template.yaml")}, + wantFromTemplate: wantFromTemplateMetadata, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template.yaml")}, + wantFromTemplate: wantFromTemplateMetadata, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, + wantFromTemplate: wantFromTemplateSecurityContext, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, + wantFromTemplate: wantFromTemplateSecurityContext, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-node-selection.yaml")}, + wantFromTemplate: wantFromTemplateNodeSelection, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-node-selection.yaml")}, + wantFromTemplate: wantFromTemplateNodeSelection, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-dns.yaml")}, + wantFromTemplate: wantFromTemplateDNS, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-dns.yaml")}, + wantFromTemplate: wantFromTemplateDNS, + }, + { + failure: false, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("mock-pipeline-pods-template", "")}, + wantFromTemplate: nil, + }, + { + failure: false, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("mock-pipeline-pods-template", "")}, + wantFromTemplate: nil, + }, + { + failure: true, + pipeline: _stages, + opts: []ClientOpt{WithPodsTemplate("missing-pipeline-pods-template", "")}, + wantFromTemplate: nil, + }, + { + failure: true, + pipeline: _steps, + opts: []ClientOpt{WithPodsTemplate("missing-pipeline-pods-template", "")}, + wantFromTemplate: nil, }, } // run tests for _, test := range tests { + // setup types + _engine, err := NewMock(&v1.Pod{}, test.opts...) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + err = _engine.SetupBuild(context.Background(), test.pipeline) // this does not test the resulting pod spec (ie no tests for ObjectMeta, RestartPolicy) @@ -92,6 +288,67 @@ func TestKubernetes_SetupBuild(t *testing.T) { if err != nil { t.Errorf("SetupBuild returned err: %v", err) } + + // make sure that worker-defined labels are set and cannot be overridden by PipelinePodsTemplate + if pipelineLabel, ok := _engine.Pod.ObjectMeta.Labels["pipeline"]; !ok { + t.Errorf("Pod is missing the pipeline label: %v", _engine.Pod.ObjectMeta) + } else if pipelineLabel != test.pipeline.ID { + t.Errorf("Pod's pipeline label is %v, want %v", pipelineLabel, test.pipeline.ID) + } + + switch test.wantFromTemplate.(type) { + case velav1alpha1.PipelinePodTemplateMeta: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateMeta) + + // PipelinePodsTemplate defined Annotations + if want.Annotations != nil && !reflect.DeepEqual(_engine.Pod.Annotations, want.Annotations) { + t.Errorf("Pod.Annotations is %v, want %v", _engine.Pod.Annotations, want.Annotations) + } + + // PipelinePodsTemplate defined Labels + if want.Labels != nil && !reflect.DeepEqual(_engine.Pod.Labels, want.Labels) { + t.Errorf("Pod.Labels is %v, want %v", _engine.Pod.Labels, want.Labels) + } + case velav1alpha1.PipelinePodSecurityContext: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodSecurityContext) + + // PipelinePodsTemplate defined SecurityContext.RunAsNonRoot + if !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) { + t.Errorf("Pod.SecurityContext.RunAsNonRoot is %v, want %v", _engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) + } + + // PipelinePodsTemplate defined SecurityContext.Sysctls + if want.Sysctls != nil && !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) { + t.Errorf("Pod.SecurityContext.Sysctls is %v, want %v", _engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) + } + case velav1alpha1.PipelinePodTemplateSpec: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateSpec) + + // PipelinePodsTemplate defined NodeSelector + if want.NodeSelector != nil && !reflect.DeepEqual(_engine.Pod.Spec.NodeSelector, want.NodeSelector) { + t.Errorf("Pod.NodeSelector is %v, want %v", _engine.Pod.Spec.NodeSelector, want.NodeSelector) + } + + // PipelinePodsTemplate defined Affinity + if want.Affinity != nil && !reflect.DeepEqual(_engine.Pod.Spec.Affinity, want.Affinity) { + t.Errorf("Pod.Affinity is %v, want %v", _engine.Pod.Spec.Affinity, want.Affinity) + } + + // PipelinePodsTemplate defined Tolerations + if want.Tolerations != nil && !reflect.DeepEqual(_engine.Pod.Spec.Tolerations, want.Tolerations) { + t.Errorf("Pod.Tolerations is %v, want %v", _engine.Pod.Spec.Tolerations, want.Tolerations) + } + + // PipelinePodsTemplate defined DNSPolicy + if len(want.DNSPolicy) > 0 && _engine.Pod.Spec.DNSPolicy != want.DNSPolicy { + t.Errorf("Pod.DNSPolicy is %v, want %v", _engine.Pod.Spec.DNSPolicy, want.DNSPolicy) + } + + // PipelinePodsTemplate defined DNSConfig + if want.DNSConfig != nil && !reflect.DeepEqual(_engine.Pod.Spec.DNSConfig, want.DNSConfig) { + t.Errorf("Pod.DNSConfig is %v, want %v", _engine.Pod.Spec.DNSConfig, want.DNSConfig) + } + } } } diff --git a/runtime/kubernetes/codegen/header.go.txt b/runtime/kubernetes/codegen/header.go.txt new file mode 100644 index 00000000..ca49b354 --- /dev/null +++ b/runtime/kubernetes/codegen/header.go.txt @@ -0,0 +1,3 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index d40c1a9c..8d1a0e04 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -122,12 +122,13 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // the containers with the proper image. // // https://hub.docker.com/r/kubernetes/pause - Image: image.Parse("kubernetes/pause:latest"), - Env: []v1.EnvVar{}, - Stdin: false, - StdinOnce: false, - TTY: false, - WorkingDir: ctn.Directory, + Image: image.Parse("kubernetes/pause:latest"), + Env: []v1.EnvVar{}, + Stdin: false, + StdinOnce: false, + TTY: false, + WorkingDir: ctn.Directory, + SecurityContext: &v1.SecurityContext{}, } // handle the container pull policy (This cannot be updated like the image can) @@ -167,12 +168,17 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er return err } - container.SecurityContext = &v1.SecurityContext{ - Privileged: &privileged, - } + container.SecurityContext.Privileged = &privileged } - // TODO: add SecurityContext options (runAsUser, runAsNonRoot, sysctls) + if c.PipelinePodTemplate != nil && c.PipelinePodTemplate.Spec.Container != nil { + securityContext := c.PipelinePodTemplate.Spec.Container.SecurityContext + + // TODO: add more SecurityContext options (runAsUser, runAsNonRoot, sysctls) + if securityContext != nil && securityContext.Capabilities != nil { + container.SecurityContext.Capabilities = securityContext.Capabilities + } + } // Executor.CreateBuild extends the environment AFTER calling Runtime.SetupBuild. // So, configure the environment as late as possible (just before pod creation). diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 46a53950..89cf4f15 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -6,9 +6,11 @@ package kubernetes import ( "context" + "reflect" "testing" "github.com/go-vela/types/pipeline" + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -143,20 +145,20 @@ func TestKubernetes_RunContainer(t *testing.T) { } func TestKubernetes_SetupContainer(t *testing.T) { - // setup types - _engine, err := NewMock(_pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - // setup tests tests := []struct { - failure bool - container *pipeline.Container + failure bool + container *pipeline.Container + opts []ClientOpt + wantPrivileged bool + wantFromTemplate interface{} }{ { - failure: false, - container: _container, + failure: false, + container: _container, + opts: nil, + wantPrivileged: false, + wantFromTemplate: nil, }, { failure: false, @@ -171,6 +173,9 @@ func TestKubernetes_SetupContainer(t *testing.T) { Number: 2, Pull: "always", }, + opts: nil, + wantPrivileged: false, + wantFromTemplate: nil, }, { failure: false, @@ -185,14 +190,35 @@ func TestKubernetes_SetupContainer(t *testing.T) { Number: 2, Pull: "always", }, + opts: []ClientOpt{WithPrivilegedImages([]string{"target/vela-docker"})}, + wantPrivileged: true, + wantFromTemplate: nil, + }, + { + failure: false, + container: _container, + opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, + wantPrivileged: false, + wantFromTemplate: velav1alpha1.PipelineContainerSecurityContext{ + Capabilities: &v1.Capabilities{ + Drop: []v1.Capability{"ALL"}, + Add: []v1.Capability{"NET_ADMIN", "SYS_TIME"}, + }, + }, }, } // run tests for _, test := range tests { + // setup types + _engine, err := NewMock(_pod.DeepCopy(), test.opts...) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + // actually run the test err = _engine.SetupContainer(context.Background(), test.container) - // this does not test the resulting pod spec (ie no tests for ImagePullPolicy, VolumeMounts) + // this does not (yet) test everything in the resulting pod spec (ie no tests for ImagePullPolicy, VolumeMounts) if test.failure { if err == nil { @@ -205,6 +231,37 @@ func TestKubernetes_SetupContainer(t *testing.T) { if err != nil { t.Errorf("SetupContainer returned err: %v", err) } + + // SetupContainer added the last pod so get it for inspection + i := len(_engine.Pod.Spec.Containers) - 1 + ctn := _engine.Pod.Spec.Containers[i] + + // Make sure Container has Privileged configured correctly + if test.wantPrivileged { + if ctn.SecurityContext == nil { + t.Errorf("Pod.Containers[%v].SecurityContext is nil", i) + } else if *ctn.SecurityContext.Privileged != test.wantPrivileged { + t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) + } + } else { + if ctn.SecurityContext != nil && ctn.SecurityContext.Privileged != nil && *ctn.SecurityContext.Privileged != test.wantPrivileged { + t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) + } + } + + switch test.wantFromTemplate.(type) { + case velav1alpha1.PipelineContainerSecurityContext: + want := test.wantFromTemplate.(velav1alpha1.PipelineContainerSecurityContext) + + // PipelinePodsTemplate defined SecurityContext.Capabilities + if want.Capabilities != nil { + if ctn.SecurityContext == nil { + t.Errorf("Pod.Containers[%v].SecurityContext is nil", i) + } else if !reflect.DeepEqual(ctn.SecurityContext.Capabilities, want.Capabilities) { + t.Errorf("Pod.Containers[%v].SecurityContext.Capabilities is %v, want %v", i, ctn.SecurityContext.Capabilities, want.Capabilities) + } + } + } } } diff --git a/runtime/kubernetes/generated/clientset/versioned/clientset.go b/runtime/kubernetes/generated/clientset/versioned/clientset.go new file mode 100644 index 00000000..81cbb5d4 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/clientset.go @@ -0,0 +1,105 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + VelaV1alpha1() velav1alpha1.VelaV1alpha1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + velaV1alpha1 *velav1alpha1.VelaV1alpha1Client +} + +// VelaV1alpha1 retrieves the VelaV1alpha1Client +func (c *Clientset) VelaV1alpha1() velav1alpha1.VelaV1alpha1Interface { + return c.velaV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.velaV1alpha1, err = velav1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.velaV1alpha1 = velav1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/runtime/kubernetes/generated/clientset/versioned/doc.go b/runtime/kubernetes/generated/clientset/versioned/doc.go new file mode 100644 index 00000000..ebe2e2ee --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/doc.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/runtime/kubernetes/generated/clientset/versioned/fake/clientset_generated.go b/runtime/kubernetes/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..eaaafa77 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,73 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned" + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1" + fakevelav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// VelaV1alpha1 retrieves the VelaV1alpha1Client +func (c *Clientset) VelaV1alpha1() velav1alpha1.VelaV1alpha1Interface { + return &fakevelav1alpha1.FakeVelaV1alpha1{Fake: &c.Fake} +} diff --git a/runtime/kubernetes/generated/clientset/versioned/fake/doc.go b/runtime/kubernetes/generated/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..cdc483d7 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/runtime/kubernetes/generated/clientset/versioned/fake/register.go b/runtime/kubernetes/generated/clientset/versioned/fake/register.go new file mode 100644 index 00000000..c8a5f06d --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/fake/register.go @@ -0,0 +1,44 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + velav1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/runtime/kubernetes/generated/clientset/versioned/scheme/doc.go b/runtime/kubernetes/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000..d7ba191f --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/runtime/kubernetes/generated/clientset/versioned/scheme/register.go b/runtime/kubernetes/generated/clientset/versioned/scheme/register.go new file mode 100644 index 00000000..38f25139 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,44 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + velav1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/doc.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/doc.go new file mode 100644 index 00000000..fbb938d5 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/doc.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/doc.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/doc.go new file mode 100644 index 00000000..df959f2f --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/doc.go @@ -0,0 +1,8 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_pipelinepodstemplate.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_pipelinepodstemplate.go new file mode 100644 index 00000000..ade6f633 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_pipelinepodstemplate.go @@ -0,0 +1,118 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePipelinePodsTemplates implements PipelinePodsTemplateInterface +type FakePipelinePodsTemplates struct { + Fake *FakeVelaV1alpha1 + ns string +} + +var pipelinepodstemplatesResource = schema.GroupVersionResource{Group: "go-vela.github.io", Version: "v1alpha1", Resource: "pipelinepodstemplates"} + +var pipelinepodstemplatesKind = schema.GroupVersionKind{Group: "go-vela.github.io", Version: "v1alpha1", Kind: "PipelinePodsTemplate"} + +// Get takes name of the pipelinePodsTemplate, and returns the corresponding pipelinePodsTemplate object, and an error if there is any. +func (c *FakePipelinePodsTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(pipelinepodstemplatesResource, c.ns, name), &v1alpha1.PipelinePodsTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PipelinePodsTemplate), err +} + +// List takes label and field selectors, and returns the list of PipelinePodsTemplates that match those selectors. +func (c *FakePipelinePodsTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelinePodsTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(pipelinepodstemplatesResource, pipelinepodstemplatesKind, c.ns, opts), &v1alpha1.PipelinePodsTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.PipelinePodsTemplateList{ListMeta: obj.(*v1alpha1.PipelinePodsTemplateList).ListMeta} + for _, item := range obj.(*v1alpha1.PipelinePodsTemplateList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested pipelinePodsTemplates. +func (c *FakePipelinePodsTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(pipelinepodstemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a pipelinePodsTemplate and creates it. Returns the server's representation of the pipelinePodsTemplate, and an error, if there is any. +func (c *FakePipelinePodsTemplates) Create(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.CreateOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(pipelinepodstemplatesResource, c.ns, pipelinePodsTemplate), &v1alpha1.PipelinePodsTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PipelinePodsTemplate), err +} + +// Update takes the representation of a pipelinePodsTemplate and updates it. Returns the server's representation of the pipelinePodsTemplate, and an error, if there is any. +func (c *FakePipelinePodsTemplates) Update(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.UpdateOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(pipelinepodstemplatesResource, c.ns, pipelinePodsTemplate), &v1alpha1.PipelinePodsTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PipelinePodsTemplate), err +} + +// Delete takes name of the pipelinePodsTemplate and deletes it. Returns an error if one occurs. +func (c *FakePipelinePodsTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(pipelinepodstemplatesResource, c.ns, name, opts), &v1alpha1.PipelinePodsTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePipelinePodsTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelinepodstemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.PipelinePodsTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched pipelinePodsTemplate. +func (c *FakePipelinePodsTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PipelinePodsTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(pipelinepodstemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.PipelinePodsTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.PipelinePodsTemplate), err +} diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_vela_client.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_vela_client.go new file mode 100644 index 00000000..118423d6 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/fake/fake_vela_client.go @@ -0,0 +1,28 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeVelaV1alpha1 struct { + *testing.Fake +} + +func (c *FakeVelaV1alpha1) PipelinePodsTemplates(namespace string) v1alpha1.PipelinePodsTemplateInterface { + return &FakePipelinePodsTemplates{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeVelaV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/generated_expansion.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/generated_expansion.go new file mode 100644 index 00000000..b1acc5a5 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/generated_expansion.go @@ -0,0 +1,9 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type PipelinePodsTemplateExpansion interface{} diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/pipelinepodstemplate.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/pipelinepodstemplate.go new file mode 100644 index 00000000..ed18f335 --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/pipelinepodstemplate.go @@ -0,0 +1,166 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + scheme "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// PipelinePodsTemplatesGetter has a method to return a PipelinePodsTemplateInterface. +// A group's client should implement this interface. +type PipelinePodsTemplatesGetter interface { + PipelinePodsTemplates(namespace string) PipelinePodsTemplateInterface +} + +// PipelinePodsTemplateInterface has methods to work with PipelinePodsTemplate resources. +type PipelinePodsTemplateInterface interface { + Create(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.CreateOptions) (*v1alpha1.PipelinePodsTemplate, error) + Update(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.UpdateOptions) (*v1alpha1.PipelinePodsTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PipelinePodsTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PipelinePodsTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PipelinePodsTemplate, err error) + PipelinePodsTemplateExpansion +} + +// pipelinePodsTemplates implements PipelinePodsTemplateInterface +type pipelinePodsTemplates struct { + client rest.Interface + ns string +} + +// newPipelinePodsTemplates returns a PipelinePodsTemplates +func newPipelinePodsTemplates(c *VelaV1alpha1Client, namespace string) *pipelinePodsTemplates { + return &pipelinePodsTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the pipelinePodsTemplate, and returns the corresponding pipelinePodsTemplate object, and an error if there is any. +func (c *pipelinePodsTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + result = &v1alpha1.PipelinePodsTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PipelinePodsTemplates that match those selectors. +func (c *pipelinePodsTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelinePodsTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PipelinePodsTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested pipelinePodsTemplates. +func (c *pipelinePodsTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a pipelinePodsTemplate and creates it. Returns the server's representation of the pipelinePodsTemplate, and an error, if there is any. +func (c *pipelinePodsTemplates) Create(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.CreateOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + result = &v1alpha1.PipelinePodsTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipelinePodsTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a pipelinePodsTemplate and updates it. Returns the server's representation of the pipelinePodsTemplate, and an error, if there is any. +func (c *pipelinePodsTemplates) Update(ctx context.Context, pipelinePodsTemplate *v1alpha1.PipelinePodsTemplate, opts v1.UpdateOptions) (result *v1alpha1.PipelinePodsTemplate, err error) { + result = &v1alpha1.PipelinePodsTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + Name(pipelinePodsTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipelinePodsTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the pipelinePodsTemplate and deletes it. Returns an error if one occurs. +func (c *pipelinePodsTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *pipelinePodsTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched pipelinePodsTemplate. +func (c *pipelinePodsTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PipelinePodsTemplate, err error) { + result = &v1alpha1.PipelinePodsTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("pipelinepodstemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/vela_client.go b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/vela_client.go new file mode 100644 index 00000000..425899ae --- /dev/null +++ b/runtime/kubernetes/generated/clientset/versioned/typed/vela/v1alpha1/vela_client.go @@ -0,0 +1,95 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type VelaV1alpha1Interface interface { + RESTClient() rest.Interface + PipelinePodsTemplatesGetter +} + +// VelaV1alpha1Client is used to interact with features provided by the go-vela.github.io group. +type VelaV1alpha1Client struct { + restClient rest.Interface +} + +func (c *VelaV1alpha1Client) PipelinePodsTemplates(namespace string) PipelinePodsTemplateInterface { + return newPipelinePodsTemplates(c, namespace) +} + +// NewForConfig creates a new VelaV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*VelaV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new VelaV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*VelaV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &VelaV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new VelaV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *VelaV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new VelaV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *VelaV1alpha1Client { + return &VelaV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *VelaV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/runtime/kubernetes/generated/go-vela.github.io_pipelinepodstemplates.yaml b/runtime/kubernetes/generated/go-vela.github.io_pipelinepodstemplates.yaml new file mode 100644 index 00000000..bc938146 --- /dev/null +++ b/runtime/kubernetes/generated/go-vela.github.io_pipelinepodstemplates.yaml @@ -0,0 +1,1148 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: pipelinepodstemplates.go-vela.github.io +spec: + group: go-vela.github.io + names: + kind: PipelinePodsTemplate + listKind: PipelinePodsTemplateList + plural: pipelinepodstemplates + singular: pipelinepodstemplate + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: PipelinePodsTemplate defines the config for a given worker. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the PipelinePodsTemplate configuration for Vela + Workers. + properties: + template: + description: Template defines defaults for Pipeline Pod creation in + Vela Workers. + properties: + metadata: + description: 'Metadata contains a subset of the standard object + metadata (see: metav1.ObjectMeta).' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is a key value map of strings to + store additional info on pods. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Labels is a key value map of strings to organize + and categorize pods. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + spec: + description: 'Spec contains a subset of the pod configuration + options (see: v1.PodSpec).' + properties: + affinity: + description: Affinity specifies the pipeline pod's scheduling + constraints, if any. + properties: + nodeAffinity: + description: Describes node affinity scheduling rules + for the pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule + pods to nodes that satisfy the affinity expressions + specified by this field, but it may choose a node + that violates one or more of the expressions. The + node that is most preferred is the one with the + greatest sum of weights, i.e. for each node that + meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if + the node matches the corresponding matchExpressions; + the node(s) with the highest sum are the most preferred. + items: + description: An empty preferred scheduling term + matches all objects with implicit weight 0 (i.e. + it's a no-op). A null preferred scheduling term + matches no objects (i.e. is also a no-op). + properties: + preference: + description: A node selector term, associated + with the corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. + If the operator is Gt or Lt, the + values array must have a single + element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. + If the operator is Gt or Lt, the + values array must have a single + element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + description: Weight associated with matching + the corresponding nodeSelectorTerm, in the + range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the + affinity requirements specified by this field cease + to be met at some point during pod execution (e.g. + due to an update), the system may or may not try + to eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector + terms. The terms are ORed. + items: + description: A null or empty node selector term + matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements + a subset of the NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. + If the operator is Gt or Lt, the + values array must have a single + element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: The label key that the + selector applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. + If the operator is Gt or Lt, the + values array must have a single + element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. + co-locate this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule + pods to nodes that satisfy the affinity expressions + specified by this field, but it may choose a node + that violates one or more of the expressions. The + node that is most preferred is the one with the + greatest sum of weights, i.e. for each node that + meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if + the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest sum + are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, + associated with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of + resources, in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. + This array is replaced during + a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of + {key,value} pairs. A single {key,value} + in the matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are + ANDed. + type: object + type: object + namespaceSelector: + description: A label query over the set + of namespaces that the term applies to. + The term is applied to the union of the + namespaces selected by this field and + the ones listed in the namespaces field. + null selector and null or empty namespaces + list means "this pod's namespace". An + empty selector ({}) matches all namespaces. + This field is beta-level and is only honored + when PodAffinityNamespaceSelector feature + is enabled. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. + This array is replaced during + a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of + {key,value} pairs. A single {key,value} + in the matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are + ANDed. + type: object + type: object + namespaces: + description: namespaces specifies a static + list of namespace names that the term + applies to. The term is applied to the + union of the namespaces listed in this + field and the ones selected by namespaceSelector. + null or empty namespaces list and null + namespaceSelector means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose + value of the label with key topologyKey + matches that of any node on which any + of the selected pods is running. Empty + topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching + the corresponding podAffinityTerm, in the + range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the + affinity requirements specified by this field cease + to be met at some point during pod execution (e.g. + due to a pod label update), the system may or may + not try to eventually evict the pod from its node. + When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, + i.e. all terms must be satisfied. + items: + description: Defines a set of pods (namely those + matching the labelSelector relative to the given + namespace(s)) that this pod should be co-located + (affinity) or not co-located (anti-affinity) with, + where co-located is defined as running on a node + whose value of the label with key + matches that of any node on which a pod of the + set of pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by + this field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. This + field is beta-level and is only honored when + PodAffinityNamespaceSelector feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected + by namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the + pods matching the labelSelector in the specified + namespaces, where co-located is defined as + running on a node whose value of the label + with key topologyKey matches that of any node + on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules + (e.g. avoid putting this pod in the same node, zone, + etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule + pods to nodes that satisfy the anti-affinity expressions + specified by this field, but it may choose a node + that violates one or more of the expressions. The + node that is most preferred is the one with the + greatest sum of weights, i.e. for each node that + meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity + expressions, etc.), compute a sum by iterating through + the elements of this field and adding "weight" to + the sum if the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest sum + are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, + associated with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of + resources, in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. + This array is replaced during + a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of + {key,value} pairs. A single {key,value} + in the matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are + ANDed. + type: object + type: object + namespaceSelector: + description: A label query over the set + of namespaces that the term applies to. + The term is applied to the union of the + namespaces selected by this field and + the ones listed in the namespaces field. + null selector and null or empty namespaces + list means "this pod's namespace". An + empty selector ({}) matches all namespaces. + This field is beta-level and is only honored + when PodAffinityNamespaceSelector feature + is enabled. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The + requirements are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to a set + of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. + This array is replaced during + a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of + {key,value} pairs. A single {key,value} + in the matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are + ANDed. + type: object + type: object + namespaces: + description: namespaces specifies a static + list of namespace names that the term + applies to. The term is applied to the + union of the namespaces listed in this + field and the ones selected by namespaceSelector. + null or empty namespaces list and null + namespaceSelector means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where co-located + is defined as running on a node whose + value of the label with key topologyKey + matches that of any node on which any + of the selected pods is running. Empty + topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching + the corresponding podAffinityTerm, in the + range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified + by this field are not met at scheduling time, the + pod will not be scheduled onto the node. If the + anti-affinity requirements specified by this field + cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may + or may not try to eventually evict the pod from + its node. When there are multiple elements, the + lists of nodes corresponding to each podAffinityTerm + are intersected, i.e. all terms must be satisfied. + items: + description: Defines a set of pods (namely those + matching the labelSelector relative to the given + namespace(s)) that this pod should be co-located + (affinity) or not co-located (anti-affinity) with, + where co-located is defined as running on a node + whose value of the label with key + matches that of any node on which a pod of the + set of pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + namespaceSelector: + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by + this field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. This + field is beta-level and is only honored when + PodAffinityNamespaceSelector feature is enabled. + properties: + matchExpressions: + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key + that the selector applies to. + type: string + operator: + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected + by namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the + pods matching the labelSelector in the specified + namespaces, where co-located is defined as + running on a node whose value of the label + with key topologyKey matches that of any node + on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + container: + description: Container defines a limited set of defaults to + apply to each PipelinePodsTemplate container. This is analogous + to one entry in v1.PodSpec.Containers. + properties: + securityContext: + description: 'SecurityContext defines the security options + the container should be run with. If set, the fields + of SecurityContext override the equivalent fields of + PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + capabilities: + description: Capabilities contains the capabilities + to add/drop when running containers. Defaults to + the default set of capabilities granted by the container + runtime. Note that this field cannot be set when + spec.os.name is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX capabilities + type + type: string + type: array + type: object + type: object + type: object + dnsConfig: + description: DNSConfig specifies the DNS parameters of a pod. + Parameters specified here will be merged to the generated + DNS configuration based on DNSPolicy. + properties: + nameservers: + description: A list of DNS name server IP addresses. This + will be appended to the base nameservers generated from + DNSPolicy. Duplicated nameservers will be removed. + items: + type: string + type: array + options: + description: A list of DNS resolver options. This will + be merged with the base options generated from DNSPolicy. + Duplicated entries will be removed. Resolution options + given in Options will override those that appear in + the base DNSPolicy. + items: + description: PodDNSConfigOption defines DNS resolver + options of a pod. + properties: + name: + description: Required. + type: string + value: + type: string + type: object + type: array + searches: + description: A list of DNS search domains for host-name + lookup. This will be appended to the base search paths + generated from DNSPolicy. Duplicated search paths will + be removed. + items: + type: string + type: array + type: object + dnsPolicy: + description: DNSPolicy sets DNS policy for the pipeline pod. + Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', + 'ClusterFirst', 'Default' or 'None'. + enum: + - ClusterFirstWithHostNet + - ClusterFirst + - Default + - None + type: string + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true + for the pipeline pod to fit on a node. Selector which must + match a node''s labels for the pod to be scheduled on that + node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + type: object + x-kubernetes-map-type: atomic + securityContext: + description: 'SecurityContext holds pod-level security attributes + and common container settings. Optional: Defaults to empty. See + type description for default values of each field.' + properties: + runAsNonRoot: + description: RunAsNonRoot indicates that the container + must run as a non-root user. If true, the Kubelet will + validate the image at runtime to ensure that it does + not run as UID 0 (root) and fail to start the container + if it does. If unset or false, no such validation will + be performed. + type: boolean + sysctls: + description: Sysctls hold a list of namespaced sysctls + used for the pod. Pods with unsupported sysctls (by + the container runtime) might fail to launch. Note that + this field cannot be set when spec.os.name is windows. + items: + description: Sysctl defines a kernel parameter to be + set + properties: + name: + description: Name of a property to set + type: string + value: + description: Value of a property to set + type: string + required: + - name + - value + type: object + type: array + type: object + tolerations: + description: Affinity specifies the pipeline pod's tolerations, + if any. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, + allowed values are NoSchedule, PreferNoSchedule and + NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. If the + key is empty, operator must be Exists; this combination + means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and Equal. + Defaults to Equal. Exists is equivalent to wildcard + for value, so that a pod can tolerate all taints of + a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period + of time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the + taint forever (do not evict). Zero and negative values + will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value should + be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + type: object + required: + - template + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 99b27cf0..9846bbd0 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -6,12 +6,17 @@ package kubernetes import ( "github.com/sirupsen/logrus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + velaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned" + fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" ) type config struct { @@ -23,16 +28,22 @@ type config struct { Images []string // specifies a list of host volumes to use for the Kubernetes client Volumes []string + // PipelinePodsTemplateName has the name of the PipelinePodTemplate to retrieve from the Namespace + PipelinePodsTemplateName string } type client struct { config *config // https://pkg.go.dev/k8s.io/client-go/kubernetes#Interface Kubernetes kubernetes.Interface + // VelaKubernetes is a client for custom Vela CRD-based APIs + VelaKubernetes velaK8sClient.Interface // https://pkg.go.dev/github.com/sirupsen/logrus#Entry Logger *logrus.Entry // https://pkg.go.dev/k8s.io/api/core/v1#Pod Pod *v1.Pod + // PipelinePodTemplate has default values to be used in Setup* methods + PipelinePodTemplate *velav1alpha1.PipelinePodTemplate // commonVolumeMounts includes workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) commonVolumeMounts []v1.VolumeMount // indicates when the pod has been created in kubernetes @@ -104,6 +115,15 @@ func New(opts ...ClientOpt) (*client, error) { // set the Kubernetes client in the runtime client c.Kubernetes = _kubernetes + // creates VelaKubernetes client from configuration + _velaKubernetes, err := velaK8sClient.NewForConfig(config) + if err != nil { + return nil, err + } + + // set the VelaKubernetes client in the runtime client + c.VelaKubernetes = _velaKubernetes + return c, nil } @@ -150,5 +170,15 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset c.Kubernetes = fake.NewSimpleClientset(c.Pod) + // set the VelaKubernetes fake client in the runtime client + c.VelaKubernetes = fakeVelaK8sClient.NewSimpleClientset( + &velav1alpha1.PipelinePodsTemplate{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: c.config.Namespace, + Name: "mock-pipeline-pods-template", + }, + }, + ) + return c, nil } diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go index ccfd09a6..c562d9f1 100644 --- a/runtime/kubernetes/opts.go +++ b/runtime/kubernetes/opts.go @@ -6,8 +6,16 @@ package kubernetes import ( "fmt" + "io/ioutil" "github.com/sirupsen/logrus" + + // The k8s libraries have some quirks around yaml marshaling. + // They use `json` instead of `yaml` to annotate their struct Tags. + // So, we need to use "sigs.k8s.io/yaml" instead of "github.com/buildkite/yaml". + "sigs.k8s.io/yaml" + + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) // ClientOpt represents a configuration option to initialize the runtime client for Kubernetes. @@ -69,6 +77,41 @@ func WithNamespace(namespace string) ClientOpt { } } +// WithPodsTemplate sets the PipelinePodsTemplateName or loads the PipelinePodsTemplate +// from file in the runtime client for Kubernetes. +func WithPodsTemplate(name string, path string) ClientOpt { + return func(c *client) error { + c.Logger.Trace("configuring pipeline pods template in kubernetes runtime client") + + // check if a PipelinePodsTemplate was requested + if len(name) == 0 && len(path) == 0 { + // no PipelinePodTemplate to load + return nil + } + + if len(name) == 0 { + // load the PodsTemplate from the path (must restart Worker to reload the local file) + if data, err := ioutil.ReadFile(path); err == nil { + pipelinePodsTemplate := velav1alpha1.PipelinePodsTemplate{} + + err := yaml.UnmarshalStrict(data, &pipelinePodsTemplate) + if err != nil { + return err + } + + c.PipelinePodTemplate = &pipelinePodsTemplate.Spec.Template + } + + return nil + } + + // set the runtime namespace in the kubernetes client for just-in-time retrieval + c.config.PipelinePodsTemplateName = name + + return nil + } +} + // WithPrivilegedImages sets the privileged images in the runtime client for Kubernetes. func WithPrivilegedImages(images []string) ClientOpt { return func(c *client) error { diff --git a/runtime/kubernetes/opts_test.go b/runtime/kubernetes/opts_test.go index f1131cee..cf17624c 100644 --- a/runtime/kubernetes/opts_test.go +++ b/runtime/kubernetes/opts_test.go @@ -5,9 +5,12 @@ package kubernetes import ( - "github.com/sirupsen/logrus" "reflect" "testing" + + "github.com/sirupsen/logrus" + + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) func TestKubernetes_ClientOpt_WithConfigFile(t *testing.T) { @@ -207,3 +210,94 @@ func TestKubernetes_ClientOpt_WithLogger(t *testing.T) { } } } + +func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { + // setup tests + tests := []struct { + failure bool + podsTemplateName string + podsTemplatePath string + wantName string + wantTemplate *velav1alpha1.PipelinePodTemplate + }{ + { + failure: false, + podsTemplateName: "foo-bar-name", + podsTemplatePath: "", + wantName: "foo-bar-name", + wantTemplate: nil, + }, + { + failure: false, + podsTemplateName: "", + podsTemplatePath: "", + wantName: "", + wantTemplate: nil, + }, + { + failure: false, // ignores missing files; can be added later + podsTemplateName: "", + podsTemplatePath: "testdata/does-not-exist.yaml", + wantName: "", + wantTemplate: nil, + }, + { + failure: false, + podsTemplateName: "", + podsTemplatePath: "testdata/pipeline-pods-template-empty.yaml", + wantName: "", + wantTemplate: &velav1alpha1.PipelinePodTemplate{}, + }, + { + failure: false, + podsTemplateName: "", + podsTemplatePath: "testdata/pipeline-pods-template.yaml", + wantName: "", + wantTemplate: &velav1alpha1.PipelinePodTemplate{ + Metadata: velav1alpha1.PipelinePodTemplateMeta{ + Annotations: map[string]string{"annotation/foo": "bar"}, + Labels: map[string]string{ + "foo": "bar", + "pipeline": "this-is-ignored", // loaded in opts. Ignored in SetupBuild. + }, + }, + }, + }, + { + failure: true, + podsTemplateName: "", + podsTemplatePath: "testdata/pipeline-pods-template-malformed.yaml", + wantName: "", + wantTemplate: nil, + }, + } + + // run tests + for _, test := range tests { + _engine, err := New( + WithConfigFile("testdata/config"), + WithNamespace("foo"), + WithPodsTemplate(test.podsTemplateName, test.podsTemplatePath), + ) + + if test.failure { + if err == nil { + t.Errorf("WithPodsTemplate should have returned err") + } + + continue + } + + if err != nil { + t.Errorf("WithPodsTemplate returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.PipelinePodsTemplateName, test.wantName) { + t.Errorf("WithPodsTemplate is %v, wantName %v", _engine.config.PipelinePodsTemplateName, test.wantName) + } + + if test.wantTemplate != nil && !reflect.DeepEqual(_engine.PipelinePodTemplate, test.wantTemplate) { + t.Errorf("WithPodsTemplate is %v, wantTemplate %v", _engine.PipelinePodTemplate, test.wantTemplate) + } + } +} diff --git a/runtime/kubernetes/testdata/pipeline-pods-template-dns.yaml b/runtime/kubernetes/testdata/pipeline-pods-template-dns.yaml new file mode 100644 index 00000000..31194d8a --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template-dns.yaml @@ -0,0 +1,19 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template +spec: + template: + spec: + # https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config + dnsPolicy: "None" + dnsConfig: + nameservers: + - 1.2.3.4 + searches: + - ns1.svc.cluster-domain.example + - my.dns.search.suffix + options: + - name: ndots + value: "2" + - name: edns0 diff --git a/runtime/kubernetes/testdata/pipeline-pods-template-empty.yaml b/runtime/kubernetes/testdata/pipeline-pods-template-empty.yaml new file mode 100644 index 00000000..d88e996e --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template-empty.yaml @@ -0,0 +1,6 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template-empty +spec: + template: {} diff --git a/runtime/kubernetes/testdata/pipeline-pods-template-malformed.yaml b/runtime/kubernetes/testdata/pipeline-pods-template-malformed.yaml new file mode 100644 index 00000000..79f003c4 --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template-malformed.yaml @@ -0,0 +1,11 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template +spec: + template: + metadata: + annotations: + # annotations is a map[string]string, so this is malformed. + - name: annotation/foo + value: bar diff --git a/runtime/kubernetes/testdata/pipeline-pods-template-node-selection.yaml b/runtime/kubernetes/testdata/pipeline-pods-template-node-selection.yaml new file mode 100644 index 00000000..a262548b --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template-node-selection.yaml @@ -0,0 +1,64 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template +spec: + template: + spec: + # nodeName is not supported. Using nodeSelector or affinity should be sufficient. + # nodeName: foo-node + + # https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/#create-a-pod-that-gets-scheduled-to-your-chosen-node + nodeSelector: + disktype: ssd + + affinity: + # https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + preference: + matchExpressions: + - key: another-node-label-key + operator: In + values: + - another-node-label-value + # https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: security + operator: In + values: + - S1 + topologyKey: topology.kubernetes.io/zone + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: security + operator: In + values: + - S2 + topologyKey: topology.kubernetes.io/zone + + # https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ + tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoExecute" diff --git a/runtime/kubernetes/testdata/pipeline-pods-template-security-context.yaml b/runtime/kubernetes/testdata/pipeline-pods-template-security-context.yaml new file mode 100644 index 00000000..2ba87113 --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template-security-context.yaml @@ -0,0 +1,23 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template +spec: + template: + spec: + securityContext: + runAsNonRoot: true + sysctls: + # https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ + - name: kernel.shm_rmid_forced + value: "0" + - name: net.core.somaxconn + value: "1024" + - name: kernel.msgmax + value: "65536" + container: + securityContext: + capabilities: + # https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container + drop: ["ALL"] + add: ["NET_ADMIN","SYS_TIME"] diff --git a/runtime/kubernetes/testdata/pipeline-pods-template.yaml b/runtime/kubernetes/testdata/pipeline-pods-template.yaml new file mode 100644 index 00000000..2f628817 --- /dev/null +++ b/runtime/kubernetes/testdata/pipeline-pods-template.yaml @@ -0,0 +1,13 @@ +apiVersion: "go-vela.github.io/v1alpha1" +kind: PipelinePodsTemplate +metadata: + name: pipeline-pods-template +spec: + template: + metadata: + annotations: + annotation/foo: bar + labels: + foo: bar + # attempting to override worker-provided labels will be ignored. + pipeline: this-is-ignored diff --git a/runtime/setup.go b/runtime/setup.go index 06a344f5..3a88c75a 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -32,6 +32,10 @@ type Setup struct { HostVolumes []string // specifies the namespace to use for the runtime client (only used by kubernetes) Namespace string + // specifies the name of the PipelinePodsTemplate to retrieve from the given namespace (only used by kubernetes) + PodsTemplateName string + // specifies the fallback path of a PipelinePodsTemplate in a local YAML file (only used by kubernetes; only used if PodsTemplateName not defined) + PodsTemplateFile string // specifies a list of privileged images to use for the runtime client PrivilegedImages []string } @@ -63,6 +67,7 @@ func (s *Setup) Kubernetes() (Engine, error) { kubernetes.WithConfigFile(s.ConfigFile), kubernetes.WithHostVolumes(s.HostVolumes), kubernetes.WithNamespace(s.Namespace), + kubernetes.WithPodsTemplate(s.PodsTemplateName, s.PodsTemplateFile), kubernetes.WithPrivilegedImages(s.PrivilegedImages), kubernetes.WithLogger(s.Logger), ) From ad71dcb80e05e56ac7fdbd30f601e3ad903ebc99 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 11:31:16 -0500 Subject: [PATCH 264/430] chore(deps): update codecov/codecov-action action to v3 (#298) Co-authored-by: Renovate Bot Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d9bd91c..f22da773 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: go test -covermode=atomic -coverprofile=coverage.out ./... - name: coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} file: coverage.out From e123b14779c2743090581cd338e7c6cc4674f814 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 18:17:02 +0000 Subject: [PATCH 265/430] fix(deps): update module sigs.k8s.io/yaml to v1.3.0 (#301) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 33762e47..c0b9378f 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( k8s.io/api v0.23.5 k8s.io/apimachinery v0.23.5 k8s.io/client-go v0.23.5 - sigs.k8s.io/yaml v1.2.0 + sigs.k8s.io/yaml v1.3.0 ) require ( diff --git a/go.sum b/go.sum index e16deace..b4927198 100644 --- a/go.sum +++ b/go.sum @@ -1084,5 +1084,6 @@ sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNza sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From cb693b793f414e508f9b21e385cbbf63faa4377d Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 15 Apr 2022 19:59:49 -0500 Subject: [PATCH 266/430] refactor: silence lint issues (#307) --- executor/context_test.go | 6 +++--- mock/docker/docker.go | 1 + runtime/context_test.go | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/executor/context_test.go b/executor/context_test.go index 10607ba9..f8da2697 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -55,7 +55,7 @@ func TestExecutor_FromContext(t *testing.T) { want Engine }{ { - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -64,7 +64,7 @@ func TestExecutor_FromContext(t *testing.T) { want: nil, }, { - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -173,7 +173,7 @@ func TestExecutor_WithContext(t *testing.T) { t.Errorf("unable to create linux engine: %v", err) } - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test diff --git a/mock/docker/docker.go b/mock/docker/docker.go index 5b6a0604..eab1fb7b 100644 --- a/mock/docker/docker.go +++ b/mock/docker/docker.go @@ -23,6 +23,7 @@ const Version = "v1.40" // New returns a client that is capable of handling // Docker client calls and returning stub responses. +// nolint:revive // ignore unexported type as it is intentional func New() (*mock, error) { return &mock{ ConfigService: ConfigService{}, diff --git a/runtime/context_test.go b/runtime/context_test.go index 6145d73f..0e1dd9f7 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -29,7 +29,7 @@ func TestRuntime_FromContext(t *testing.T) { want Engine }{ { - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -38,7 +38,7 @@ func TestRuntime_FromContext(t *testing.T) { want: nil, }, { - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -109,7 +109,7 @@ func TestRuntime_WithContext(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } - // nolint: staticcheck // ignore using string with context value + // nolint: staticcheck,revive // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test From 44f6df7d592cfbb472c45e5bc9802e5f930b1ba8 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 15 Apr 2022 20:04:15 -0500 Subject: [PATCH 267/430] bugfix(k8s): add newline to init step output (#309) --- runtime/kubernetes/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index 5023deaf..b93e88ad 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -23,7 +23,7 @@ import ( func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) { c.Logger.Tracef("inspecting build pod for pipeline %s", b.ID) - output := []byte(fmt.Sprintf("> Inspecting pod for pipeline %s", b.ID)) + output := []byte(fmt.Sprintf("> Inspecting pod for pipeline %s\n", b.ID)) // TODO: The environment gets populated in AssembleBuild, after InspectBuild runs. // But, we should make sure that secrets can't be leaked here anyway. From c6104d49b76aec70206049a28445e5d8cb02a6b2 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 15 Apr 2022 20:09:38 -0500 Subject: [PATCH 268/430] revert(k8s): Revert go-vela/pkg-runtime#151 (#306) --- runtime/kubernetes/container.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 8d1a0e04..79748a2c 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -241,15 +241,8 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodLogOptions opts := &v1.PodLogOptions{ - Container: ctn.ID, - Follow: true, - // steps can exit quickly, and might be gone before - // log tailing has started, so we need to request - // logs for previously exited containers as well. - // Pods get deleted after job completion, and names for - // pod+container don't get reused. So, previous - // should only retrieve logs for the current build step. - Previous: true, + Container: ctn.ID, + Follow: true, Timestamps: false, } From cdfa36c2b428f47a19b590d98950638bf4881fb2 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 15 Apr 2022 20:21:10 -0500 Subject: [PATCH 269/430] bugfix(k8s): avoid InspectContainer panic where container is not Terminated (#308) --- runtime/kubernetes/container.go | 20 ++++++++- runtime/kubernetes/container_test.go | 61 ++++++++++++++++++++-------- runtime/kubernetes/image.go | 5 ++- 3 files changed, 68 insertions(+), 18 deletions(-) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 79748a2c..7f6ffbc7 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -54,6 +54,24 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) continue } + // avoid a panic if the build ends without terminating all containers + if cst.State.Terminated == nil { + for _, container := range pod.Spec.Containers { + if cst.Name != container.Name { + continue + } + + // steps that were not executed will still be "running" the pause image as expected. + if container.Image == pauseImage { + return nil + } + + break + } + + return fmt.Errorf("expected container %s to be terminated, got %v", ctn.ID, cst.State) + } + // set the step exit code ctn.ExitCode = int(cst.State.Terminated.ExitCode) @@ -122,7 +140,7 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er // the containers with the proper image. // // https://hub.docker.com/r/kubernetes/pause - Image: image.Parse("kubernetes/pause:latest"), + Image: image.Parse(pauseImage), Env: []v1.EnvVar{}, Stdin: false, StdinOnce: false, diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 89cf4f15..7b2b5e2e 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -18,42 +18,71 @@ import ( ) func TestKubernetes_InspectContainer(t *testing.T) { - // setup types - _engine, err := NewMock(_pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - // setup tests tests := []struct { + name string failure bool + pod *v1.Pod container *pipeline.Container }{ { + name: "build container", failure: false, + pod: _pod, container: _container, }, { + name: "empty build container", failure: false, + pod: _pod, container: new(pipeline.Container), }, + { + name: "container not terminated", + failure: true, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + }, + }, + }, + }, + container: _container, + }, } // run tests for _, test := range tests { - err = _engine.InspectContainer(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("InspectContainer should have returned err") + t.Run(test.name, func(t *testing.T) { + // setup types + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) } - continue - } + err = _engine.InspectContainer(context.Background(), test.container) - if err != nil { - t.Errorf("InspectContainer returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("InspectContainer should have returned err") + } + + return // effectively "continue" to next test + } + + if err != nil { + t.Errorf("InspectContainer returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index c0f88dc9..b24c36f0 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -14,7 +14,9 @@ import ( "github.com/go-vela/types/pipeline" ) -const imagePatch = ` +const ( + pauseImage = "kubernetes/pause:latest" + imagePatch = ` { "spec": { "containers": [ @@ -26,6 +28,7 @@ const imagePatch = ` } } ` +) // CreateImage creates the pipeline container image. func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error { From cc7360de9f0ad4ba716ef3a4a1bac3746501b755 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 18 Apr 2022 16:21:41 -0500 Subject: [PATCH 270/430] tests: Convert runtime tests to subtests (#312) --- runtime/context_test.go | 34 ++-- runtime/docker/build_test.go | 112 ++++++----- runtime/docker/container_test.go | 182 +++++++++++------- runtime/docker/docker_test.go | 35 ++-- runtime/docker/image_test.go | 26 ++- runtime/docker/network_test.go | 75 +++++--- runtime/docker/opts_test.go | 87 +++++---- runtime/docker/volume_test.go | 75 +++++--- runtime/kubernetes/build_test.go | 260 +++++++++++++++----------- runtime/kubernetes/container_test.go | 227 ++++++++++++---------- runtime/kubernetes/image_test.go | 24 ++- runtime/kubernetes/kubernetes_test.go | 32 ++-- runtime/kubernetes/network_test.go | 75 +++++--- runtime/kubernetes/opts_test.go | 240 ++++++++++++++---------- runtime/kubernetes/volume_test.go | 83 ++++---- runtime/runtime_test.go | 27 ++- runtime/setup_test.go | 27 ++- 17 files changed, 964 insertions(+), 657 deletions(-) diff --git a/runtime/context_test.go b/runtime/context_test.go index 0e1dd9f7..f7e45310 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -25,19 +25,23 @@ func TestRuntime_FromContext(t *testing.T) { // setup tests tests := []struct { + name string context context.Context want Engine }{ { + name: "valid runtime in context", // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, { + name: "runtime not in context", context: context.Background(), want: nil, }, { + name: "invalid runtime in context", // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, @@ -46,11 +50,13 @@ func TestRuntime_FromContext(t *testing.T) { // run tests for _, test := range tests { - got := FromContext(test.context) + t.Run(test.name, func(t *testing.T) { + got := FromContext(test.context) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("FromContext is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromContext is %v, want %v", got, test.want) + } + }) } } @@ -65,21 +71,25 @@ func TestRuntime_FromGinContext(t *testing.T) { // setup tests tests := []struct { + name string context *gin.Context value interface{} want Engine }{ { + name: "valid runtime in context", context: new(gin.Context), value: _engine, want: _engine, }, { + name: "runtime not in context", context: new(gin.Context), value: nil, want: nil, }, { + name: "invalid runtime in context", context: new(gin.Context), value: "foo", want: nil, @@ -88,15 +98,17 @@ func TestRuntime_FromGinContext(t *testing.T) { // run tests for _, test := range tests { - if test.value != nil { - test.context.Set(key, test.value) - } + t.Run(test.name, func(t *testing.T) { + if test.value != nil { + test.context.Set(key, test.value) + } - got := FromGinContext(test.context) + got := FromGinContext(test.context) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("FromGinContext is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromGinContext is %v, want %v", got, test.want) + } + }) } } diff --git a/runtime/docker/build_test.go b/runtime/docker/build_test.go index 685d5238..35b61dae 100644 --- a/runtime/docker/build_test.go +++ b/runtime/docker/build_test.go @@ -20,10 +20,12 @@ func TestDocker_InspectBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, @@ -31,19 +33,21 @@ func TestDocker_InspectBuild(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectBuild(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectBuild returned err: %v", err) - } + if err != nil { + t.Errorf("InspectBuild returned err: %v", err) + } + }) } } @@ -56,10 +60,12 @@ func TestDocker_SetupBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, @@ -67,29 +73,33 @@ func TestDocker_SetupBuild(t *testing.T) { // run tests for _, test := range tests { - err = _engine.SetupBuild(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.SetupBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("SetupBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("SetupBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("SetupBuild returned err: %v", err) - } + if err != nil { + t.Errorf("SetupBuild returned err: %v", err) + } + }) } } func TestDocker_AssembleBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, @@ -97,34 +107,38 @@ func TestDocker_AssembleBuild(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock() - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - err = _engine.AssembleBuild(context.Background(), test.pipeline) + err = _engine.AssembleBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("AssembleBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("AssembleBuild returned err: %v", err) - } + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + }) } } func TestDocker_RemoveBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, @@ -132,23 +146,25 @@ func TestDocker_RemoveBuild(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock() - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - err = _engine.RemoveBuild(context.Background(), test.pipeline) + err = _engine.RemoveBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveBuild returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveBuild returned err: %v", err) + } + }) } } diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index da704f0f..0f98ec1a 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -20,14 +20,17 @@ func TestDocker_InspectContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "build container", failure: false, container: _container, }, { + name: "empty build container", failure: true, container: new(pipeline.Container), }, @@ -35,19 +38,21 @@ func TestDocker_InspectContainer(t *testing.T) { // run tests for _, test := range tests { - err = _engine.InspectContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + err = _engine.InspectContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("InspectContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectContainer returned err: %v", err) - } + if err != nil { + t.Errorf("InspectContainer returned err: %v", err) + } + }) } } @@ -60,18 +65,22 @@ func TestDocker_RemoveContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "build container", failure: false, container: _container, }, { + name: "empty build container", failure: true, container: new(pipeline.Container), }, { + name: "absent build container", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_ignorenotfound", @@ -87,19 +96,21 @@ func TestDocker_RemoveContainer(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("RemoveContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveContainer returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveContainer returned err: %v", err) + } + }) } } @@ -112,17 +123,20 @@ func TestDocker_RunContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build container *pipeline.Container volumes []string }{ { + name: "steps-clone step", failure: false, pipeline: _pipeline, container: _container, }, { + name: "steps-echo step", failure: false, pipeline: _pipeline, container: &pipeline.Container{ @@ -138,6 +152,7 @@ func TestDocker_RunContainer(t *testing.T) { }, }, { + name: "steps-privileged", failure: false, pipeline: _pipeline, container: &pipeline.Container{ @@ -153,6 +168,7 @@ func TestDocker_RunContainer(t *testing.T) { }, }, { + name: "steps-kaniko-volumes", failure: false, pipeline: _pipeline, container: &pipeline.Container{ @@ -169,11 +185,13 @@ func TestDocker_RunContainer(t *testing.T) { volumes: []string{"/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:rw"}, }, { + name: "steps-empty build container", failure: true, pipeline: _pipeline, container: new(pipeline.Container), }, { + name: "steps-absent build container", failure: true, pipeline: _pipeline, container: &pipeline.Container{ @@ -187,6 +205,7 @@ func TestDocker_RunContainer(t *testing.T) { }, }, { + name: "steps-user-absent build container", failure: true, pipeline: _pipeline, container: &pipeline.Container{ @@ -200,27 +219,46 @@ func TestDocker_RunContainer(t *testing.T) { User: "foo", }, }, + { + name: "steps-user-echo step", + failure: false, + pipeline: _pipeline, + container: &pipeline.Container{ + ID: "step_github_octocat_1_echo", + Commands: []string{"echo", "hello"}, + Directory: "/vela/src/github.com/octocat/helloworld", + Environment: map[string]string{"FOO": "bar"}, + Entrypoint: []string{"/bin/sh", "-c"}, + Image: "alpine:latest", + Name: "echo", + Number: 2, + Pull: "always", + User: "foo", + }, + }, } // run tests for _, test := range tests { - if len(test.volumes) > 0 { - _engine.config.Volumes = test.volumes - } + t.Run(test.name, func(t *testing.T) { + if len(test.volumes) > 0 { + _engine.config.Volumes = test.volumes + } - err = _engine.RunContainer(context.Background(), test.container, test.pipeline) + err = _engine.RunContainer(context.Background(), test.container, test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RunContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RunContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RunContainer returned err: %v", err) - } + if err != nil { + t.Errorf("RunContainer returned err: %v", err) + } + }) } } @@ -233,14 +271,17 @@ func TestDocker_SetupContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "pull-always-tag_exists", failure: false, container: _container, }, { + name: "pull-not_present-tag_exists", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_clone", @@ -253,6 +294,7 @@ func TestDocker_SetupContainer(t *testing.T) { }, }, { + name: "pull-not_present-mock tag ignorenotfound", // mock returns as if this exists failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_clone", @@ -265,6 +307,7 @@ func TestDocker_SetupContainer(t *testing.T) { }, }, { + name: "pull-always-tag notfound fails", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_clone", @@ -277,6 +320,7 @@ func TestDocker_SetupContainer(t *testing.T) { }, }, { + name: "pull-not_present-tag notfound fails", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_clone", @@ -292,19 +336,21 @@ func TestDocker_SetupContainer(t *testing.T) { // run tests for _, test := range tests { - err = _engine.SetupContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + err = _engine.SetupContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("SetupContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("SetupContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("SetupContainer returned err: %v", err) - } + if err != nil { + t.Errorf("SetupContainer returned err: %v", err) + } + }) } } @@ -317,14 +363,17 @@ func TestDocker_TailContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "build container", failure: false, container: _container, }, { + name: "empty build container", failure: true, container: new(pipeline.Container), }, @@ -332,19 +381,21 @@ func TestDocker_TailContainer(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.TailContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.TailContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("TailContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("TailContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("TailContainer returned err: %v", err) - } + if err != nil { + t.Errorf("TailContainer returned err: %v", err) + } + }) } } @@ -357,14 +408,17 @@ func TestDocker_WaitContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "build container", failure: false, container: _container, }, { + name: "empty build container", failure: true, container: new(pipeline.Container), }, @@ -372,18 +426,20 @@ func TestDocker_WaitContainer(t *testing.T) { // run tests for _, test := range tests { - err = _engine.WaitContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + err = _engine.WaitContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("WaitContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WaitContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WaitContainer returned err: %v", err) - } + if err != nil { + t.Errorf("WaitContainer returned err: %v", err) + } + }) } } diff --git a/runtime/docker/docker_test.go b/runtime/docker/docker_test.go index 84552ec8..6a816ed9 100644 --- a/runtime/docker/docker_test.go +++ b/runtime/docker/docker_test.go @@ -15,14 +15,17 @@ import ( func TestDocker_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool envs map[string]string }{ { + name: "default", failure: false, envs: map[string]string{}, }, { + name: "with invalid DOCKER_CERT_PATH", failure: true, envs: map[string]string{ "DOCKER_CERT_PATH": "invalid/path", @@ -35,25 +38,27 @@ func TestDocker_New(t *testing.T) { // run tests for _, test := range tests { - // patch environment for tests - env.PatchAll(t, test.envs) + t.Run(test.name, func(t *testing.T) { + // patch environment for tests + env.PatchAll(t, test.envs) - _, err := New( - WithPrivilegedImages([]string{"alpine"}), - WithHostVolumes([]string{"/foo/bar.txt:/foo/bar.txt"}), - ) + _, err := New( + WithPrivilegedImages([]string{"alpine"}), + WithHostVolumes([]string{"/foo/bar.txt:/foo/bar.txt"}), + ) - if test.failure { - if err == nil { - t.Errorf("New should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("New returned err: %v", err) - } + if err != nil { + t.Errorf("New returned err: %v", err) + } + }) } } diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go index 7181dcf1..1dbdd1ae 100644 --- a/runtime/docker/image_test.go +++ b/runtime/docker/image_test.go @@ -20,18 +20,22 @@ func TestDocker_InspectImage(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "tag exists", failure: false, container: _container, }, { + name: "empty build container", failure: true, container: new(pipeline.Container), }, { + name: "tag notfound", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_clone", @@ -47,18 +51,20 @@ func TestDocker_InspectImage(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectImage(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectImage(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("InspectImage should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectImage should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectImage returned err: %v", err) - } + if err != nil { + t.Errorf("InspectImage returned err: %v", err) + } + }) } } diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 61ce91ab..6638ad90 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -20,14 +20,17 @@ func TestDocker_CreateNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -35,19 +38,21 @@ func TestDocker_CreateNetwork(t *testing.T) { // run tests for _, test := range tests { - err = _engine.CreateNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.CreateNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("CreateNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("CreateNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("CreateNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("CreateNetwork returned err: %v", err) + } + }) } } @@ -60,14 +65,17 @@ func TestDocker_InspectNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -75,19 +83,21 @@ func TestDocker_InspectNetwork(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("InspectNetwork returned err: %v", err) + } + }) } } @@ -100,14 +110,17 @@ func TestDocker_RemoveNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -115,18 +128,20 @@ func TestDocker_RemoveNetwork(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveNetwork returned err: %v", err) + } + }) } } diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go index 53438714..d5efd269 100644 --- a/runtime/docker/opts_test.go +++ b/runtime/docker/opts_test.go @@ -14,14 +14,17 @@ import ( func TestDocker_ClientOpt_WithPrivilegedImages(t *testing.T) { // setup tests tests := []struct { + name string images []string want []string }{ { + name: "defined", images: []string{"alpine", "golang"}, want: []string{"alpine", "golang"}, }, { + name: "empty", images: []string{}, want: []string{}, }, @@ -29,31 +32,36 @@ func TestDocker_ClientOpt_WithPrivilegedImages(t *testing.T) { // run tests for _, test := range tests { - _service, err := New( - WithPrivilegedImages(test.images), - ) + t.Run(test.name, func(t *testing.T) { + _service, err := New( + WithPrivilegedImages(test.images), + ) - if err != nil { - t.Errorf("WithPrivilegedImages returned err: %v", err) - } + if err != nil { + t.Errorf("WithPrivilegedImages returned err: %v", err) + } - if !reflect.DeepEqual(_service.config.Images, test.want) { - t.Errorf("WithPrivilegedImages is %v, want %v", _service.config.Images, test.want) - } + if !reflect.DeepEqual(_service.config.Images, test.want) { + t.Errorf("WithPrivilegedImages is %v, want %v", _service.config.Images, test.want) + } + }) } } func TestDocker_ClientOpt_WithHostVolumes(t *testing.T) { // setup tests tests := []struct { + name string volumes []string want []string }{ { + name: "defined", volumes: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, want: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, }, { + name: "empty", volumes: []string{}, want: []string{}, }, @@ -61,31 +69,36 @@ func TestDocker_ClientOpt_WithHostVolumes(t *testing.T) { // run tests for _, test := range tests { - _service, err := New( - WithHostVolumes(test.volumes), - ) + t.Run(test.name, func(t *testing.T) { + _service, err := New( + WithHostVolumes(test.volumes), + ) - if err != nil { - t.Errorf("WithHostVolumes returned err: %v", err) - } + if err != nil { + t.Errorf("WithHostVolumes returned err: %v", err) + } - if !reflect.DeepEqual(_service.config.Volumes, test.want) { - t.Errorf("WithHostVolumes is %v, want %v", _service.config.Volumes, test.want) - } + if !reflect.DeepEqual(_service.config.Volumes, test.want) { + t.Errorf("WithHostVolumes is %v, want %v", _service.config.Volumes, test.want) + } + }) } } func TestDocker_ClientOpt_WithLogger(t *testing.T) { // setup tests tests := []struct { + name string failure bool logger *logrus.Entry }{ { + name: "provided logger", failure: false, logger: &logrus.Entry{}, }, { + name: "nil logger", failure: false, logger: nil, }, @@ -93,28 +106,30 @@ func TestDocker_ClientOpt_WithLogger(t *testing.T) { // run tests for _, test := range tests { - _service, err := New( - WithLogger(test.logger), - ) + t.Run(test.name, func(t *testing.T) { + _service, err := New( + WithLogger(test.logger), + ) - if test.failure { - if err == nil { - t.Errorf("WithLogger should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithLogger should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithLogger returned err: %v", err) - } + if err != nil { + t.Errorf("WithLogger returned err: %v", err) + } - if test.logger == nil && _service.Logger == nil { - t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") - } + if test.logger == nil && _service.Logger == nil { + t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") + } - if test.logger != nil && !reflect.DeepEqual(_service.Logger, test.logger) { - t.Errorf("WithLogger set %v, want %v", _service.Logger, test.logger) - } + if test.logger != nil && !reflect.DeepEqual(_service.Logger, test.logger) { + t.Errorf("WithLogger set %v, want %v", _service.Logger, test.logger) + } + }) } } diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index c6202316..39700bcc 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -20,14 +20,17 @@ func TestDocker_CreateVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -35,19 +38,21 @@ func TestDocker_CreateVolume(t *testing.T) { // run tests for _, test := range tests { - err = _engine.CreateVolume(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.CreateVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("CreateVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("CreateVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("CreateVolume returned err: %v", err) - } + if err != nil { + t.Errorf("CreateVolume returned err: %v", err) + } + }) } } @@ -60,14 +65,17 @@ func TestDocker_InspectVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -75,19 +83,21 @@ func TestDocker_InspectVolume(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectVolume(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectVolume returned err: %v", err) - } + if err != nil { + t.Errorf("InspectVolume returned err: %v", err) + } + }) } } @@ -100,14 +110,17 @@ func TestDocker_RemoveVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps", failure: false, pipeline: _pipeline, }, { + name: "empty", failure: true, pipeline: new(pipeline.Build), }, @@ -115,18 +128,20 @@ func TestDocker_RemoveVolume(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveVolume(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveVolume returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveVolume returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 70ca964a..401dc5cf 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -25,14 +25,17 @@ func TestKubernetes_InspectBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -40,19 +43,21 @@ func TestKubernetes_InspectBuild(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectBuild(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectBuild returned err: %v", err) - } + if err != nil { + t.Errorf("InspectBuild returned err: %v", err) + } + }) } } @@ -162,102 +167,119 @@ func TestKubernetes_SetupBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build opts []ClientOpt wantFromTemplate interface{} }{ { + name: "stages", failure: false, pipeline: _stages, opts: nil, wantFromTemplate: nil, }, { + name: "steps", failure: false, pipeline: _steps, opts: nil, wantFromTemplate: nil, }, { + name: "stages-PipelinePodsTemplate-empty", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-empty.yaml")}, wantFromTemplate: nil, }, { + name: "steps-PipelinePodsTemplate-empty", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-empty.yaml")}, wantFromTemplate: nil, }, { + name: "stages-PipelinePodsTemplate-metadata", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template.yaml")}, wantFromTemplate: wantFromTemplateMetadata, }, { + name: "steps-PipelinePodsTemplate-metadata", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template.yaml")}, wantFromTemplate: wantFromTemplateMetadata, }, { + name: "stages-PipelinePodsTemplate-SecurityContext", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, wantFromTemplate: wantFromTemplateSecurityContext, }, { + name: "steps-PipelinePodsTemplate-SecurityContext", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, wantFromTemplate: wantFromTemplateSecurityContext, }, { + name: "stages-PipelinePodsTemplate-NodeSelection", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-node-selection.yaml")}, wantFromTemplate: wantFromTemplateNodeSelection, }, { + name: "steps-PipelinePodsTemplate-NodeSelection", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-node-selection.yaml")}, wantFromTemplate: wantFromTemplateNodeSelection, }, { + name: "stages-PipelinePodsTemplate-dns", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-dns.yaml")}, wantFromTemplate: wantFromTemplateDNS, }, { + name: "steps-PipelinePodsTemplate-dns", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-dns.yaml")}, wantFromTemplate: wantFromTemplateDNS, }, { + name: "stages-named PipelinePodsTemplate present", failure: false, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("mock-pipeline-pods-template", "")}, wantFromTemplate: nil, }, { + name: "steps-named PipelinePodsTemplate present", failure: false, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("mock-pipeline-pods-template", "")}, wantFromTemplate: nil, }, { + name: "stages-named PipelinePodsTemplate missing", failure: true, pipeline: _stages, opts: []ClientOpt{WithPodsTemplate("missing-pipeline-pods-template", "")}, wantFromTemplate: nil, }, { + name: "steps-named PipelinePodsTemplate missing", failure: true, pipeline: _steps, opts: []ClientOpt{WithPodsTemplate("missing-pipeline-pods-template", "")}, @@ -267,94 +289,97 @@ func TestKubernetes_SetupBuild(t *testing.T) { // run tests for _, test := range tests { - // setup types - _engine, err := NewMock(&v1.Pod{}, test.opts...) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - - err = _engine.SetupBuild(context.Background(), test.pipeline) - - // this does not test the resulting pod spec (ie no tests for ObjectMeta, RestartPolicy) - - if test.failure { - if err == nil { - t.Errorf("SetupBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + // setup types + _engine, err := NewMock(&v1.Pod{}, test.opts...) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) } - continue - } - - if err != nil { - t.Errorf("SetupBuild returned err: %v", err) - } + err = _engine.SetupBuild(context.Background(), test.pipeline) - // make sure that worker-defined labels are set and cannot be overridden by PipelinePodsTemplate - if pipelineLabel, ok := _engine.Pod.ObjectMeta.Labels["pipeline"]; !ok { - t.Errorf("Pod is missing the pipeline label: %v", _engine.Pod.ObjectMeta) - } else if pipelineLabel != test.pipeline.ID { - t.Errorf("Pod's pipeline label is %v, want %v", pipelineLabel, test.pipeline.ID) - } + // this does not test the resulting pod spec (ie no tests for ObjectMeta, RestartPolicy) - switch test.wantFromTemplate.(type) { - case velav1alpha1.PipelinePodTemplateMeta: - want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateMeta) - - // PipelinePodsTemplate defined Annotations - if want.Annotations != nil && !reflect.DeepEqual(_engine.Pod.Annotations, want.Annotations) { - t.Errorf("Pod.Annotations is %v, want %v", _engine.Pod.Annotations, want.Annotations) - } - - // PipelinePodsTemplate defined Labels - if want.Labels != nil && !reflect.DeepEqual(_engine.Pod.Labels, want.Labels) { - t.Errorf("Pod.Labels is %v, want %v", _engine.Pod.Labels, want.Labels) - } - case velav1alpha1.PipelinePodSecurityContext: - want := test.wantFromTemplate.(velav1alpha1.PipelinePodSecurityContext) - - // PipelinePodsTemplate defined SecurityContext.RunAsNonRoot - if !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) { - t.Errorf("Pod.SecurityContext.RunAsNonRoot is %v, want %v", _engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) - } + if test.failure { + if err == nil { + t.Errorf("SetupBuild should have returned err") + } - // PipelinePodsTemplate defined SecurityContext.Sysctls - if want.Sysctls != nil && !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) { - t.Errorf("Pod.SecurityContext.Sysctls is %v, want %v", _engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) + return // continue to next test } - case velav1alpha1.PipelinePodTemplateSpec: - want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateSpec) - // PipelinePodsTemplate defined NodeSelector - if want.NodeSelector != nil && !reflect.DeepEqual(_engine.Pod.Spec.NodeSelector, want.NodeSelector) { - t.Errorf("Pod.NodeSelector is %v, want %v", _engine.Pod.Spec.NodeSelector, want.NodeSelector) + if err != nil { + t.Errorf("SetupBuild returned err: %v", err) } - // PipelinePodsTemplate defined Affinity - if want.Affinity != nil && !reflect.DeepEqual(_engine.Pod.Spec.Affinity, want.Affinity) { - t.Errorf("Pod.Affinity is %v, want %v", _engine.Pod.Spec.Affinity, want.Affinity) + // make sure that worker-defined labels are set and cannot be overridden by PipelinePodsTemplate + if pipelineLabel, ok := _engine.Pod.ObjectMeta.Labels["pipeline"]; !ok { + t.Errorf("Pod is missing the pipeline label: %v", _engine.Pod.ObjectMeta) + } else if pipelineLabel != test.pipeline.ID { + t.Errorf("Pod's pipeline label is %v, want %v", pipelineLabel, test.pipeline.ID) } - // PipelinePodsTemplate defined Tolerations - if want.Tolerations != nil && !reflect.DeepEqual(_engine.Pod.Spec.Tolerations, want.Tolerations) { - t.Errorf("Pod.Tolerations is %v, want %v", _engine.Pod.Spec.Tolerations, want.Tolerations) + switch test.wantFromTemplate.(type) { + case velav1alpha1.PipelinePodTemplateMeta: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateMeta) + + // PipelinePodsTemplate defined Annotations + if want.Annotations != nil && !reflect.DeepEqual(_engine.Pod.Annotations, want.Annotations) { + t.Errorf("Pod.Annotations is %v, want %v", _engine.Pod.Annotations, want.Annotations) + } + + // PipelinePodsTemplate defined Labels + if want.Labels != nil && !reflect.DeepEqual(_engine.Pod.Labels, want.Labels) { + t.Errorf("Pod.Labels is %v, want %v", _engine.Pod.Labels, want.Labels) + } + case velav1alpha1.PipelinePodSecurityContext: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodSecurityContext) + + // PipelinePodsTemplate defined SecurityContext.RunAsNonRoot + if !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) { + t.Errorf("Pod.SecurityContext.RunAsNonRoot is %v, want %v", _engine.Pod.Spec.SecurityContext.RunAsNonRoot, want.RunAsNonRoot) + } + + // PipelinePodsTemplate defined SecurityContext.Sysctls + if want.Sysctls != nil && !reflect.DeepEqual(_engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) { + t.Errorf("Pod.SecurityContext.Sysctls is %v, want %v", _engine.Pod.Spec.SecurityContext.Sysctls, want.Sysctls) + } + case velav1alpha1.PipelinePodTemplateSpec: + want := test.wantFromTemplate.(velav1alpha1.PipelinePodTemplateSpec) + + // PipelinePodsTemplate defined NodeSelector + if want.NodeSelector != nil && !reflect.DeepEqual(_engine.Pod.Spec.NodeSelector, want.NodeSelector) { + t.Errorf("Pod.NodeSelector is %v, want %v", _engine.Pod.Spec.NodeSelector, want.NodeSelector) + } + + // PipelinePodsTemplate defined Affinity + if want.Affinity != nil && !reflect.DeepEqual(_engine.Pod.Spec.Affinity, want.Affinity) { + t.Errorf("Pod.Affinity is %v, want %v", _engine.Pod.Spec.Affinity, want.Affinity) + } + + // PipelinePodsTemplate defined Tolerations + if want.Tolerations != nil && !reflect.DeepEqual(_engine.Pod.Spec.Tolerations, want.Tolerations) { + t.Errorf("Pod.Tolerations is %v, want %v", _engine.Pod.Spec.Tolerations, want.Tolerations) + } + + // PipelinePodsTemplate defined DNSPolicy + if len(want.DNSPolicy) > 0 && _engine.Pod.Spec.DNSPolicy != want.DNSPolicy { + t.Errorf("Pod.DNSPolicy is %v, want %v", _engine.Pod.Spec.DNSPolicy, want.DNSPolicy) + } + + // PipelinePodsTemplate defined DNSConfig + if want.DNSConfig != nil && !reflect.DeepEqual(_engine.Pod.Spec.DNSConfig, want.DNSConfig) { + t.Errorf("Pod.DNSConfig is %v, want %v", _engine.Pod.Spec.DNSConfig, want.DNSConfig) + } } - - // PipelinePodsTemplate defined DNSPolicy - if len(want.DNSPolicy) > 0 && _engine.Pod.Spec.DNSPolicy != want.DNSPolicy { - t.Errorf("Pod.DNSPolicy is %v, want %v", _engine.Pod.Spec.DNSPolicy, want.DNSPolicy) - } - - // PipelinePodsTemplate defined DNSConfig - if want.DNSConfig != nil && !reflect.DeepEqual(_engine.Pod.Spec.DNSConfig, want.DNSConfig) { - t.Errorf("Pod.DNSConfig is %v, want %v", _engine.Pod.Spec.DNSConfig, want.DNSConfig) - } - } + }) } } func TestKubernetes_AssembleBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build // k8sPod is the pod that the mock Kubernetes client will return @@ -363,24 +388,28 @@ func TestKubernetes_AssembleBuild(t *testing.T) { enginePod *v1.Pod }{ { + name: "stages", failure: false, pipeline: _stages, k8sPod: &v1.Pod{}, enginePod: _stagesPod, }, { + name: "steps", failure: false, pipeline: _steps, k8sPod: &v1.Pod{}, enginePod: _pod, }, { + name: "stages-pod already exists", failure: true, pipeline: _stages, k8sPod: _stagesPod, enginePod: _stagesPod, }, { + name: "steps-pod already exists", failure: true, pipeline: _steps, k8sPod: _pod, @@ -390,68 +419,77 @@ func TestKubernetes_AssembleBuild(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock(test.k8sPod) - _engine.Pod = test.enginePod + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock(test.k8sPod) + _engine.Pod = test.enginePod - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - err = _engine.AssembleBuild(context.Background(), test.pipeline) + err = _engine.AssembleBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("AssembleBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("AssembleBuild returned err: %v", err) - } + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + }) } } func TestKubernetes_RemoveBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool createdPod bool pipeline *pipeline.Build pod *v1.Pod }{ { + name: "stages-createdPod-pod in k8s", failure: false, createdPod: true, pipeline: _stages, pod: _pod, }, { + name: "steps-createdPod-pod in k8s", failure: false, createdPod: true, pipeline: _steps, pod: _pod, }, { + name: "stages-not createdPod-pod not in k8s", failure: false, createdPod: false, pipeline: _stages, pod: &v1.Pod{}, }, { + name: "steps-not createdPod-pod not in k8s", failure: false, pipeline: _steps, pod: &v1.Pod{}, createdPod: false, }, { + name: "stages-createdPod-pod not in k8s", failure: true, pipeline: _stages, pod: &v1.Pod{}, createdPod: true, }, { + name: "steps-createdPod-pod not in k8s", failure: true, pipeline: _steps, pod: &v1.Pod{}, @@ -461,24 +499,26 @@ func TestKubernetes_RemoveBuild(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock(test.pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - _engine.createdPod = test.createdPod + _engine.createdPod = test.createdPod - err = _engine.RemoveBuild(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveBuild should have returned err") - } + err = _engine.RemoveBuild(context.Background(), test.pipeline) + if test.failure { + if err == nil { + t.Errorf("RemoveBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveBuild returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveBuild returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 7b2b5e2e..40941dec 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -76,7 +76,7 @@ func TestKubernetes_InspectContainer(t *testing.T) { t.Errorf("InspectContainer should have returned err") } - return // effectively "continue" to next test + return // continue to next test } if err != nil { @@ -95,10 +95,12 @@ func TestKubernetes_RemoveContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "build container", failure: false, container: _container, }, @@ -106,19 +108,21 @@ func TestKubernetes_RemoveContainer(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("RemoveContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveContainer returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveContainer returned err: %v", err) + } + }) } } @@ -126,6 +130,7 @@ func TestKubernetes_RunContainer(t *testing.T) { // TODO: include VolumeMounts? // setup tests tests := []struct { + name string failure bool container *pipeline.Container pipeline *pipeline.Build @@ -133,12 +138,14 @@ func TestKubernetes_RunContainer(t *testing.T) { volumes []string }{ { + name: "stages", failure: false, container: _container, pipeline: _stages, pod: _pod, }, { + name: "steps", failure: false, container: _container, pipeline: _steps, @@ -148,34 +155,37 @@ func TestKubernetes_RunContainer(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock(test.pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - if len(test.volumes) > 0 { - _engine.config.Volumes = test.volumes - } + if len(test.volumes) > 0 { + _engine.config.Volumes = test.volumes + } - err = _engine.RunContainer(context.Background(), test.container, test.pipeline) + err = _engine.RunContainer(context.Background(), test.container, test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RunContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RunContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RunContainer returned err: %v", err) - } + if err != nil { + t.Errorf("RunContainer returned err: %v", err) + } + }) } } func TestKubernetes_SetupContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container opts []ClientOpt @@ -183,13 +193,15 @@ func TestKubernetes_SetupContainer(t *testing.T) { wantFromTemplate interface{} }{ { + name: "step-clone", failure: false, - container: _container, + container: _container, // clone step opts: nil, wantPrivileged: false, wantFromTemplate: nil, }, { + name: "step-echo", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -207,6 +219,7 @@ func TestKubernetes_SetupContainer(t *testing.T) { wantFromTemplate: nil, }, { + name: "privileged", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -224,6 +237,7 @@ func TestKubernetes_SetupContainer(t *testing.T) { wantFromTemplate: nil, }, { + name: "PipelinePodsTemplate", failure: false, container: _container, opts: []ClientOpt{WithPodsTemplate("", "testdata/pipeline-pods-template-security-context.yaml")}, @@ -239,58 +253,60 @@ func TestKubernetes_SetupContainer(t *testing.T) { // run tests for _, test := range tests { - // setup types - _engine, err := NewMock(_pod.DeepCopy(), test.opts...) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - // actually run the test - err = _engine.SetupContainer(context.Background(), test.container) - - // this does not (yet) test everything in the resulting pod spec (ie no tests for ImagePullPolicy, VolumeMounts) - - if test.failure { - if err == nil { - t.Errorf("SetupContainer should have returned err") + t.Run(test.name, func(t *testing.T) { + // setup types + _engine, err := NewMock(_pod.DeepCopy(), test.opts...) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) } + // actually run the test + err = _engine.SetupContainer(context.Background(), test.container) - continue - } - - if err != nil { - t.Errorf("SetupContainer returned err: %v", err) - } + // this does not (yet) test everything in the resulting pod spec (ie no tests for ImagePullPolicy, VolumeMounts) - // SetupContainer added the last pod so get it for inspection - i := len(_engine.Pod.Spec.Containers) - 1 - ctn := _engine.Pod.Spec.Containers[i] + if test.failure { + if err == nil { + t.Errorf("SetupContainer should have returned err") + } - // Make sure Container has Privileged configured correctly - if test.wantPrivileged { - if ctn.SecurityContext == nil { - t.Errorf("Pod.Containers[%v].SecurityContext is nil", i) - } else if *ctn.SecurityContext.Privileged != test.wantPrivileged { - t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) + return // continue to next test } - } else { - if ctn.SecurityContext != nil && ctn.SecurityContext.Privileged != nil && *ctn.SecurityContext.Privileged != test.wantPrivileged { - t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) + + if err != nil { + t.Errorf("SetupContainer returned err: %v", err) } - } - switch test.wantFromTemplate.(type) { - case velav1alpha1.PipelineContainerSecurityContext: - want := test.wantFromTemplate.(velav1alpha1.PipelineContainerSecurityContext) + // SetupContainer added the last pod so get it for inspection + i := len(_engine.Pod.Spec.Containers) - 1 + ctn := _engine.Pod.Spec.Containers[i] - // PipelinePodsTemplate defined SecurityContext.Capabilities - if want.Capabilities != nil { + // Make sure Container has Privileged configured correctly + if test.wantPrivileged { if ctn.SecurityContext == nil { t.Errorf("Pod.Containers[%v].SecurityContext is nil", i) - } else if !reflect.DeepEqual(ctn.SecurityContext.Capabilities, want.Capabilities) { - t.Errorf("Pod.Containers[%v].SecurityContext.Capabilities is %v, want %v", i, ctn.SecurityContext.Capabilities, want.Capabilities) + } else if *ctn.SecurityContext.Privileged != test.wantPrivileged { + t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) + } + } else { + if ctn.SecurityContext != nil && ctn.SecurityContext.Privileged != nil && *ctn.SecurityContext.Privileged != test.wantPrivileged { + t.Errorf("Pod.Containers[%v].SecurityContext.Privileged is %v, want %v", i, *ctn.SecurityContext.Privileged, test.wantPrivileged) } } - } + + switch test.wantFromTemplate.(type) { + case velav1alpha1.PipelineContainerSecurityContext: + want := test.wantFromTemplate.(velav1alpha1.PipelineContainerSecurityContext) + + // PipelinePodsTemplate defined SecurityContext.Capabilities + if want.Capabilities != nil { + if ctn.SecurityContext == nil { + t.Errorf("Pod.Containers[%v].SecurityContext is nil", i) + } else if !reflect.DeepEqual(ctn.SecurityContext.Capabilities, want.Capabilities) { + t.Errorf("Pod.Containers[%v].SecurityContext.Capabilities is %v, want %v", i, ctn.SecurityContext.Capabilities, want.Capabilities) + } + } + } + }) } } @@ -311,16 +327,19 @@ func TestKubernetes_TailContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "got logs", failure: false, container: _container, }, // We cannot test failures, because the mock GetLogs() always // returns a successful response with logs body: "fake logs" //{ + // name: "empty build container", // failure: true, // container: new(pipeline.Container), //}, @@ -328,35 +347,40 @@ func TestKubernetes_TailContainer(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.TailContainer(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.TailContainer(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("TailContainer should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("TailContainer should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("TailContainer returned err: %v", err) - } + if err != nil { + t.Errorf("TailContainer returned err: %v", err) + } + }) } } func TestKubernetes_WaitContainer(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container object runtime.Object }{ { + name: "default order in ContainerStatuses", failure: false, container: _container, object: _pod, }, { + name: "inverted order in ContainerStatuses", failure: false, container: _container, object: &v1.Pod{ @@ -397,6 +421,7 @@ func TestKubernetes_WaitContainer(t *testing.T) { }, }, { + name: "watch returns invalid type", failure: true, container: _container, object: new(v1.PodTemplate), @@ -405,29 +430,31 @@ func TestKubernetes_WaitContainer(t *testing.T) { // run tests for _, test := range tests { - // setup types - _engine, _watch, err := newMockWithWatch(_pod, "pods") - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - - go func() { - // simulate adding a pod to the watcher - _watch.Add(test.object) - }() - - err = _engine.WaitContainer(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("WaitContainer should have returned err") + t.Run(test.name, func(t *testing.T) { + // setup types + _engine, _watch, err := newMockWithWatch(_pod, "pods") + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) } - continue - } + go func() { + // simulate adding a pod to the watcher + _watch.Add(test.object) + }() + + err = _engine.WaitContainer(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("WaitContainer should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("WaitContainer returned err: %v", err) - } + if err != nil { + t.Errorf("WaitContainer returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/image_test.go b/runtime/kubernetes/image_test.go index ea95678c..8fcc4bf9 100644 --- a/runtime/kubernetes/image_test.go +++ b/runtime/kubernetes/image_test.go @@ -20,10 +20,12 @@ func TestKubernetes_InspectImage(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "valid image", failure: false, container: _container, }, @@ -31,18 +33,20 @@ func TestKubernetes_InspectImage(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectImage(context.Background(), test.container) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectImage(context.Background(), test.container) - if test.failure { - if err == nil { - t.Errorf("InspectImage should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectImage should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectImage returned err: %v", err) - } + if err != nil { + t.Errorf("InspectImage returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index f479cad5..39da9c63 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -19,16 +19,19 @@ import ( func TestKubernetes_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool namespace string path string }{ { + name: "valid config file", failure: false, namespace: "test", path: "testdata/config", }, { + name: "invalid config file", failure: true, namespace: "test", path: "testdata/config_empty", @@ -38,6 +41,7 @@ func TestKubernetes_New(t *testing.T) { // run in kubernetes, so we would need a way to mock the // return value of rest.InClusterConfig(), but how? //{ + // name: "InClusterConfig file", // failure: false, // namespace: "test", // path: "", @@ -46,22 +50,24 @@ func TestKubernetes_New(t *testing.T) { // run tests for _, test := range tests { - _, err := New( - WithConfigFile(test.path), - WithNamespace(test.namespace), - ) + t.Run(test.name, func(t *testing.T) { + _, err := New( + WithConfigFile(test.path), + WithNamespace(test.namespace), + ) - if test.failure { - if err == nil { - t.Errorf("New should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("New returned err: %v", err) - } + if err != nil { + t.Errorf("New returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/network_test.go b/runtime/kubernetes/network_test.go index 39828f29..4cf79e1c 100644 --- a/runtime/kubernetes/network_test.go +++ b/runtime/kubernetes/network_test.go @@ -20,14 +20,17 @@ func TestKubernetes_CreateNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -35,19 +38,21 @@ func TestKubernetes_CreateNetwork(t *testing.T) { // run tests for _, test := range tests { - err := _engine.CreateNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err := _engine.CreateNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("CreateNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("CreateNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("CreateNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("CreateNetwork returned err: %v", err) + } + }) } } @@ -60,14 +65,17 @@ func TestKubernetes_InspectNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -75,19 +83,21 @@ func TestKubernetes_InspectNetwork(t *testing.T) { // run tests for _, test := range tests { - _, err = _engine.InspectNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + _, err = _engine.InspectNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("InspectNetwork returned err: %v", err) + } + }) } } @@ -100,14 +110,17 @@ func TestKubernetes_RemoveNetwork(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -115,18 +128,20 @@ func TestKubernetes_RemoveNetwork(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveNetwork(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveNetwork(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveNetwork should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveNetwork should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveNetwork returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveNetwork returned err: %v", err) + } + }) } } diff --git a/runtime/kubernetes/opts_test.go b/runtime/kubernetes/opts_test.go index cf17624c..83055545 100644 --- a/runtime/kubernetes/opts_test.go +++ b/runtime/kubernetes/opts_test.go @@ -16,16 +16,31 @@ import ( func TestKubernetes_ClientOpt_WithConfigFile(t *testing.T) { // setup tests tests := []struct { + name string failure bool file string want string }{ { + name: "valid config file", failure: false, file: "testdata/config", want: "testdata/config", }, { + name: "invalid config file", + failure: true, + file: "testdata/config_empty", + want: "testdata/config_empty", + }, + { + name: "missing config file", + failure: true, + file: "testdata/config_missing", + want: "testdata/config_missing", + }, + { + name: "InClusterConfig file missing", failure: true, file: "", want: "", @@ -34,41 +49,46 @@ func TestKubernetes_ClientOpt_WithConfigFile(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile(test.file), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile(test.file), + ) - if test.failure { - if err == nil { - t.Errorf("WithConfigFile should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithConfigFile should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithConfigFile returned err: %v", err) - } + if err != nil { + t.Errorf("WithConfigFile returned err: %v", err) + } - if !reflect.DeepEqual(_engine.config.File, test.want) { - t.Errorf("WithConfigFile is %v, want %v", _engine.config.File, test.want) - } + if !reflect.DeepEqual(_engine.config.File, test.want) { + t.Errorf("WithConfigFile is %v, want %v", _engine.config.File, test.want) + } + }) } } func TestKubernetes_ClientOpt_WithNamespace(t *testing.T) { // setup tests tests := []struct { + name string failure bool namespace string want string }{ { + name: "namespace", failure: false, namespace: "foo", want: "foo", }, { + name: "empty namespace fails", failure: true, namespace: "", want: "", @@ -77,40 +97,45 @@ func TestKubernetes_ClientOpt_WithNamespace(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile("testdata/config"), - WithNamespace(test.namespace), - ) - - if test.failure { - if err == nil { - t.Errorf("WithNamespace should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile("testdata/config"), + WithNamespace(test.namespace), + ) + + if test.failure { + if err == nil { + t.Errorf("WithNamespace should have returned err") + } + + return // continue to next test } - continue - } - - if err != nil { - t.Errorf("WithNamespace returned err: %v", err) - } + if err != nil { + t.Errorf("WithNamespace returned err: %v", err) + } - if !reflect.DeepEqual(_engine.config.Namespace, test.want) { - t.Errorf("WithNamespace is %v, want %v", _engine.config.Namespace, test.want) - } + if !reflect.DeepEqual(_engine.config.Namespace, test.want) { + t.Errorf("WithNamespace is %v, want %v", _engine.config.Namespace, test.want) + } + }) } } func TestKubernetes_ClientOpt_WithHostVolumes(t *testing.T) { // setup tests tests := []struct { + name string volumes []string want []string }{ { + name: "defined", volumes: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, want: []string{"/foo/bar.txt:/foo/bar.txt", "/tmp/baz.conf:/tmp/baz.conf"}, }, { + name: "empty", volumes: []string{}, want: []string{}, }, @@ -118,32 +143,37 @@ func TestKubernetes_ClientOpt_WithHostVolumes(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile("testdata/config"), - WithHostVolumes(test.volumes), - ) - - if err != nil { - t.Errorf("WithHostVolumes returned err: %v", err) - } - - if !reflect.DeepEqual(_engine.config.Volumes, test.want) { - t.Errorf("WithHostVolumes is %v, want %v", _engine.config.Volumes, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile("testdata/config"), + WithHostVolumes(test.volumes), + ) + + if err != nil { + t.Errorf("WithHostVolumes returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.Volumes, test.want) { + t.Errorf("WithHostVolumes is %v, want %v", _engine.config.Volumes, test.want) + } + }) } } func TestKubernetes_ClientOpt_WithPrivilegedImages(t *testing.T) { // setup tests tests := []struct { + name string images []string want []string }{ { + name: "defined", images: []string{"alpine", "golang"}, want: []string{"alpine", "golang"}, }, { + name: "empty", images: []string{}, want: []string{}, }, @@ -151,32 +181,37 @@ func TestKubernetes_ClientOpt_WithPrivilegedImages(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile("testdata/config"), - WithPrivilegedImages(test.images), - ) - - if err != nil { - t.Errorf("WithPrivilegedImages returned err: %v", err) - } - - if !reflect.DeepEqual(_engine.config.Images, test.want) { - t.Errorf("WithPrivilegedImages is %v, want %v", _engine.config.Images, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile("testdata/config"), + WithPrivilegedImages(test.images), + ) + + if err != nil { + t.Errorf("WithPrivilegedImages returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.config.Images, test.want) { + t.Errorf("WithPrivilegedImages is %v, want %v", _engine.config.Images, test.want) + } + }) } } func TestKubernetes_ClientOpt_WithLogger(t *testing.T) { // setup tests tests := []struct { + name string failure bool logger *logrus.Entry }{ { + name: "provided logger", failure: false, logger: &logrus.Entry{}, }, { + name: "nil logger", failure: false, logger: nil, }, @@ -184,36 +219,39 @@ func TestKubernetes_ClientOpt_WithLogger(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile("testdata/config"), - WithLogger(test.logger), - ) - - if test.failure { - if err == nil { - t.Errorf("WithLogger should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile("testdata/config"), + WithLogger(test.logger), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogger should have returned err") + } + + return // continue to next test } - continue - } - - if err != nil { - t.Errorf("WithLogger returned err: %v", err) - } + if err != nil { + t.Errorf("WithLogger returned err: %v", err) + } - if test.logger == nil && _engine.Logger == nil { - t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") - } + if test.logger == nil && _engine.Logger == nil { + t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") + } - if test.logger != nil && !reflect.DeepEqual(_engine.Logger, test.logger) { - t.Errorf("WithLogger set %v, want %v", _engine.Logger, test.logger) - } + if test.logger != nil && !reflect.DeepEqual(_engine.Logger, test.logger) { + t.Errorf("WithLogger set %v, want %v", _engine.Logger, test.logger) + } + }) } } func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { // setup tests tests := []struct { + name string failure bool podsTemplateName string podsTemplatePath string @@ -221,6 +259,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { wantTemplate *velav1alpha1.PipelinePodTemplate }{ { + name: "name", failure: false, podsTemplateName: "foo-bar-name", podsTemplatePath: "", @@ -228,6 +267,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { wantTemplate: nil, }, { + name: "no name or path", failure: false, podsTemplateName: "", podsTemplatePath: "", @@ -235,6 +275,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { wantTemplate: nil, }, { + name: "ignores missing files", failure: false, // ignores missing files; can be added later podsTemplateName: "", podsTemplatePath: "testdata/does-not-exist.yaml", @@ -242,6 +283,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { wantTemplate: nil, }, { + name: "path-empty", failure: false, podsTemplateName: "", podsTemplatePath: "testdata/pipeline-pods-template-empty.yaml", @@ -249,6 +291,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { wantTemplate: &velav1alpha1.PipelinePodTemplate{}, }, { + name: "path", failure: false, podsTemplateName: "", podsTemplatePath: "testdata/pipeline-pods-template.yaml", @@ -264,6 +307,7 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { }, }, { + name: "path-malformed", failure: true, podsTemplateName: "", podsTemplatePath: "testdata/pipeline-pods-template-malformed.yaml", @@ -274,30 +318,32 @@ func TestKubernetes_ClientOpt_WithPodsTemplate(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithConfigFile("testdata/config"), - WithNamespace("foo"), - WithPodsTemplate(test.podsTemplateName, test.podsTemplatePath), - ) - - if test.failure { - if err == nil { - t.Errorf("WithPodsTemplate should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithConfigFile("testdata/config"), + WithNamespace("foo"), + WithPodsTemplate(test.podsTemplateName, test.podsTemplatePath), + ) + + if test.failure { + if err == nil { + t.Errorf("WithPodsTemplate should have returned err") + } + + return // continue to next test } - continue - } - - if err != nil { - t.Errorf("WithPodsTemplate returned err: %v", err) - } + if err != nil { + t.Errorf("WithPodsTemplate returned err: %v", err) + } - if !reflect.DeepEqual(_engine.config.PipelinePodsTemplateName, test.wantName) { - t.Errorf("WithPodsTemplate is %v, wantName %v", _engine.config.PipelinePodsTemplateName, test.wantName) - } + if !reflect.DeepEqual(_engine.config.PipelinePodsTemplateName, test.wantName) { + t.Errorf("WithPodsTemplate is %v, wantName %v", _engine.config.PipelinePodsTemplateName, test.wantName) + } - if test.wantTemplate != nil && !reflect.DeepEqual(_engine.PipelinePodTemplate, test.wantTemplate) { - t.Errorf("WithPodsTemplate is %v, wantTemplate %v", _engine.PipelinePodTemplate, test.wantTemplate) - } + if test.wantTemplate != nil && !reflect.DeepEqual(_engine.PipelinePodTemplate, test.wantTemplate) { + t.Errorf("WithPodsTemplate is %v, wantTemplate %v", _engine.PipelinePodTemplate, test.wantTemplate) + } + }) } } diff --git a/runtime/kubernetes/volume_test.go b/runtime/kubernetes/volume_test.go index eecfbd21..2a4b745d 100644 --- a/runtime/kubernetes/volume_test.go +++ b/runtime/kubernetes/volume_test.go @@ -22,14 +22,17 @@ func TestKubernetes_CreateVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -37,35 +40,40 @@ func TestKubernetes_CreateVolume(t *testing.T) { // run tests for _, test := range tests { - err = _engine.CreateVolume(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.CreateVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("CreateVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("CreateVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("CreateVolume returned err: %v", err) - } + if err != nil { + t.Errorf("CreateVolume returned err: %v", err) + } + }) } } func TestKubernetes_InspectVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build pod *v1.Pod }{ { + name: "stages", failure: false, pipeline: _stages, pod: _pod, }, { + name: "steps", failure: false, pipeline: _steps, pod: _pod, @@ -74,24 +82,26 @@ func TestKubernetes_InspectVolume(t *testing.T) { // run tests for _, test := range tests { - _engine, err := NewMock(test.pod) - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } - _, err = _engine.InspectVolume(context.Background(), test.pipeline) + _, err = _engine.InspectVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("InspectVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("InspectVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("InspectVolume returned err: %v", err) - } + if err != nil { + t.Errorf("InspectVolume returned err: %v", err) + } + }) } } @@ -104,14 +114,17 @@ func TestKubernetes_RemoveVolume(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "stages", failure: false, pipeline: _stages, }, { + name: "steps", failure: false, pipeline: _steps, }, @@ -119,18 +132,20 @@ func TestKubernetes_RemoveVolume(t *testing.T) { // run tests for _, test := range tests { - err = _engine.RemoveVolume(context.Background(), test.pipeline) + t.Run(test.name, func(t *testing.T) { + err = _engine.RemoveVolume(context.Background(), test.pipeline) - if test.failure { - if err == nil { - t.Errorf("RemoveVolume should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("RemoveVolume should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("RemoveVolume returned err: %v", err) - } + if err != nil { + t.Errorf("RemoveVolume returned err: %v", err) + } + }) } } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index e25d1f7e..54b0f7cd 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -13,16 +13,19 @@ import ( func TestRuntime_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool setup *Setup }{ { + name: "docker driver", failure: false, setup: &Setup{ Driver: constants.DriverDocker, }, }, { + name: "kubernetes driver", failure: false, setup: &Setup{ Driver: constants.DriverKubernetes, @@ -31,12 +34,14 @@ func TestRuntime_New(t *testing.T) { }, }, { + name: "invalid driver fails", failure: true, setup: &Setup{ Driver: "invalid", }, }, { + name: "empty driver fails", failure: true, setup: &Setup{ Driver: "", @@ -46,18 +51,20 @@ func TestRuntime_New(t *testing.T) { // run tests for _, test := range tests { - _, err := New(test.setup) + t.Run(test.name, func(t *testing.T) { + _, err := New(test.setup) - if test.failure { - if err == nil { - t.Errorf("New should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("New returned err: %v", err) - } + if err != nil { + t.Errorf("New returned err: %v", err) + } + }) } } diff --git a/runtime/setup_test.go b/runtime/setup_test.go index 24aba2c6..8b87fd2b 100644 --- a/runtime/setup_test.go +++ b/runtime/setup_test.go @@ -41,17 +41,20 @@ func TestRuntime_Setup_Kubernetes(t *testing.T) { func TestRuntime_Validate(t *testing.T) { // setup types tests := []struct { + name string failure bool setup *Setup want error }{ { + name: "docker driver", failure: false, setup: &Setup{ Driver: constants.DriverDocker, }, }, { + name: "kubernetes driver", failure: false, setup: &Setup{ Driver: constants.DriverKubernetes, @@ -59,12 +62,14 @@ func TestRuntime_Validate(t *testing.T) { }, }, { + name: "empty driver", failure: true, setup: &Setup{ Driver: "", }, }, { + name: "kubernetes driver-missing namespace", failure: true, setup: &Setup{ Driver: constants.DriverKubernetes, @@ -74,18 +79,20 @@ func TestRuntime_Validate(t *testing.T) { // run tests for _, test := range tests { - err := test.setup.Validate() + t.Run(test.name, func(t *testing.T) { + err := test.setup.Validate() - if test.failure { - if err == nil { - t.Errorf("Validate should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Validate should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Validate returned err: %v", err) - } + if err != nil { + t.Errorf("Validate returned err: %v", err) + } + }) } } From bf3cbc9de2f60a24cfaf030c77b4e2addd82f42b Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 19 Apr 2022 13:33:11 -0500 Subject: [PATCH 271/430] refactor: drop duplicate executor.DestroyBuild call (#313) --- cmd/vela-worker/exec.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index f369c27c..984e31dd 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -108,6 +108,8 @@ func (w *Worker) exec(index int) error { if err != nil { logger.Errorf("unable to destroy build: %v", err) } + + logger.Info("completed build") }() logger.Info("creating build") @@ -142,14 +144,5 @@ func (w *Worker) exec(index int) error { return nil } - logger.Info("destroying build") - // destroy the build with the executor - err = _executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - - logger.Info("completed build") - return nil } From cd91b143903bb98a179d30e67999b8892f3eaad0 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 19 Apr 2022 15:58:01 -0500 Subject: [PATCH 272/430] bugfix(k8s): avoid "index out of range" panic by replacing magic indexes with containerLookup map (#311) --- runtime/kubernetes/build_test.go | 5 +++++ runtime/kubernetes/container.go | 9 +++++---- runtime/kubernetes/container_test.go | 5 +++++ runtime/kubernetes/image.go | 5 +++-- runtime/kubernetes/kubernetes.go | 8 ++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 401dc5cf..d1d06215 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -423,6 +423,11 @@ func TestKubernetes_AssembleBuild(t *testing.T) { _engine, err := NewMock(test.k8sPod) _engine.Pod = test.enginePod + _engine.containersLookup = map[string]int{} + for i, ctn := range test.enginePod.Spec.Containers { + _engine.containersLookup[ctn.Name] = i + } + if err != nil { t.Errorf("unable to create runtime engine: %v", err) } diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 7f6ffbc7..b2003f3a 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -99,8 +99,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p } // set the pod container image to the parsed step image - // (-1 to convert to 0-based index, -1 for init which isn't a container) - c.Pod.Spec.Containers[ctn.Number-2].Image = _image + c.Pod.Spec.Containers[c.containersLookup[ctn.ID]].Image = _image // send API call to patch the pod with the new container image // @@ -213,6 +212,9 @@ func (c *client) SetupContainer(ctx context.Context, ctn *pipeline.Container) er container.Args = append(container.Args, ctn.Commands...) } + // record the index for this container + c.containersLookup[ctn.ID] = len(c.Pod.Spec.Containers) + // add the container definition to the pod spec // // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec @@ -227,8 +229,7 @@ func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { c.Logger.Tracef("setting up environment for container %s", ctn.ID) // get the matching container spec - // (-1 to convert to 0-based index, -1 for injected init container) - container := &c.Pod.Spec.Containers[ctn.Number-2] + container := &c.Pod.Spec.Containers[c.containersLookup[ctn.ID]] if !strings.EqualFold(container.Name, ctn.ID) { return fmt.Errorf("wrong container! got %s instead of %s", container.Name, ctn.ID) } diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 40941dec..2efc8043 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -280,6 +280,11 @@ func TestKubernetes_SetupContainer(t *testing.T) { i := len(_engine.Pod.Spec.Containers) - 1 ctn := _engine.Pod.Spec.Containers[i] + // make sure the lookup map is working as expected + if j := _engine.containersLookup[ctn.Name]; i != j { + t.Errorf("expected containersLookup[ctn.Name] to be %d, got %d", i, j) + } + // Make sure Container has Privileged configured correctly if test.wantPrivileged { if ctn.SecurityContext == nil { diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index b24c36f0..3eae504d 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -56,8 +56,9 @@ func (c *client) InspectImage(ctx context.Context, ctn *pipeline.Container) ([]b } // marshal the image information from the container - // (-1 to convert to 0-based index, -1 for init which isn't a container) - image, err := json.MarshalIndent(c.Pod.Spec.Containers[ctn.Number-2].Image, "", " ") + image, err := json.MarshalIndent( + c.Pod.Spec.Containers[c.containersLookup[ctn.ID]].Image, "", " ", + ) if err != nil { return output, err } diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 9846bbd0..f35c4188 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -42,6 +42,8 @@ type client struct { Logger *logrus.Entry // https://pkg.go.dev/k8s.io/api/core/v1#Pod Pod *v1.Pod + // containersLookup maps the container name to its index in Containers + containersLookup map[string]int // PipelinePodTemplate has default values to be used in Setup* methods PipelinePodTemplate *velav1alpha1.PipelinePodTemplate // commonVolumeMounts includes workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) @@ -61,6 +63,7 @@ func New(opts ...ClientOpt) (*client, error) { // create new fields c.config = new(config) c.Pod = new(v1.Pod) + c.containersLookup = map[string]int{} // create new logger for the client // @@ -141,6 +144,11 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { c.config = new(config) c.Pod = new(v1.Pod) + c.containersLookup = map[string]int{} + for i, ctn := range _pod.Spec.Containers { + c.containersLookup[ctn.Name] = i + } + // create new logger for the client // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger From 9dd703a762a209598fbdc4e4d3222348d76170bc Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 19 Apr 2022 20:31:07 -0500 Subject: [PATCH 273/430] refactor: cleanup context passing in kubernetes runtime (#314) --- runtime/kubernetes/build.go | 13 +++++-------- runtime/kubernetes/container.go | 17 +++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index b93e88ad..3938cfef 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -45,10 +45,9 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { if c.PipelinePodTemplate == nil { if len(c.config.PipelinePodsTemplateName) > 0 { - // nolint: contextcheck // ignore non-inherited new context - podsTemplateResponse, err := c.VelaKubernetes.VelaV1alpha1().PipelinePodsTemplates(c.config.Namespace).Get( - context.Background(), c.config.PipelinePodsTemplateName, metav1.GetOptions{}, - ) + podsTemplateResponse, err := c.VelaKubernetes.VelaV1alpha1(). + PipelinePodsTemplates(c.config.Namespace). + Get(ctx, c.config.PipelinePodsTemplateName, metav1.GetOptions{}) if err != nil { return err } @@ -192,10 +191,9 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { // send API call to create the pod // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface - // nolint: contextcheck // ignore non-inherited new context _, err = c.Kubernetes.CoreV1(). Pods(c.config.Namespace). - Create(context.Background(), c.Pod, metav1.CreateOptions{}) + Create(ctx, c.Pod, metav1.CreateOptions{}) if err != nil { return err } @@ -233,10 +231,9 @@ func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { c.Logger.Infof("removing pod %s", c.Pod.ObjectMeta.Name) // send API call to delete the pod - // nolint: contextcheck // ignore non-inherited new context err := c.Kubernetes.CoreV1(). Pods(c.config.Namespace). - Delete(context.Background(), c.Pod.ObjectMeta.Name, opts) + Delete(ctx, c.Pod.ObjectMeta.Name, opts) if err != nil { return err } diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index b2003f3a..11428e3a 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -34,12 +34,9 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // send API call to capture the container // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface - // nolint: contextcheck // ignore non-inherited new context - pod, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Get( - context.Background(), - c.Pod.ObjectMeta.Name, - opts, - ) + pod, err := c.Kubernetes.CoreV1(). + Pods(c.config.Namespace). + Get(ctx, c.Pod.ObjectMeta.Name, opts) if err != nil { return err } @@ -104,9 +101,8 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // send API call to patch the pod with the new container image // // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface - // nolint: contextcheck // ignore non-inherited new context _, err = c.Kubernetes.CoreV1().Pods(c.config.Namespace).Patch( - context.Background(), + ctx, c.Pod.ObjectMeta.Name, types.StrategicMergePatchType, []byte(fmt.Sprintf(imagePatch, ctn.ID, _image)), @@ -343,8 +339,9 @@ func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) err // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface // -> // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface - // nolint: contextcheck // ignore non-inherited new context - podWatch, err := c.Kubernetes.CoreV1().Pods(c.config.Namespace).Watch(context.Background(), opts) + podWatch, err := c.Kubernetes.CoreV1(). + Pods(c.config.Namespace). + Watch(ctx, opts) if err != nil { return err } From 63cd482e741c847250f06cf782883112d64d61d3 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 22 Apr 2022 11:03:47 -0500 Subject: [PATCH 274/430] tests: Convert executor tests to subtests (#315) --- executor/context_test.go | 34 +- executor/executor_test.go | 39 ++- executor/linux/api_test.go | 93 +++--- executor/linux/build_test.go | 556 ++++++++++++++++++--------------- executor/linux/linux_test.go | 43 +-- executor/linux/opts_test.go | 330 ++++++++++--------- executor/linux/secret_test.go | 382 ++++++++++++---------- executor/linux/service_test.go | 297 ++++++++++-------- executor/linux/stage_test.go | 234 +++++++------- executor/linux/step_test.go | 334 +++++++++++--------- executor/local/api_test.go | 93 +++--- executor/local/build_test.go | 454 +++++++++++++++------------ executor/local/local_test.go | 43 +-- executor/local/opts_test.go | 208 +++++++----- executor/local/service_test.go | 266 +++++++++------- executor/local/stage_test.go | 222 +++++++------ executor/local/step_test.go | 284 +++++++++-------- executor/setup_test.go | 33 +- 18 files changed, 2211 insertions(+), 1734 deletions(-) diff --git a/executor/context_test.go b/executor/context_test.go index f8da2697..fc645ae4 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -51,19 +51,23 @@ func TestExecutor_FromContext(t *testing.T) { // setup tests tests := []struct { + name string context context.Context want Engine }{ { + name: "valid executor in context", // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, { + name: "executor not in context", context: context.Background(), want: nil, }, { + name: "invalid executor in context", // nolint: staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, @@ -72,11 +76,13 @@ func TestExecutor_FromContext(t *testing.T) { // run tests for _, test := range tests { - got := FromContext(test.context) + t.Run(test.name, func(t *testing.T) { + got := FromContext(test.context) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("FromContext is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromContext is %v, want %v", got, test.want) + } + }) } } @@ -110,21 +116,25 @@ func TestExecutor_FromGinContext(t *testing.T) { // setup tests tests := []struct { + name string context *gin.Context value interface{} want Engine }{ { + name: "valid executor in context", context: new(gin.Context), value: _engine, want: _engine, }, { + name: "executor not in context", context: new(gin.Context), value: nil, want: nil, }, { + name: "invalid executor in context", context: new(gin.Context), value: "foo", want: nil, @@ -133,15 +143,17 @@ func TestExecutor_FromGinContext(t *testing.T) { // run tests for _, test := range tests { - if test.value != nil { - test.context.Set(key, test.value) - } + t.Run(test.name, func(t *testing.T) { + if test.value != nil { + test.context.Set(key, test.value) + } - got := FromGinContext(test.context) + got := FromGinContext(test.context) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("FromGinContext is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("FromGinContext is %v, want %v", got, test.want) + } + }) } } diff --git a/executor/executor_test.go b/executor/executor_test.go index bbd56188..e69c2cea 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -73,11 +73,13 @@ func TestExecutor_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool setup *Setup want Engine }{ { + name: "driver-darwin", failure: true, setup: &Setup{ Build: _build, @@ -92,6 +94,7 @@ func TestExecutor_New(t *testing.T) { want: nil, }, { + name: "driver-linux", failure: false, setup: &Setup{ Build: _build, @@ -108,6 +111,7 @@ func TestExecutor_New(t *testing.T) { want: _linux, }, { + name: "driver-local", failure: false, setup: &Setup{ Build: _build, @@ -122,6 +126,7 @@ func TestExecutor_New(t *testing.T) { want: _local, }, { + name: "driver-windows", failure: true, setup: &Setup{ Build: _build, @@ -136,6 +141,7 @@ func TestExecutor_New(t *testing.T) { want: nil, }, { + name: "driver-invalid", failure: true, setup: &Setup{ Build: _build, @@ -150,6 +156,7 @@ func TestExecutor_New(t *testing.T) { want: nil, }, { + name: "driver-empty", failure: true, setup: &Setup{ Build: _build, @@ -167,27 +174,29 @@ func TestExecutor_New(t *testing.T) { // run tests for _, test := range tests { - got, err := New(test.setup) + t.Run(test.name, func(t *testing.T) { + got, err := New(test.setup) - if test.failure { - if err == nil { - t.Errorf("New should have returned err") + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + if !reflect.DeepEqual(got, test.want) { + t.Errorf("New is %v, want %v", got, test.want) + } + + return // continue to next test + } + + if err != nil { + t.Errorf("New returned err: %v", err) } if !reflect.DeepEqual(got, test.want) { t.Errorf("New is %v, want %v", got, test.want) } - - continue - } - - if err != nil { - t.Errorf("New returned err: %v", err) - } - - if !reflect.DeepEqual(got, test.want) { - t.Errorf("New is %v, want %v", got, test.want) - } + }) } } diff --git a/executor/linux/api_test.go b/executor/linux/api_test.go index 6004f806..7a1273f7 100644 --- a/executor/linux/api_test.go +++ b/executor/linux/api_test.go @@ -22,14 +22,17 @@ func TestLinux_GetBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with build", failure: false, engine: _engine, }, { + name: "missing build", failure: true, engine: new(client), }, @@ -37,23 +40,25 @@ func TestLinux_GetBuild(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetBuild() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetBuild() - if test.failure { - if err == nil { - t.Errorf("GetBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetBuild returned err: %v", err) - } + if err != nil { + t.Errorf("GetBuild returned err: %v", err) + } - if !reflect.DeepEqual(got, _build) { - t.Errorf("GetBuild is %v, want %v", got, _build) - } + if !reflect.DeepEqual(got, _build) { + t.Errorf("GetBuild is %v, want %v", got, _build) + } + }) } } @@ -70,14 +75,17 @@ func TestLinux_GetPipeline(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with pipeline", failure: false, engine: _engine, }, { + name: "missing pipeline", failure: true, engine: new(client), }, @@ -85,23 +93,25 @@ func TestLinux_GetPipeline(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetPipeline() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetPipeline() - if test.failure { - if err == nil { - t.Errorf("GetPipeline should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetPipeline should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetPipeline returned err: %v", err) - } + if err != nil { + t.Errorf("GetPipeline returned err: %v", err) + } - if !reflect.DeepEqual(got, _steps) { - t.Errorf("GetPipeline is %v, want %v", got, _steps) - } + if !reflect.DeepEqual(got, _steps) { + t.Errorf("GetPipeline is %v, want %v", got, _steps) + } + }) } } @@ -118,14 +128,17 @@ func TestLinux_GetRepo(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with repo", failure: false, engine: _engine, }, { + name: "missing repo", failure: true, engine: new(client), }, @@ -133,22 +146,24 @@ func TestLinux_GetRepo(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetRepo() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetRepo() - if test.failure { - if err == nil { - t.Errorf("GetRepo should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetRepo should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetRepo returned err: %v", err) - } + if err != nil { + t.Errorf("GetRepo returned err: %v", err) + } - if !reflect.DeepEqual(got, _repo) { - t.Errorf("GetRepo is %v, want %v", got, _repo) - } + if !reflect.DeepEqual(got, _repo) { + t.Errorf("GetRepo is %v, want %v", got, _repo) + } + }) } } diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index d690e65e..5c9a742f 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -47,31 +47,37 @@ func TestLinux_CreateBuild(t *testing.T) { } tests := []struct { + name string failure bool build *library.Build pipeline string }{ - { // basic secrets pipeline + { + name: "basic secrets pipeline", failure: false, build: _build, pipeline: "testdata/build/secrets/basic.yml", }, - { // basic services pipeline + { + name: "basic services pipeline", failure: false, build: _build, pipeline: "testdata/build/services/basic.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, build: _build, pipeline: "testdata/build/steps/basic.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, build: _build, pipeline: "testdata/build/stages/basic.yml", }, - { // steps pipeline with empty build + { + name: "steps pipeline with empty build", failure: true, build: new(library.Build), pipeline: "testdata/build/steps/basic.yml", @@ -80,41 +86,43 @@ func TestLinux_CreateBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithMetadata(_metadata). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(test.build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("CreateBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } - continue - } + _engine, err := New( + WithBuild(test.build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("CreateBuild should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("CreateBuild returned err: %v", err) - } + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + }) } } @@ -142,22 +150,27 @@ func TestLinux_PlanBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic secrets pipeline + { + name: "basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, @@ -165,47 +178,49 @@ func TestLinux_PlanBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithMetadata(_metadata). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.PlanBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("PlanBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) } - continue - } + err = _engine.PlanBuild(context.Background()) - if err != nil { - t.Errorf("PlanBuild returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("PlanBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("PlanBuild returned err: %v", err) + } + }) } } @@ -233,54 +248,67 @@ func TestLinux_AssembleBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic secrets pipeline + { + name: "basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, - { // secrets pipeline with image not found + { + name: "secrets pipeline with image not found", failure: true, pipeline: "testdata/build/secrets/img_notfound.yml", }, - { // secrets pipeline with ignoring image not found + { + name: "secrets pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/secrets/img_ignorenotfound.yml", }, - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with image not found + { + name: "services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, - { // services pipeline with ignoring image not found + { + name: "services pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with image not found + { + name: "steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, - { // steps pipeline with ignoring image not found + { + name: "steps pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with image not found + { + name: "stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, - { // stages pipeline with ignoring image not found + { + name: "stages pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, @@ -288,47 +316,49 @@ func TestLinux_AssembleBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithMetadata(_metadata). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.AssembleBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("AssembleBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } - continue - } + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.AssembleBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } - if err != nil { - t.Errorf("AssembleBuild returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + }) } } @@ -356,30 +386,37 @@ func TestLinux_ExecBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with image not found + { + name: "services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with image not found + { + name: "steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with image not found + { + name: "stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, @@ -387,81 +424,83 @@ func TestLinux_ExecBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithMetadata(_metadata). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - // TODO: hack - remove this - // - // When using our Docker mock we default the list of - // Docker images that have privileged access. One of - // these images is target/vela-git which is injected - // by the compiler into every build. - // - // The problem this causes is that we haven't called - // all the necessary functions we do in a real world - // scenario to ensure we can run privileged images. - // - // This is the necessary function to create the - // runtime host config so we can run images - // in a privileged fashion. - err = _runtime.CreateVolume(context.Background(), _pipeline) - if err != nil { - t.Errorf("unable to create runtime volume: %v", err) - } - - // TODO: hack - remove this - // - // When calling CreateBuild(), it will automatically set the - // test build object to a status of `created`. This happens - // because we use a mock for the go-vela/server in our tests - // which only returns dummy based responses. - // - // The problem this causes is that our container.Execute() - // function isn't setup to handle builds in a `created` state. - // - // In a real world scenario, we never would have a build - // in this state when we call ExecBuild() because the - // go-vela/server has logic to set it to an expected state. - _engine.build.SetStatus("running") - - err = _engine.ExecBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + // TODO: hack - remove this + // + // When using our Docker mock we default the list of + // Docker images that have privileged access. One of + // these images is target/vela-git which is injected + // by the compiler into every build. + // + // The problem this causes is that we haven't called + // all the necessary functions we do in a real world + // scenario to ensure we can run privileged images. + // + // This is the necessary function to create the + // runtime host config so we can run images + // in a privileged fashion. + err = _runtime.CreateVolume(context.Background(), _pipeline) + if err != nil { + t.Errorf("unable to create runtime volume: %v", err) + } + + // TODO: hack - remove this + // + // When calling CreateBuild(), it will automatically set the + // test build object to a status of `created`. This happens + // because we use a mock for the go-vela/server in our tests + // which only returns dummy based responses. + // + // The problem this causes is that our container.Execute() + // function isn't setup to handle builds in a `created` state. + // + // In a real world scenario, we never would have a build + // in this state when we call ExecBuild() because the + // go-vela/server has logic to set it to an expected state. + _engine.build.SetStatus("running") + + err = _engine.ExecBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + } + + return // continue to next test + } - if err != nil { - t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) - } + if err != nil { + t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) + } + }) } } @@ -489,38 +528,47 @@ func TestLinux_DestroyBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic secrets pipeline + { + name: "basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, - { // secrets pipeline with name not found + { + name: "secrets pipeline with name not found", failure: false, pipeline: "testdata/build/secrets/name_notfound.yml", }, - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with name not found + { + name: "services pipeline with name not found", failure: false, pipeline: "testdata/build/services/name_notfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with name not found + { + name: "steps pipeline with name not found", failure: false, pipeline: "testdata/build/steps/name_notfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with name not found + { + name: "stages pipeline with name not found", failure: false, pipeline: "testdata/build/stages/name_notfound.yml", }, @@ -528,46 +576,48 @@ func TestLinux_DestroyBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithMetadata(_metadata). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.DestroyBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("DestroyBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) } - continue - } + err = _engine.DestroyBuild(context.Background()) - if err != nil { - t.Errorf("DestroyBuild returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("DestroyBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyBuild returned err: %v", err) + } + }) } } diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index cd95faf3..82911867 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -39,14 +39,17 @@ func TestLinux_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool build *library.Build }{ { + name: "with build", failure: false, build: testBuild(), }, { + name: "nil build", failure: true, build: nil, }, @@ -54,27 +57,29 @@ func TestLinux_New(t *testing.T) { // run tests for _, test := range tests { - _, err := New( - WithBuild(test.build), - WithHostname("localhost"), - WithPipeline(testSteps()), - WithRepo(testRepo()), - WithRuntime(_runtime), - WithUser(testUser()), - WithVelaClient(_client), - ) - - if test.failure { - if err == nil { - t.Errorf("New should have returned err") + t.Run(test.name, func(t *testing.T) { + _, err := New( + WithBuild(test.build), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + return // continue to next test } - continue - } - - if err != nil { - t.Errorf("New returned err: %v", err) - } + if err != nil { + t.Errorf("New returned err: %v", err) + } + }) } } diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 4d2f2621..9e4ed641 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -28,14 +28,17 @@ func TestLinux_Opt_WithBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool build *library.Build }{ { + name: "build", failure: false, build: _build, }, { + name: "nil build", failure: true, build: nil, }, @@ -43,43 +46,49 @@ func TestLinux_Opt_WithBuild(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(test.build), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(test.build), + ) - if test.failure { - if err == nil { - t.Errorf("WithBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithBuild returned err: %v", err) - } + if err != nil { + t.Errorf("WithBuild returned err: %v", err) + } - if !reflect.DeepEqual(_engine.build, _build) { - t.Errorf("WithBuild is %v, want %v", _engine.build, _build) - } + if !reflect.DeepEqual(_engine.build, _build) { + t.Errorf("WithBuild is %v, want %v", _engine.build, _build) + } + }) } } func TestLinux_Opt_WithLogMethod(t *testing.T) { // setup tests tests := []struct { + name string failure bool logMethod string }{ { + name: "byte-chunks", failure: false, logMethod: "byte-chunks", }, { + name: "time-chunks", failure: false, logMethod: "time-chunks", }, { + name: "empty", failure: true, logMethod: "", }, @@ -87,35 +96,39 @@ func TestLinux_Opt_WithLogMethod(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithLogMethod(test.logMethod), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithLogMethod(test.logMethod), + ) - if test.failure { - if err == nil { - t.Errorf("WithLogMethod should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithLogMethod should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithLogMethod returned err: %v", err) - } + if err != nil { + t.Errorf("WithLogMethod returned err: %v", err) + } - if !reflect.DeepEqual(_engine.logMethod, test.logMethod) { - t.Errorf("WithLogMethod is %v, want %v", _engine.logMethod, test.logMethod) - } + if !reflect.DeepEqual(_engine.logMethod, test.logMethod) { + t.Errorf("WithLogMethod is %v, want %v", _engine.logMethod, test.logMethod) + } + }) } } func TestLinux_Opt_WithMaxLogSize(t *testing.T) { // setup tests tests := []struct { + name string failure bool maxLogSize uint }{ { + name: "defined", failure: false, maxLogSize: 2097152, }, @@ -123,38 +136,43 @@ func TestLinux_Opt_WithMaxLogSize(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithMaxLogSize(test.maxLogSize), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithMaxLogSize(test.maxLogSize), + ) - if test.failure { - if err == nil { - t.Errorf("WithMaxLogSize should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithMaxLogSize should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithMaxLogSize returned err: %v", err) - } + if err != nil { + t.Errorf("WithMaxLogSize returned err: %v", err) + } - if !reflect.DeepEqual(_engine.maxLogSize, test.maxLogSize) { - t.Errorf("WithMaxLogSize is %v, want %v", _engine.maxLogSize, test.maxLogSize) - } + if !reflect.DeepEqual(_engine.maxLogSize, test.maxLogSize) { + t.Errorf("WithMaxLogSize is %v, want %v", _engine.maxLogSize, test.maxLogSize) + } + }) } } func TestLinux_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { + name string hostname string want string }{ { + name: "dns hostname", hostname: "vela.worker.localhost", want: "vela.worker.localhost", }, { + name: "empty hostname is localhost", hostname: "", want: "localhost", }, @@ -162,16 +180,18 @@ func TestLinux_Opt_WithHostname(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithHostname(test.hostname), - ) - if err != nil { - t.Errorf("unable to create linux engine: %v", err) - } - - if !reflect.DeepEqual(_engine.Hostname, test.want) { - t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithHostname(test.hostname), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Hostname, test.want) { + t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) + } + }) } } @@ -181,14 +201,17 @@ func TestLinux_Opt_WithPipeline(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps pipeline", failure: false, pipeline: _steps, }, { + name: "nil pipeline", failure: true, pipeline: nil, }, @@ -196,25 +219,27 @@ func TestLinux_Opt_WithPipeline(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithPipeline(test.pipeline), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithPipeline(test.pipeline), + ) - if test.failure { - if err == nil { - t.Errorf("WithPipeline should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithPipeline should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithPipeline returned err: %v", err) - } + if err != nil { + t.Errorf("WithPipeline returned err: %v", err) + } - if !reflect.DeepEqual(_engine.pipeline, _steps) { - t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) - } + if !reflect.DeepEqual(_engine.pipeline, _steps) { + t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) + } + }) } } @@ -224,14 +249,17 @@ func TestLinux_Opt_WithRepo(t *testing.T) { // setup tests tests := []struct { + name string failure bool repo *library.Repo }{ { + name: "repo", failure: false, repo: _repo, }, { + name: "nil repo", failure: true, repo: nil, }, @@ -239,25 +267,27 @@ func TestLinux_Opt_WithRepo(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithRepo(test.repo), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithRepo(test.repo), + ) - if test.failure { - if err == nil { - t.Errorf("WithRepo should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithRepo should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithRepo returned err: %v", err) - } + if err != nil { + t.Errorf("WithRepo returned err: %v", err) + } - if !reflect.DeepEqual(_engine.repo, _repo) { - t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) - } + if !reflect.DeepEqual(_engine.repo, _repo) { + t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) + } + }) } } @@ -270,14 +300,17 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { // setup tests tests := []struct { + name string failure bool runtime runtime.Engine }{ { + name: "docker runtime", failure: false, runtime: _runtime, }, { + name: "nil runtime", failure: true, runtime: nil, }, @@ -285,25 +318,27 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithRuntime(test.runtime), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithRuntime(test.runtime), + ) - if test.failure { - if err == nil { - t.Errorf("WithRuntime should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithRuntime should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithRuntime returned err: %v", err) - } + if err != nil { + t.Errorf("WithRuntime returned err: %v", err) + } - if !reflect.DeepEqual(_engine.Runtime, _runtime) { - t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) - } + if !reflect.DeepEqual(_engine.Runtime, _runtime) { + t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) + } + }) } } @@ -313,14 +348,17 @@ func TestLinux_Opt_WithUser(t *testing.T) { // setup tests tests := []struct { + name string failure bool user *library.User }{ { + name: "user", failure: false, user: _user, }, { + name: "nil user", failure: true, user: nil, }, @@ -328,25 +366,27 @@ func TestLinux_Opt_WithUser(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithUser(test.user), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithUser(test.user), + ) - if test.failure { - if err == nil { - t.Errorf("WithUser should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithUser should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithUser returned err: %v", err) - } + if err != nil { + t.Errorf("WithUser returned err: %v", err) + } - if !reflect.DeepEqual(_engine.user, _user) { - t.Errorf("WithUser is %v, want %v", _engine.user, _user) - } + if !reflect.DeepEqual(_engine.user, _user) { + t.Errorf("WithUser is %v, want %v", _engine.user, _user) + } + }) } } @@ -363,14 +403,17 @@ func TestLinux_Opt_WithVelaClient(t *testing.T) { // setup tests tests := []struct { + name string failure bool client *vela.Client }{ { + name: "vela client", failure: false, client: _client, }, { + name: "nil vela client", failure: true, client: nil, }, @@ -378,39 +421,44 @@ func TestLinux_Opt_WithVelaClient(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithVelaClient(test.client), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithVelaClient(test.client), + ) - if test.failure { - if err == nil { - t.Errorf("WithVelaClient should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithVelaClient should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithVelaClient returned err: %v", err) - } + if err != nil { + t.Errorf("WithVelaClient returned err: %v", err) + } - if !reflect.DeepEqual(_engine.Vela, _client) { - t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) - } + if !reflect.DeepEqual(_engine.Vela, _client) { + t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) + } + }) } } func TestLinux_Opt_WithVersion(t *testing.T) { // setup tests tests := []struct { + name string version string want string }{ { + name: "version", version: "v1.0.0", want: "v1.0.0", }, { + name: "empty version", version: "", want: "v0.0.0", }, @@ -418,15 +466,17 @@ func TestLinux_Opt_WithVersion(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithVersion(test.version), - ) - if err != nil { - t.Errorf("unable to create linux engine: %v", err) - } - - if !reflect.DeepEqual(_engine.Version, test.want) { - t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithVersion(test.version), + ) + if err != nil { + t.Errorf("unable to create linux engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Version, test.want) { + t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) + } + }) } } diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 66ebd4da..24427f8c 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -51,10 +51,12 @@ func TestLinux_Secret_create(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ { + name: "good image tag", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -67,6 +69,7 @@ func TestLinux_Secret_create(t *testing.T) { }, }, { + name: "notfound image tag", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -82,31 +85,33 @@ func TestLinux_Secret_create(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(_steps), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.secret.create(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("create should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.secret.create(context.Background(), test.container) - if err != nil { - t.Errorf("create returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("create should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("create returned err: %v", err) + } + }) } } @@ -138,11 +143,13 @@ func TestLinux_Secret_delete(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container step *library.Step }{ { + name: "running container-empty step", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -156,6 +163,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), }, { + name: "running container-pending step", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -169,6 +177,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: _step, }, { + name: "inspecting container failure due to invalid container id", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_notfound", @@ -182,6 +191,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), }, { + name: "removing container failure", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_ignorenotfound", @@ -198,35 +208,37 @@ func TestLinux_Secret_delete(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(_steps), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - _ = _engine.CreateBuild(context.Background()) - - _engine.steps.Store(test.container.ID, test.step) - - err = _engine.secret.destroy(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("destroy should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + _ = _engine.CreateBuild(context.Background()) + + _engine.steps.Store(test.container.ID, test.step) + + err = _engine.secret.destroy(context.Background(), test.container) - if err != nil { - t.Errorf("destroy returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("destroy should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("destroy returned err: %v", err) + } + }) } } @@ -255,14 +267,17 @@ func TestLinux_Secret_exec(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline string }{ - { // basic secrets pipeline + { + name: "basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, - { // pipeline with secret name not found + { + name: "pipeline with secret name not found", failure: true, pipeline: "testdata/build/secrets/name_notfound.yml", }, @@ -270,45 +285,47 @@ func TestLinux_Secret_exec(t *testing.T) { // run tests for _, test := range tests { - file, _ := ioutil.ReadFile(test.pipeline) - - p, _ := compiler. - WithBuild(_build). - WithRepo(_repo). - WithUser(_user). - WithMetadata(_metadata). - Compile(file) - - _engine, err := New( - WithBuild(_build), - WithPipeline(p), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - _engine.build.SetStatus(constants.StatusSuccess) - - // add init container info to client - _ = _engine.CreateBuild(context.Background()) - - err = _engine.secret.exec(context.Background(), &p.Secrets) - - if test.failure { - if err == nil { - t.Errorf("exec should have returned err") + t.Run(test.name, func(t *testing.T) { + file, _ := ioutil.ReadFile(test.pipeline) + + p, _ := compiler. + WithBuild(_build). + WithRepo(_repo). + WithUser(_user). + WithMetadata(_metadata). + Compile(file) + + _engine, err := New( + WithBuild(_build), + WithPipeline(p), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + _engine.build.SetStatus(constants.StatusSuccess) + + // add init container info to client + _ = _engine.CreateBuild(context.Background()) + + err = _engine.secret.exec(context.Background(), &p.Secrets) + + if test.failure { + if err == nil { + t.Errorf("exec should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("exec returned err: %v", err) - } + if err != nil { + t.Errorf("exec returned err: %v", err) + } + }) } } @@ -334,10 +351,12 @@ func TestLinux_Secret_pull(t *testing.T) { // setup tests tests := []struct { + name string failure bool secret *pipeline.Secret }{ - { // success with org secret + { + name: "success with org secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -348,7 +367,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with invalid org secret + { + name: "failure with invalid org secret", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -359,7 +379,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with org secret key not found + { + name: "failure with org secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -370,7 +391,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // success with repo secret + { + name: "success with repo secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -381,7 +403,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with invalid repo secret + { + name: "failure with invalid repo secret", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -392,7 +415,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with repo secret key not found + { + name: "failure with repo secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -403,7 +427,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // success with shared secret + { + name: "success with shared secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -414,7 +439,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with shared secret key not found + { + name: "failure with shared secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -425,7 +451,8 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, - { // failure with invalid type + { + name: "failure with invalid type", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -440,31 +467,33 @@ func TestLinux_Secret_pull(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(testSteps()), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - _, err = _engine.secret.pull(test.secret) - - if test.failure { - if err == nil { - t.Errorf("pull should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(testSteps()), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + _, err = _engine.secret.pull(test.secret) + + if test.failure { + if err == nil { + t.Errorf("pull should have returned err") + } - if err != nil { - t.Errorf("pull returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("pull returned err: %v", err) + } + }) } } @@ -491,11 +520,13 @@ func TestLinux_Secret_stream(t *testing.T) { // setup tests tests := []struct { + name string failure bool logs *library.Log container *pipeline.Container }{ - { // container step succeeds + { + name: "container step succeeds", failure: false, logs: new(library.Log), container: &pipeline.Container{ @@ -508,7 +539,8 @@ func TestLinux_Secret_stream(t *testing.T) { Pull: "always", }, }, - { // container step fails because of invalid container id + { + name: "container step fails because of invalid container id", failure: true, logs: new(library.Log), container: &pipeline.Container{ @@ -525,34 +557,36 @@ func TestLinux_Secret_stream(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(_steps), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // add init container info to client - _ = _engine.CreateBuild(context.Background()) - - err = _engine.secret.stream(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("stream should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(_steps), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + // add init container info to client + _ = _engine.CreateBuild(context.Background()) + + err = _engine.secret.stream(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("stream should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("stream returned err: %v", err) - } + if err != nil { + t.Errorf("stream returned err: %v", err) + } + }) } } @@ -562,12 +596,14 @@ func TestLinux_Secret_injectSecret(t *testing.T) { // setup types tests := []struct { + name string step *pipeline.Container msec map[string]*library.Secret want *pipeline.Container }{ // Tests for secrets with image ACLs { + name: "secret with empty image ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -580,6 +616,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with matching image ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -592,6 +629,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with matching image:tag ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -604,6 +642,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching image ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -618,6 +657,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { // Tests for secrets with event ACLs { // push event checks + name: "secret with matching push event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "push"}, @@ -630,6 +670,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching push event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "push"}, @@ -642,6 +683,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { // pull_request event checks + name: "secret with matching pull_request event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "pull_request"}, @@ -654,6 +696,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching pull_request event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "pull_request"}, @@ -666,6 +709,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { // tag event checks + name: "secret with matching tag event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "tag"}, @@ -678,6 +722,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching tag event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "tag"}, @@ -690,6 +735,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { // deployment event checks + name: "secret with matching deployment event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "deployment"}, @@ -702,6 +748,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching deployment event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "deployment"}, @@ -716,6 +763,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { // Tests for secrets with event and image ACLs { + name: "secret with matching event ACL and non-matching image ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "push"}, @@ -728,6 +776,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with non-matching event ACL and matching image ACL not injected", step: &pipeline.Container{ Image: "centos:latest", Environment: map[string]string{"BUILD_EVENT": "push"}, @@ -740,6 +789,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { }, }, { + name: "secret with matching event ACL and matching image ACL injected", step: &pipeline.Container{ Image: "alpine:latest", Environment: map[string]string{"BUILD_EVENT": "push"}, @@ -755,15 +805,17 @@ func TestLinux_Secret_injectSecret(t *testing.T) { // run test for _, test := range tests { - _ = injectSecrets(test.step, test.msec) - got := test.step - - // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. - // Switching to a Google library for increased clarity. - // https://github.com/google/go-cmp - if diff := cmp.Diff(test.want.Environment, got.Environment); diff != "" { - t.Errorf("injectSecrets mismatch (-want +got):\n%s", diff) - } + t.Run(test.name, func(t *testing.T) { + _ = injectSecrets(test.step, test.msec) + got := test.step + + // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. + // Switching to a Google library for increased clarity. + // https://github.com/google/go-cmp + if diff := cmp.Diff(test.want.Environment, got.Environment); diff != "" { + t.Errorf("injectSecrets mismatch (-want +got):\n%s", diff) + } + }) } } @@ -778,15 +830,17 @@ func TestLinux_Secret_escapeNewlineSecrets(t *testing.T) { // setup types tests := []struct { + name string secretMap map[string]*library.Secret want map[string]*library.Secret }{ - { + name: "not escaped", secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &v}}, want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, }, { + name: "already escaped", secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &vEscaped}}, want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, }, @@ -794,14 +848,16 @@ func TestLinux_Secret_escapeNewlineSecrets(t *testing.T) { // run test for _, test := range tests { - escapeNewlineSecrets(test.secretMap) - got := test.secretMap - - // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. - // Switching to a Google library for increased clarity. - // https://github.com/google/go-cmp - if diff := cmp.Diff(test.want, got); diff != "" { - t.Errorf("escapeNewlineSecrets mismatch (-want +got):\n%s", diff) - } + t.Run(test.name, func(t *testing.T) { + escapeNewlineSecrets(test.secretMap) + got := test.secretMap + + // Preferred use of reflect.DeepEqual(x, y interface) is giving false positives. + // Switching to a Google library for increased clarity. + // https://github.com/google/go-cmp + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("escapeNewlineSecrets mismatch (-want +got):\n%s", diff) + } + }) } } diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index ab9fee11..70ca8aec 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -43,10 +43,12 @@ func TestLinux_CreateService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -60,7 +62,8 @@ func TestLinux_CreateService(t *testing.T) { Pull: "not_present", }, }, - { // service container with image not found + { + name: "service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -74,7 +77,8 @@ func TestLinux_CreateService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -82,31 +86,33 @@ func TestLinux_CreateService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("CreateService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.CreateService(context.Background(), test.container) - if err != nil { - t.Errorf("CreateService returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("CreateService should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("CreateService returned err: %v", err) + } + }) } } @@ -132,10 +138,12 @@ func TestLinux_PlanService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -149,7 +157,8 @@ func TestLinux_PlanService(t *testing.T) { Pull: "not_present", }, }, - { // service container with nil environment + { + name: "service container with nil environment", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -163,7 +172,8 @@ func TestLinux_PlanService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -171,31 +181,33 @@ func TestLinux_PlanService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("PlanService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanService should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("PlanService returned err: %v", err) - } + if err != nil { + t.Errorf("PlanService returned err: %v", err) + } + }) } } @@ -221,10 +233,12 @@ func TestLinux_ExecService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -238,7 +252,8 @@ func TestLinux_ExecService(t *testing.T) { Pull: "not_present", }, }, - { // service container with image not found + { + name: "service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -252,7 +267,8 @@ func TestLinux_ExecService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -260,36 +276,38 @@ func TestLinux_ExecService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) - _engine.serviceLogs.Store(test.container.ID, new(library.Log)) - } - - err = _engine.ExecService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("ExecService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + _engine.serviceLogs.Store(test.container.ID, new(library.Log)) } - continue - } + err = _engine.ExecService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecService should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("ExecService returned err: %v", err) - } + if err != nil { + t.Errorf("ExecService returned err: %v", err) + } + }) } } @@ -315,10 +333,12 @@ func TestLinux_StreamService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -332,7 +352,8 @@ func TestLinux_StreamService(t *testing.T) { Pull: "not_present", }, }, - { // service container with name not found + { + name: "service container with name not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_notfound", @@ -346,7 +367,8 @@ func TestLinux_StreamService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -354,36 +376,38 @@ func TestLinux_StreamService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) - _engine.serviceLogs.Store(test.container.ID, new(library.Log)) - } - - err = _engine.StreamService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("StreamService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + _engine.serviceLogs.Store(test.container.ID, new(library.Log)) } - continue - } + err = _engine.StreamService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamService should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("StreamService returned err: %v", err) - } + if err != nil { + t.Errorf("StreamService returned err: %v", err) + } + }) } } @@ -409,10 +433,12 @@ func TestLinux_DestroyService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -426,7 +452,8 @@ func TestLinux_DestroyService(t *testing.T) { Pull: "not_present", }, }, - { // service container with ignoring name not found + { + name: "service container with ignoring name not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_ignorenotfound", @@ -444,30 +471,32 @@ func TestLinux_DestroyService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("DestroyService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyService should have returned err") + } - if err != nil { - t.Errorf("DestroyService returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyService returned err: %v", err) + } + }) } } diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 2ac87e9d..0b2ad832 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -61,10 +61,12 @@ func TestLinux_CreateStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -81,7 +83,8 @@ func TestLinux_CreateStage(t *testing.T) { }, }, }, - { // stage with step container with image not found + { + name: "stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -98,7 +101,8 @@ func TestLinux_CreateStage(t *testing.T) { }, }, }, - { // empty stage + { + name: "empty stage", failure: true, stage: new(pipeline.Stage), }, @@ -106,39 +110,41 @@ func TestLinux_CreateStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if len(test.stage.Name) > 0 { - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("unable to create executor engine: %v", err) } - } - err = _engine.CreateStage(context.Background(), test.stage) - - if test.failure { - if err == nil { - t.Errorf("CreateStage should have returned err") + if len(test.stage.Name) > 0 { + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } } - continue - } + err = _engine.CreateStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("CreateStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("CreateStage returned err: %v", err) - } + if err != nil { + t.Errorf("CreateStage returned err: %v", err) + } + }) } } @@ -178,11 +184,13 @@ func TestLinux_PlanStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage stageMap *sync.Map }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -200,7 +208,8 @@ func TestLinux_PlanStage(t *testing.T) { }, stageMap: new(sync.Map), }, - { // basic stage with nil stage map + { + name: "basic stage with nil stage map", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -219,7 +228,8 @@ func TestLinux_PlanStage(t *testing.T) { }, stageMap: testMap, }, - { // basic stage with error stage map + { + name: "basic stage with error stage map", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -242,31 +252,33 @@ func TestLinux_PlanStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) - - if test.failure { - if err == nil { - t.Errorf("PlanStage should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) + + if test.failure { + if err == nil { + t.Errorf("PlanStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("PlanStage returned err: %v", err) - } + if err != nil { + t.Errorf("PlanStage returned err: %v", err) + } + }) } } @@ -292,10 +304,12 @@ func TestLinux_ExecStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -312,7 +326,8 @@ func TestLinux_ExecStage(t *testing.T) { }, }, }, - { // stage with step container with image not found + { + name: "stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -329,7 +344,8 @@ func TestLinux_ExecStage(t *testing.T) { }, }, }, - { // stage with step container with bad number + { + name: "stage with step container with bad number", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -350,34 +366,36 @@ func TestLinux_ExecStage(t *testing.T) { // run tests for _, test := range tests { - stageMap := new(sync.Map) - stageMap.Store("echo", make(chan error, 1)) - - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.ExecStage(context.Background(), test.stage, stageMap) - - if test.failure { - if err == nil { - t.Errorf("ExecStage should have returned err") + t.Run(test.name, func(t *testing.T) { + stageMap := new(sync.Map) + stageMap.Store("echo", make(chan error, 1)) + + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.ExecStage(context.Background(), test.stage, stageMap) + + if test.failure { + if err == nil { + t.Errorf("ExecStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("ExecStage returned err: %v", err) - } + if err != nil { + t.Errorf("ExecStage returned err: %v", err) + } + }) } } @@ -403,10 +421,12 @@ func TestLinux_DestroyStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -427,30 +447,32 @@ func TestLinux_DestroyStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyStage(context.Background(), test.stage) - - if test.failure { - if err == nil { - t.Errorf("DestroyStage should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("DestroyStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("DestroyStage returned err: %v", err) - } + if err != nil { + t.Errorf("DestroyStage returned err: %v", err) + } + }) } } diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index ace74ba0..4012238c 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -45,10 +45,12 @@ func TestLinux_CreateStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -60,7 +62,8 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -72,7 +75,8 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with image not found + { + name: "step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -84,7 +88,8 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -92,31 +97,33 @@ func TestLinux_CreateStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("CreateStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.CreateStep(context.Background(), test.container) - if err != nil { - t.Errorf("CreateStep returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("CreateStep should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("CreateStep returned err: %v", err) + } + }) } } @@ -142,10 +149,12 @@ func TestLinux_PlanStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -157,7 +166,8 @@ func TestLinux_PlanStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with nil environment + { + name: "step container with nil environment", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -169,7 +179,8 @@ func TestLinux_PlanStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -177,31 +188,33 @@ func TestLinux_PlanStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("PlanStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanStep should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("PlanStep returned err: %v", err) - } + if err != nil { + t.Errorf("PlanStep returned err: %v", err) + } + }) } } @@ -227,10 +240,12 @@ func TestLinux_ExecStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -242,7 +257,8 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -254,7 +270,8 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // detached step container + { + name: "detached step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -267,7 +284,8 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with image not found + { + name: "step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -279,7 +297,8 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -287,36 +306,38 @@ func TestLinux_ExecStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) - _engine.stepLogs.Store(test.container.ID, new(library.Log)) - } - - err = _engine.ExecStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("ExecStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.stepLogs.Store(test.container.ID, new(library.Log)) } - continue - } + err = _engine.ExecStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecStep should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("ExecStep returned err: %v", err) - } + if err != nil { + t.Errorf("ExecStep returned err: %v", err) + } + }) } } @@ -347,11 +368,13 @@ func TestLinux_StreamStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool logs *library.Log container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, logs: _logs, container: &pipeline.Container{ @@ -364,7 +387,8 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, logs: _logs, container: &pipeline.Container{ @@ -377,7 +401,8 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with name not found + { + name: "step container with name not found", failure: true, logs: _logs, container: &pipeline.Container{ @@ -390,7 +415,8 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, logs: _logs, container: new(pipeline.Container), @@ -399,37 +425,39 @@ func TestLinux_StreamStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithMaxLogSize(10), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) - _engine.stepLogs.Store(test.container.ID, new(library.Log)) - } - - err = _engine.StreamStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("StreamStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithMaxLogSize(10), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.stepLogs.Store(test.container.ID, new(library.Log)) } - continue - } + err = _engine.StreamStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamStep should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("StreamStep returned err: %v", err) - } + if err != nil { + t.Errorf("StreamStep returned err: %v", err) + } + }) } } @@ -455,10 +483,12 @@ func TestLinux_DestroyStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -470,7 +500,8 @@ func TestLinux_DestroyStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -482,7 +513,8 @@ func TestLinux_DestroyStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with ignoring name not found + { + name: "step container with ignoring name not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_ignorenotfound", @@ -498,31 +530,33 @@ func TestLinux_DestroyStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - WithVelaClient(_client), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("DestroyStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyStep should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("DestroyStep returned err: %v", err) - } + if err != nil { + t.Errorf("DestroyStep returned err: %v", err) + } + }) } } @@ -533,10 +567,12 @@ func TestLinux_getSecretValues(t *testing.T) { } tests := []struct { + name string want []string container *pipeline.Container }{ - { // no secrets container + { + name: "no secrets container", want: []string{}, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -548,7 +584,8 @@ func TestLinux_getSecretValues(t *testing.T) { Pull: "not_present", }, }, - { // secrets container + { + name: "secrets container", want: []string{"secretUser", "secretPass"}, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -578,7 +615,8 @@ func TestLinux_getSecretValues(t *testing.T) { }, }, }, - { // secrets container with file as value + { + name: "secrets container with file as value", want: []string{"secretUser", "this is a secret"}, container: &pipeline.Container{ ID: "step_github_octocat_1_ignorenotfound", @@ -607,10 +645,12 @@ func TestLinux_getSecretValues(t *testing.T) { } // run tests for _, test := range tests { - got := getSecretValues(test.container) + t.Run(test.name, func(t *testing.T) { + got := getSecretValues(test.container) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("getSecretValues is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("getSecretValues is %v, want %v", got, test.want) + } + }) } } diff --git a/executor/local/api_test.go b/executor/local/api_test.go index 0b909732..fa0e7a15 100644 --- a/executor/local/api_test.go +++ b/executor/local/api_test.go @@ -22,14 +22,17 @@ func TestLocal_GetBuild(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with build", failure: false, engine: _engine, }, { + name: "missing build", failure: true, engine: new(client), }, @@ -37,23 +40,25 @@ func TestLocal_GetBuild(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetBuild() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetBuild() - if test.failure { - if err == nil { - t.Errorf("GetBuild should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetBuild should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetBuild returned err: %v", err) - } + if err != nil { + t.Errorf("GetBuild returned err: %v", err) + } - if !reflect.DeepEqual(got, _build) { - t.Errorf("GetBuild is %v, want %v", got, _build) - } + if !reflect.DeepEqual(got, _build) { + t.Errorf("GetBuild is %v, want %v", got, _build) + } + }) } } @@ -70,14 +75,17 @@ func TestLocal_GetPipeline(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with pipeline", failure: false, engine: _engine, }, { + name: "missing pipeline", failure: true, engine: new(client), }, @@ -85,23 +93,25 @@ func TestLocal_GetPipeline(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetPipeline() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetPipeline() - if test.failure { - if err == nil { - t.Errorf("GetPipeline should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetPipeline should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetPipeline returned err: %v", err) - } + if err != nil { + t.Errorf("GetPipeline returned err: %v", err) + } - if !reflect.DeepEqual(got, _steps) { - t.Errorf("GetPipeline is %v, want %v", got, _steps) - } + if !reflect.DeepEqual(got, _steps) { + t.Errorf("GetPipeline is %v, want %v", got, _steps) + } + }) } } @@ -118,14 +128,17 @@ func TestLocal_GetRepo(t *testing.T) { // setup tests tests := []struct { + name string failure bool engine *client }{ { + name: "with repo", failure: false, engine: _engine, }, { + name: "missing repo", failure: true, engine: new(client), }, @@ -133,22 +146,24 @@ func TestLocal_GetRepo(t *testing.T) { // run tests for _, test := range tests { - got, err := test.engine.GetRepo() + t.Run(test.name, func(t *testing.T) { + got, err := test.engine.GetRepo() - if test.failure { - if err == nil { - t.Errorf("GetRepo should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("GetRepo should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("GetRepo returned err: %v", err) - } + if err != nil { + t.Errorf("GetRepo returned err: %v", err) + } - if !reflect.DeepEqual(got, _repo) { - t.Errorf("GetRepo is %v, want %v", got, _repo) - } + if !reflect.DeepEqual(got, _repo) { + t.Errorf("GetRepo is %v, want %v", got, _repo) + } + }) } } diff --git a/executor/local/build_test.go b/executor/local/build_test.go index 8e687173..fa95675c 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -29,18 +29,22 @@ func TestLocal_CreateBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, @@ -48,40 +52,42 @@ func TestLocal_CreateBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithLocal(true). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("CreateBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } - continue - } + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("CreateBuild should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("CreateBuild returned err: %v", err) - } + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + }) } } @@ -99,18 +105,22 @@ func TestLocal_PlanBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, @@ -118,46 +128,48 @@ func TestLocal_PlanBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithLocal(true). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.PlanBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("PlanBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) } - continue - } + err = _engine.PlanBuild(context.Background()) - if err != nil { - t.Errorf("PlanBuild returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("PlanBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("PlanBuild returned err: %v", err) + } + }) } } @@ -175,42 +187,52 @@ func TestLocal_AssembleBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with image not found + { + name: "services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, - { // services pipeline with ignoring image not found + { + name: "services pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with image not found + { + name: "steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, - { // steps pipeline with ignoring image not found + { + name: "steps pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with image not found + { + name: "stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, - { // stages pipeline with ignoring image not found + { + name: "stages pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, @@ -218,46 +240,48 @@ func TestLocal_AssembleBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithLocal(true). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.AssembleBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("AssembleBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } - continue - } + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.AssembleBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("AssembleBuild should have returned err") + } - if err != nil { - t.Errorf("AssembleBuild returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("AssembleBuild returned err: %v", err) + } + }) } } @@ -275,30 +299,37 @@ func TestLocal_ExecBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with image not found + { + name: "services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with image not found + { + name: "steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with image not found + { + name: "stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, @@ -306,46 +337,48 @@ func TestLocal_ExecBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithLocal(true). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.ExecBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.ExecBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + } + + return // continue to next test + } - if err != nil { - t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) - } + if err != nil { + t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) + } + }) } } @@ -363,30 +396,37 @@ func TestLocal_DestroyBuild(t *testing.T) { } tests := []struct { + name string failure bool pipeline string }{ - { // basic services pipeline + { + name: "basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, - { // services pipeline with name not found + { + name: "services pipeline with name not found", failure: false, pipeline: "testdata/build/services/name_notfound.yml", }, - { // basic steps pipeline + { + name: "basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, - { // steps pipeline with name not found + { + name: "steps pipeline with name not found", failure: false, pipeline: "testdata/build/steps/name_notfound.yml", }, - { // basic stages pipeline + { + name: "basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, - { // stages pipeline with name not found + { + name: "stages pipeline with name not found", failure: false, pipeline: "testdata/build/stages/name_notfound.yml", }, @@ -394,45 +434,47 @@ func TestLocal_DestroyBuild(t *testing.T) { // run test for _, test := range tests { - _pipeline, err := compiler. - WithBuild(_build). - WithRepo(_repo). - WithLocal(true). - WithUser(_user). - Compile(test.pipeline) - if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) - } - - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.DestroyBuild(context.Background()) - - if test.failure { - if err == nil { - t.Errorf("DestroyBuild should have returned err") + t.Run(test.name, func(t *testing.T) { + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) } - continue - } + err = _engine.DestroyBuild(context.Background()) - if err != nil { - t.Errorf("DestroyBuild returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("DestroyBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyBuild returned err: %v", err) + } + }) } } diff --git a/executor/local/local_test.go b/executor/local/local_test.go index c3644e3a..083a0ca3 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -38,14 +38,17 @@ func TestLocal_New(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps pipeline", failure: false, pipeline: testSteps(), }, { + name: "nil pipeline", failure: true, pipeline: nil, }, @@ -53,27 +56,29 @@ func TestLocal_New(t *testing.T) { // run tests for _, test := range tests { - _, err := New( - WithBuild(testBuild()), - WithHostname("localhost"), - WithPipeline(test.pipeline), - WithRepo(testRepo()), - WithRuntime(_runtime), - WithUser(testUser()), - WithVelaClient(_client), - ) - - if test.failure { - if err == nil { - t.Errorf("New should have returned err") + t.Run(test.name, func(t *testing.T) { + _, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(test.pipeline), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + + if test.failure { + if err == nil { + t.Errorf("New should have returned err") + } + + return // continue to next test } - continue - } - - if err != nil { - t.Errorf("New returned err: %v", err) - } + if err != nil { + t.Errorf("New returned err: %v", err) + } + }) } } diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index e55975c1..f8fd1dc6 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -28,40 +28,47 @@ func TestLocal_Opt_WithBuild(t *testing.T) { // setup tests tests := []struct { + name string build *library.Build }{ { + name: "build", build: _build, }, } // run tests for _, test := range tests { - _engine, err := New( - WithBuild(test.build), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(test.build), + ) - if err != nil { - t.Errorf("WithBuild returned err: %v", err) - } + if err != nil { + t.Errorf("WithBuild returned err: %v", err) + } - if !reflect.DeepEqual(_engine.build, _build) { - t.Errorf("WithBuild is %v, want %v", _engine.build, _build) - } + if !reflect.DeepEqual(_engine.build, _build) { + t.Errorf("WithBuild is %v, want %v", _engine.build, _build) + } + }) } } func TestLocal_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { + name string hostname string want string }{ { + name: "dns hostname", hostname: "vela.worker.localhost", want: "vela.worker.localhost", }, { + name: "empty hostname is localhost", hostname: "", want: "localhost", }, @@ -69,16 +76,18 @@ func TestLocal_Opt_WithHostname(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithHostname(test.hostname), - ) - if err != nil { - t.Errorf("unable to create local engine: %v", err) - } - - if !reflect.DeepEqual(_engine.Hostname, test.want) { - t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithHostname(test.hostname), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Hostname, test.want) { + t.Errorf("WithHostname is %v, want %v", _engine.Hostname, test.want) + } + }) } } @@ -88,14 +97,17 @@ func TestLocal_Opt_WithPipeline(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build }{ { + name: "steps pipeline", failure: false, pipeline: _steps, }, { + name: "nil pipeline", failure: true, pipeline: nil, }, @@ -103,25 +115,27 @@ func TestLocal_Opt_WithPipeline(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithPipeline(test.pipeline), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithPipeline(test.pipeline), + ) - if test.failure { - if err == nil { - t.Errorf("WithPipeline should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithPipeline should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithPipeline returned err: %v", err) - } + if err != nil { + t.Errorf("WithPipeline returned err: %v", err) + } - if !reflect.DeepEqual(_engine.pipeline, _steps) { - t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) - } + if !reflect.DeepEqual(_engine.pipeline, _steps) { + t.Errorf("WithPipeline is %v, want %v", _engine.pipeline, _steps) + } + }) } } @@ -131,26 +145,30 @@ func TestLocal_Opt_WithRepo(t *testing.T) { // setup tests tests := []struct { + name string repo *library.Repo }{ { + name: "repo", repo: _repo, }, } // run tests for _, test := range tests { - _engine, err := New( - WithRepo(test.repo), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithRepo(test.repo), + ) - if err != nil { - t.Errorf("WithRepo returned err: %v", err) - } + if err != nil { + t.Errorf("WithRepo returned err: %v", err) + } - if !reflect.DeepEqual(_engine.repo, _repo) { - t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) - } + if !reflect.DeepEqual(_engine.repo, _repo) { + t.Errorf("WithRepo is %v, want %v", _engine.repo, _repo) + } + }) } } @@ -163,14 +181,17 @@ func TestLocal_Opt_WithRuntime(t *testing.T) { // setup tests tests := []struct { + name string failure bool runtime runtime.Engine }{ { + name: "docker runtime", failure: false, runtime: _runtime, }, { + name: "nil runtime", failure: true, runtime: nil, }, @@ -178,25 +199,27 @@ func TestLocal_Opt_WithRuntime(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithRuntime(test.runtime), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithRuntime(test.runtime), + ) - if test.failure { - if err == nil { - t.Errorf("WithRuntime should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("WithRuntime should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("WithRuntime returned err: %v", err) - } + if err != nil { + t.Errorf("WithRuntime returned err: %v", err) + } - if !reflect.DeepEqual(_engine.Runtime, _runtime) { - t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) - } + if !reflect.DeepEqual(_engine.Runtime, _runtime) { + t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) + } + }) } } @@ -206,26 +229,30 @@ func TestLocal_Opt_WithUser(t *testing.T) { // setup tests tests := []struct { + name string user *library.User }{ { + name: "user", user: _user, }, } // run tests for _, test := range tests { - _engine, err := New( - WithUser(test.user), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithUser(test.user), + ) - if err != nil { - t.Errorf("WithUser returned err: %v", err) - } + if err != nil { + t.Errorf("WithUser returned err: %v", err) + } - if !reflect.DeepEqual(_engine.user, _user) { - t.Errorf("WithUser is %v, want %v", _engine.user, _user) - } + if !reflect.DeepEqual(_engine.user, _user) { + t.Errorf("WithUser is %v, want %v", _engine.user, _user) + } + }) } } @@ -242,40 +269,47 @@ func TestLocal_Opt_WithVelaClient(t *testing.T) { // setup tests tests := []struct { + name string client *vela.Client }{ { + name: "vela client", client: _client, }, } // run tests for _, test := range tests { - _engine, err := New( - WithVelaClient(test.client), - ) + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithVelaClient(test.client), + ) - if err != nil { - t.Errorf("WithVelaClient returned err: %v", err) - } + if err != nil { + t.Errorf("WithVelaClient returned err: %v", err) + } - if !reflect.DeepEqual(_engine.Vela, _client) { - t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) - } + if !reflect.DeepEqual(_engine.Vela, _client) { + t.Errorf("WithVelaClient is %v, want %v", _engine.Vela, _client) + } + }) } } func TestLocal_Opt_WithVersion(t *testing.T) { // setup tests tests := []struct { + name string version string want string }{ { + name: "version", version: "v1.0.0", want: "v1.0.0", }, { + name: "empty version", version: "", want: "v0.0.0", }, @@ -283,15 +317,17 @@ func TestLocal_Opt_WithVersion(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithVersion(test.version), - ) - if err != nil { - t.Errorf("unable to create local engine: %v", err) - } - - if !reflect.DeepEqual(_engine.Version, test.want) { - t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) - } + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithVersion(test.version), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + if !reflect.DeepEqual(_engine.Version, test.want) { + t.Errorf("WithVersion is %v, want %v", _engine.Version, test.want) + } + }) } } diff --git a/executor/local/service_test.go b/executor/local/service_test.go index c6bd1ae9..cc619c4d 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -27,10 +27,12 @@ func TestLocal_CreateService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -44,7 +46,8 @@ func TestLocal_CreateService(t *testing.T) { Pull: "not_present", }, }, - { // service container with image not found + { + name: "service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -58,7 +61,8 @@ func TestLocal_CreateService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -66,30 +70,32 @@ func TestLocal_CreateService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("CreateService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.CreateService(context.Background(), test.container) - if err != nil { - t.Errorf("CreateService returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("CreateService should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("CreateService returned err: %v", err) + } + }) } } @@ -106,10 +112,12 @@ func TestLocal_PlanService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -123,7 +131,8 @@ func TestLocal_PlanService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -131,30 +140,32 @@ func TestLocal_PlanService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("PlanService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanService should have returned err") + } - if err != nil { - t.Errorf("PlanService returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("PlanService returned err: %v", err) + } + }) } } @@ -171,10 +182,12 @@ func TestLocal_ExecService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -188,7 +201,8 @@ func TestLocal_ExecService(t *testing.T) { Pull: "not_present", }, }, - { // service container with image not found + { + name: "service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -202,7 +216,8 @@ func TestLocal_ExecService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -210,34 +225,36 @@ func TestLocal_ExecService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) - } - - err = _engine.ExecService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("ExecService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + if !test.container.Empty() { + _engine.services.Store(test.container.ID, new(library.Service)) + } + + err = _engine.ExecService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecService should have returned err") + } - if err != nil { - t.Errorf("ExecService returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("ExecService returned err: %v", err) + } + }) } } @@ -254,10 +271,12 @@ func TestLocal_StreamService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -271,7 +290,8 @@ func TestLocal_StreamService(t *testing.T) { Pull: "not_present", }, }, - { // empty service container + { + name: "empty service container", failure: true, container: new(pipeline.Container), }, @@ -279,30 +299,32 @@ func TestLocal_StreamService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.StreamService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("StreamService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.StreamService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamService should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("StreamService returned err: %v", err) - } + if err != nil { + t.Errorf("StreamService returned err: %v", err) + } + }) } } @@ -319,10 +341,12 @@ func TestLocal_DestroyService(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic service container + { + name: "basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -340,29 +364,31 @@ func TestLocal_DestroyService(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyService(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("DestroyService should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyService(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyService should have returned err") + } - if err != nil { - t.Errorf("DestroyService returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyService returned err: %v", err) + } + }) } } diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index 3272182e..c5f9559b 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -46,10 +46,12 @@ func TestLocal_CreateStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -66,7 +68,8 @@ func TestLocal_CreateStage(t *testing.T) { }, }, }, - { // stage with step container with image not found + { + name: "stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -87,36 +90,38 @@ func TestLocal_CreateStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(_pipeline), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - // run create to init steps to be created properly - err = _engine.CreateBuild(context.Background()) - if err != nil { - t.Errorf("unable to create build: %v", err) - } - - err = _engine.CreateStage(context.Background(), test.stage) - - if test.failure { - if err == nil { - t.Errorf("CreateStage should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + // run create to init steps to be created properly + err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + err = _engine.CreateStage(context.Background(), test.stage) + + if test.failure { + if err == nil { + t.Errorf("CreateStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("CreateStage returned err: %v", err) - } + if err != nil { + t.Errorf("CreateStage returned err: %v", err) + } + }) } } @@ -147,11 +152,13 @@ func TestLocal_PlanStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage stageMap *sync.Map }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -169,7 +176,8 @@ func TestLocal_PlanStage(t *testing.T) { }, stageMap: new(sync.Map), }, - { // basic stage with nil stage map + { + name: "basic stage with nil stage map", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -188,7 +196,8 @@ func TestLocal_PlanStage(t *testing.T) { }, stageMap: testMap, }, - { // basic stage with error stage map + { + name: "basic stage with error stage map", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -211,30 +220,32 @@ func TestLocal_PlanStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) - - if test.failure { - if err == nil { - t.Errorf("PlanStage should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) + + if test.failure { + if err == nil { + t.Errorf("PlanStage should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("PlanStage returned err: %v", err) - } + if err != nil { + t.Errorf("PlanStage returned err: %v", err) + } + }) } } @@ -251,10 +262,12 @@ func TestLocal_ExecStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -271,7 +284,8 @@ func TestLocal_ExecStage(t *testing.T) { }, }, }, - { // stage with step container with image not found + { + name: "stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -292,33 +306,35 @@ func TestLocal_ExecStage(t *testing.T) { // run tests for _, test := range tests { - stageMap := new(sync.Map) - stageMap.Store("echo", make(chan error)) - - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.ExecStage(context.Background(), test.stage, stageMap) - - if test.failure { - if err == nil { - t.Errorf("ExecStage should have returned err") + t.Run(test.name, func(t *testing.T) { + stageMap := new(sync.Map) + stageMap.Store("echo", make(chan error)) + + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.ExecStage(context.Background(), test.stage, stageMap) + + if test.failure { + if err == nil { + t.Errorf("ExecStage should have returned err") + } - if err != nil { - t.Errorf("ExecStage returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("ExecStage returned err: %v", err) + } + }) } } @@ -335,10 +351,12 @@ func TestLocal_DestroyStage(t *testing.T) { // setup tests tests := []struct { + name string failure bool stage *pipeline.Stage }{ - { // basic stage + { + name: "basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -359,29 +377,31 @@ func TestLocal_DestroyStage(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyStage(context.Background(), test.stage) - - if test.failure { - if err == nil { - t.Errorf("DestroyStage should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyStage(context.Background(), test.stage) - if err != nil { - t.Errorf("DestroyStage returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("DestroyStage should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyStage returned err: %v", err) + } + }) } } diff --git a/executor/local/step_test.go b/executor/local/step_test.go index c6dad3b4..5a549368 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -27,10 +27,12 @@ func TestLocal_CreateStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -42,7 +44,8 @@ func TestLocal_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -54,7 +57,8 @@ func TestLocal_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with image not found + { + name: "step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -66,7 +70,8 @@ func TestLocal_CreateStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -74,30 +79,32 @@ func TestLocal_CreateStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.CreateStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("CreateStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.CreateStep(context.Background(), test.container) - if err != nil { - t.Errorf("CreateStep returned err: %v", err) - } + if test.failure { + if err == nil { + t.Errorf("CreateStep should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("CreateStep returned err: %v", err) + } + }) } } @@ -114,10 +121,12 @@ func TestLocal_PlanStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -129,7 +138,8 @@ func TestLocal_PlanStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -137,30 +147,32 @@ func TestLocal_PlanStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.PlanStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("PlanStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.PlanStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("PlanStep should have returned err") + } - if err != nil { - t.Errorf("PlanStep returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("PlanStep returned err: %v", err) + } + }) } } @@ -177,10 +189,12 @@ func TestLocal_ExecStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -192,7 +206,8 @@ func TestLocal_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -204,7 +219,8 @@ func TestLocal_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // detached step container + { + name: "detached step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -217,7 +233,8 @@ func TestLocal_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // step container with image not found + { + name: "step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -229,7 +246,8 @@ func TestLocal_ExecStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -237,34 +255,36 @@ func TestLocal_ExecStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) - } - - err = _engine.ExecStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("ExecStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + if !test.container.Empty() { + _engine.steps.Store(test.container.ID, new(library.Step)) + } + + err = _engine.ExecStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("ExecStep should have returned err") + } - if err != nil { - t.Errorf("ExecStep returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("ExecStep returned err: %v", err) + } + }) } } @@ -281,10 +301,12 @@ func TestLocal_StreamStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -296,7 +318,8 @@ func TestLocal_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -308,7 +331,8 @@ func TestLocal_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // basic stage container + { + name: "basic stage container", failure: false, container: &pipeline.Container{ ID: "github_octocat_1_echo_echo", @@ -320,7 +344,8 @@ func TestLocal_StreamStep(t *testing.T) { Pull: "not_present", }, }, - { // empty step container + { + name: "empty step container", failure: true, container: new(pipeline.Container), }, @@ -328,30 +353,32 @@ func TestLocal_StreamStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.StreamStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("StreamStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.StreamStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("StreamStep should have returned err") + } + + return // continue to next test + } - if err != nil { - t.Errorf("StreamStep returned err: %v", err) - } + if err != nil { + t.Errorf("StreamStep returned err: %v", err) + } + }) } } @@ -368,10 +395,12 @@ func TestLocal_DestroyStep(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container }{ - { // init step container + { + name: "init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -383,7 +412,8 @@ func TestLocal_DestroyStep(t *testing.T) { Pull: "not_present", }, }, - { // basic step container + { + name: "basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -399,29 +429,31 @@ func TestLocal_DestroyStep(t *testing.T) { // run tests for _, test := range tests { - _engine, err := New( - WithBuild(_build), - WithPipeline(new(pipeline.Build)), - WithRepo(_repo), - WithRuntime(_runtime), - WithUser(_user), - ) - if err != nil { - t.Errorf("unable to create executor engine: %v", err) - } - - err = _engine.DestroyStep(context.Background(), test.container) - - if test.failure { - if err == nil { - t.Errorf("DestroyStep should have returned err") + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithBuild(_build), + WithPipeline(new(pipeline.Build)), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) } - continue - } + err = _engine.DestroyStep(context.Background(), test.container) + + if test.failure { + if err == nil { + t.Errorf("DestroyStep should have returned err") + } - if err != nil { - t.Errorf("DestroyStep returned err: %v", err) - } + return // continue to next test + } + + if err != nil { + t.Errorf("DestroyStep returned err: %v", err) + } + }) } } diff --git a/executor/setup_test.go b/executor/setup_test.go index 32494180..2c44193c 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -223,10 +223,12 @@ func TestExecutor_Setup_Validate(t *testing.T) { // setup tests tests := []struct { + name string setup *Setup failure bool }{ { + name: "complete", setup: &Setup{ Build: _build, Client: _client, @@ -241,6 +243,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: false, }, { + name: "nil build", setup: &Setup{ Build: nil, Client: _client, @@ -255,6 +258,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "nil client", setup: &Setup{ Build: _build, Client: nil, @@ -269,6 +273,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "empty driver", setup: &Setup{ Build: _build, Client: _client, @@ -283,6 +288,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "nil pipeline", setup: &Setup{ Build: _build, Client: _client, @@ -297,6 +303,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "nil repo", setup: &Setup{ Build: _build, Client: _client, @@ -311,6 +318,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "nil runtime", setup: &Setup{ Build: _build, Client: _client, @@ -325,6 +333,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "nil user", setup: &Setup{ Build: _build, Client: _client, @@ -339,6 +348,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "empty log-method", setup: &Setup{ Build: _build, Client: _client, @@ -353,6 +363,7 @@ func TestExecutor_Setup_Validate(t *testing.T) { failure: true, }, { + name: "invalid log-method", setup: &Setup{ Build: _build, Client: _client, @@ -370,18 +381,20 @@ func TestExecutor_Setup_Validate(t *testing.T) { // run tests for _, test := range tests { - err = test.setup.Validate() + t.Run(test.name, func(t *testing.T) { + err = test.setup.Validate() - if test.failure { - if err == nil { - t.Errorf("Validate should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Validate should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Validate returned err: %v", err) - } + if err != nil { + t.Errorf("Validate returned err: %v", err) + } + }) } } From 853dfc096ad5744a0e0712bda3fcdf95ca5b13cb Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 22 Apr 2022 11:58:59 -0500 Subject: [PATCH 275/430] tests: Convert internal/ tests to subtests (#316) --- internal/build/snapshot_test.go | 8 ++- internal/build/upload_test.go | 11 +++- internal/image/image_test.go | 60 +++++++++++------ internal/service/environment_test.go | 25 ++++--- internal/service/load_test.go | 66 +++++++++++-------- internal/service/snapshot_test.go | 7 +- internal/service/upload_test.go | 10 ++- internal/step/environment_test.go | 25 ++++--- internal/step/load_test.go | 98 +++++++++++++++++----------- internal/step/skip_test.go | 16 +++-- internal/step/snapshot_test.go | 14 +++- internal/step/upload_test.go | 10 ++- internal/volume/volume_test.go | 56 ++++++++++------ 13 files changed, 271 insertions(+), 135 deletions(-) diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go index 23c3ddfa..6cb8726e 100644 --- a/internal/build/snapshot_test.go +++ b/internal/build/snapshot_test.go @@ -73,24 +73,28 @@ func TestBuild_Snapshot(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client err error repo *library.Repo }{ { + name: "build with error", build: b, client: _client, err: errors.New("unable to create network"), repo: r, }, { + name: "nil build with error", build: nil, client: _client, err: errors.New("unable to create network"), repo: r, }, { + name: "nil everything", build: nil, client: nil, err: nil, @@ -100,6 +104,8 @@ func TestBuild_Snapshot(t *testing.T) { // run test for _, test := range tests { - Snapshot(test.build, test.client, test.err, nil, test.repo) + t.Run(test.name, func(t *testing.T) { + Snapshot(test.build, test.client, test.err, nil, test.repo) + }) } } diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go index 45f93479..7afa7c5d 100644 --- a/internal/build/upload_test.go +++ b/internal/build/upload_test.go @@ -82,42 +82,49 @@ func TestBuild_Upload(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client err error repo *library.Repo }{ { + name: "build with error", build: _build, client: _client, err: errors.New("unable to create network"), repo: _repo, }, { + name: "canceled build with error", build: &_canceled, client: _client, err: errors.New("unable to create network"), repo: _repo, }, { + name: "errored build with error", build: &_error, client: _client, err: errors.New("unable to create network"), repo: _repo, }, { + name: "pending build with error", build: &_pending, client: _client, err: errors.New("unable to create network"), repo: _repo, }, { + name: "nil build with error", build: nil, client: _client, err: errors.New("unable to create network"), repo: _repo, }, { + name: "everything nil", build: nil, client: nil, err: nil, @@ -127,6 +134,8 @@ func TestBuild_Upload(t *testing.T) { // run test for _, test := range tests { - Upload(test.build, test.client, test.err, nil, test.repo) + t.Run(test.name, func(t *testing.T) { + Upload(test.build, test.client, test.err, nil, test.repo) + }) } } diff --git a/internal/image/image_test.go b/internal/image/image_test.go index c8a40298..ba06215b 100644 --- a/internal/image/image_test.go +++ b/internal/image/image_test.go @@ -12,50 +12,62 @@ import ( func TestImage_Parse(t *testing.T) { // setup tests tests := []struct { + name string image string want string }{ { + name: "image only", image: "golang", want: "docker.io/library/golang:latest", }, { + name: "image and tag", image: "golang:latest", want: "docker.io/library/golang:latest", }, { + name: "repo and image", image: "library/golang", want: "docker.io/library/golang:latest", }, { + name: "repo image and tag", image: "library/golang:1.14", want: "docker.io/library/golang:1.14", }, { + name: "hub repo and image", image: "docker.io/library/golang", want: "docker.io/library/golang:latest", }, { + name: "hub repo image and tag", image: "docker.io/library/golang:latest", want: "docker.io/library/golang:latest", }, { + name: "alt hub with repo and image", image: "index.docker.io/library/golang", want: "docker.io/library/golang:latest", }, { + name: "alt hub with repo image and tag", image: "index.docker.io/library/golang:latest", want: "docker.io/library/golang:latest", }, { + name: "gcr hub with repo and image", image: "gcr.io/library/golang", want: "gcr.io/library/golang:latest", }, { + name: "gcr hub with repo image and tag", image: "gcr.io/library/golang:latest", want: "gcr.io/library/golang:latest", }, { + name: "garbage in garbage out", image: "!@#$%^&*()", want: "!@#$%^&*()", }, @@ -63,42 +75,50 @@ func TestImage_Parse(t *testing.T) { // run tests for _, test := range tests { - got := Parse(test.image) + t.Run(test.name, func(t *testing.T) { + got := Parse(test.image) - if !strings.EqualFold(got, test.want) { - t.Errorf("Parse is %s want %s", got, test.want) - } + if !strings.EqualFold(got, test.want) { + t.Errorf("Parse is %s want %s", got, test.want) + } + }) } } func TestImage_ParseWithError(t *testing.T) { // setup tests tests := []struct { + name string failure bool image string want string }{ { + name: "image only", failure: false, image: "golang", want: "docker.io/library/golang:latest", }, { + name: "image and tag", failure: false, image: "golang:latest", want: "docker.io/library/golang:latest", }, { + name: "image and tag", failure: false, image: "golang:1.14", want: "docker.io/library/golang:1.14", }, { + name: "fails with bad image", failure: true, image: "!@#$%^&*()", want: "!@#$%^&*()", }, { + name: "fails with image sha", failure: true, image: "1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a", want: "sha256:1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a", @@ -107,27 +127,29 @@ func TestImage_ParseWithError(t *testing.T) { // run tests for _, test := range tests { - got, err := ParseWithError(test.image) + t.Run(test.name, func(t *testing.T) { + got, err := ParseWithError(test.image) + + if test.failure { + if err == nil { + t.Errorf("ParseWithError should have returned err") + } - if test.failure { - if err == nil { - t.Errorf("ParseWithError should have returned err") + if !strings.EqualFold(got, test.want) { + t.Errorf("ParseWithError is %s want %s", got, test.want) + } + + return // continue to next test + } + + if err != nil { + t.Errorf("ParseWithError returned err: %v", err) } if !strings.EqualFold(got, test.want) { t.Errorf("ParseWithError is %s want %s", got, test.want) } - - continue - } - - if err != nil { - t.Errorf("ParseWithError returned err: %v", err) - } - - if !strings.EqualFold(got, test.want) { - t.Errorf("ParseWithError is %s want %s", got, test.want) - } + }) } } diff --git a/internal/service/environment_test.go b/internal/service/environment_test.go index e5de3b62..42c87134 100644 --- a/internal/service/environment_test.go +++ b/internal/service/environment_test.go @@ -93,6 +93,7 @@ func TestService_Environment(t *testing.T) { // setup tests tests := []struct { + name string failure bool build *library.Build container *pipeline.Container @@ -100,6 +101,7 @@ func TestService_Environment(t *testing.T) { service *library.Service }{ { + name: "success", failure: false, build: b, container: c, @@ -107,6 +109,7 @@ func TestService_Environment(t *testing.T) { service: s, }, { + name: "nil failure", failure: true, build: nil, container: nil, @@ -117,18 +120,20 @@ func TestService_Environment(t *testing.T) { // run tests for _, test := range tests { - err := Environment(test.container, test.build, test.repo, test.service, "v0.0.0") + t.Run(test.name, func(t *testing.T) { + err := Environment(test.container, test.build, test.repo, test.service, "v0.0.0") - if test.failure { - if err == nil { - t.Errorf("Environment should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Environment should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Environment returned err: %v", err) - } + if err != nil { + t.Errorf("Environment returned err: %v", err) + } + }) } } diff --git a/internal/service/load_test.go b/internal/service/load_test.go index ad0f5be8..881bc148 100644 --- a/internal/service/load_test.go +++ b/internal/service/load_test.go @@ -34,30 +34,35 @@ func TestService_Load(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container _map *sync.Map want *library.Service }{ { + name: "good map", failure: false, container: c, want: new(library.Service), _map: goodMap, }, { + name: "bad map", failure: true, container: c, want: nil, _map: badMap, }, { + name: "empty map", failure: true, container: new(pipeline.Container), want: nil, _map: new(sync.Map), }, { + name: "nil map", failure: true, container: nil, want: nil, @@ -67,23 +72,25 @@ func TestService_Load(t *testing.T) { // run tests for _, test := range tests { - got, err := Load(test.container, test._map) + t.Run(test.name, func(t *testing.T) { + got, err := Load(test.container, test._map) - if test.failure { - if err == nil { - t.Errorf("Load should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Load should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Load returned err: %v", err) - } + if err != nil { + t.Errorf("Load returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("Load is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Load is %v, want %v", got, test.want) + } + }) } } @@ -108,30 +115,35 @@ func TestStep_LoadLogs(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container _map *sync.Map want *library.Log }{ { + name: "good map", failure: false, container: c, want: new(library.Log), _map: goodMap, }, { + name: "bad map", failure: true, container: c, want: nil, _map: badMap, }, { + name: "empty map", failure: true, container: new(pipeline.Container), want: nil, _map: new(sync.Map), }, { + name: "nil map", failure: true, container: nil, want: nil, @@ -141,22 +153,24 @@ func TestStep_LoadLogs(t *testing.T) { // run tests for _, test := range tests { - got, err := LoadLogs(test.container, test._map) + t.Run(test.name, func(t *testing.T) { + got, err := LoadLogs(test.container, test._map) - if test.failure { - if err == nil { - t.Errorf("LoadLogs should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("LoadLogs should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("LoadLogs returned err: %v", err) - } + if err != nil { + t.Errorf("LoadLogs returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("LoadLogs is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadLogs is %v, want %v", got, test.want) + } + }) } } diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index 11857c2c..7e48cef4 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -113,6 +113,7 @@ func TestService_Snapshot(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client container *pipeline.Container @@ -120,6 +121,7 @@ func TestService_Snapshot(t *testing.T) { service *library.Service }{ { + name: "running service", build: _build, client: _client, container: _container, @@ -127,6 +129,7 @@ func TestService_Snapshot(t *testing.T) { service: _service, }, { + name: "exited service", build: _build, client: _client, container: _exitCode, @@ -137,6 +140,8 @@ func TestService_Snapshot(t *testing.T) { // run test for _, test := range tests { - Snapshot(test.container, test.build, test.client, nil, test.repo, test.service) + t.Run(test.name, func(t *testing.T) { + Snapshot(test.container, test.build, test.client, nil, test.repo, test.service) + }) } } diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index 119d2a54..08b758b1 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -120,6 +120,7 @@ func TestService_Upload(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client container *pipeline.Container @@ -127,6 +128,7 @@ func TestService_Upload(t *testing.T) { service *library.Service }{ { + name: "running service", build: _build, client: _client, container: _container, @@ -134,6 +136,7 @@ func TestService_Upload(t *testing.T) { service: _service, }, { + name: "canceled service", build: _build, client: _client, container: _container, @@ -141,6 +144,7 @@ func TestService_Upload(t *testing.T) { service: &_canceled, }, { + name: "errored service", build: _build, client: _client, container: _container, @@ -148,6 +152,7 @@ func TestService_Upload(t *testing.T) { service: &_error, }, { + name: "pending service", build: _build, client: _client, container: _container, @@ -155,6 +160,7 @@ func TestService_Upload(t *testing.T) { service: &_pending, }, { + name: "exited service", build: _build, client: _client, container: _exitCode, @@ -165,6 +171,8 @@ func TestService_Upload(t *testing.T) { // run test for _, test := range tests { - Upload(test.container, test.build, test.client, nil, test.repo, test.service) + t.Run(test.name, func(t *testing.T) { + Upload(test.container, test.build, test.client, nil, test.repo, test.service) + }) } } diff --git a/internal/step/environment_test.go b/internal/step/environment_test.go index 9db02ae7..ca35e38a 100644 --- a/internal/step/environment_test.go +++ b/internal/step/environment_test.go @@ -92,6 +92,7 @@ func TestStep_Environment(t *testing.T) { // setup tests tests := []struct { + name string failure bool build *library.Build container *pipeline.Container @@ -99,6 +100,7 @@ func TestStep_Environment(t *testing.T) { step *library.Step }{ { + name: "success", failure: false, build: b, container: c, @@ -106,6 +108,7 @@ func TestStep_Environment(t *testing.T) { step: s, }, { + name: "nil failure", failure: true, build: nil, container: nil, @@ -116,18 +119,20 @@ func TestStep_Environment(t *testing.T) { // run tests for _, test := range tests { - err := Environment(test.container, test.build, test.repo, test.step, "v0.0.0") + t.Run(test.name, func(t *testing.T) { + err := Environment(test.container, test.build, test.repo, test.step, "v0.0.0") - if test.failure { - if err == nil { - t.Errorf("Environment should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Environment should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Environment returned err: %v", err) - } + if err != nil { + t.Errorf("Environment returned err: %v", err) + } + }) } } diff --git a/internal/step/load_test.go b/internal/step/load_test.go index 09f41c82..6ab3e026 100644 --- a/internal/step/load_test.go +++ b/internal/step/load_test.go @@ -33,30 +33,35 @@ func TestStep_Load(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container _map *sync.Map want *library.Step }{ { + name: "good map", failure: false, container: c, want: new(library.Step), _map: goodMap, }, { + name: "bad map", failure: true, container: c, want: nil, _map: badMap, }, { + name: "empty map", failure: true, container: new(pipeline.Container), want: nil, _map: new(sync.Map), }, { + name: "nil map", failure: true, container: nil, want: nil, @@ -66,34 +71,38 @@ func TestStep_Load(t *testing.T) { // run tests for _, test := range tests { - got, err := Load(test.container, test._map) + t.Run(test.name, func(t *testing.T) { + got, err := Load(test.container, test._map) - if test.failure { - if err == nil { - t.Errorf("Load should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("Load should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("Load returned err: %v", err) - } + if err != nil { + t.Errorf("Load returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("Load is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Load is %v, want %v", got, test.want) + } + }) } } func TestStep_LoadInit(t *testing.T) { // setup tests tests := []struct { + name string failure bool pipeline *pipeline.Build want *pipeline.Container }{ { + name: "stages", failure: false, pipeline: &pipeline.Build{ Version: "1", @@ -126,6 +135,7 @@ func TestStep_LoadInit(t *testing.T) { }, }, { + name: "steps", failure: false, pipeline: &pipeline.Build{ Version: "1", @@ -153,6 +163,7 @@ func TestStep_LoadInit(t *testing.T) { }, }, { + name: "nil failure", failure: true, pipeline: nil, want: nil, @@ -161,23 +172,25 @@ func TestStep_LoadInit(t *testing.T) { // run tests for _, test := range tests { - got, err := LoadInit(test.pipeline) + t.Run(test.name, func(t *testing.T) { + got, err := LoadInit(test.pipeline) - if test.failure { - if err == nil { - t.Errorf("LoadInit should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("LoadInit should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("LoadInit returned err: %v", err) - } + if err != nil { + t.Errorf("LoadInit returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("LoadInit is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadInit is %v, want %v", got, test.want) + } + }) } } @@ -201,30 +214,35 @@ func TestStep_LoadLogs(t *testing.T) { // setup tests tests := []struct { + name string failure bool container *pipeline.Container _map *sync.Map want *library.Log }{ { + name: "good map", failure: false, container: c, want: new(library.Log), _map: goodMap, }, { + name: "bad map", failure: true, container: c, want: nil, _map: badMap, }, { + name: "empty map", failure: true, container: new(pipeline.Container), want: nil, _map: new(sync.Map), }, { + name: "nil map", failure: true, container: nil, want: nil, @@ -234,22 +252,24 @@ func TestStep_LoadLogs(t *testing.T) { // run tests for _, test := range tests { - got, err := LoadLogs(test.container, test._map) + t.Run(test.name, func(t *testing.T) { + got, err := LoadLogs(test.container, test._map) - if test.failure { - if err == nil { - t.Errorf("LoadLogs should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("LoadLogs should have returned err") + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("LoadLogs returned err: %v", err) - } + if err != nil { + t.Errorf("LoadLogs returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("LoadLogs is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("LoadLogs is %v, want %v", got, test.want) + } + }) } } diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index 0e2449cb..619a9e61 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -152,36 +152,42 @@ func TestStep_Skip(t *testing.T) { } tests := []struct { + name string build *library.Build container *pipeline.Container repo *library.Repo want bool }{ { + name: "build", build: _build, container: _container, repo: _repo, want: false, }, { + name: "comment", build: _comment, container: _container, repo: _repo, want: false, }, { + name: "deploy", build: _deploy, container: _container, repo: _repo, want: false, }, { + name: "tag", build: _tag, container: _container, repo: _repo, want: false, }, { + name: "skip nil", build: nil, container: nil, repo: nil, @@ -191,10 +197,12 @@ func TestStep_Skip(t *testing.T) { // run test for _, test := range tests { - got := Skip(test.container, test.build, test.repo) + t.Run(test.name, func(t *testing.T) { + got := Skip(test.container, test.build, test.repo) - if got != test.want { - t.Errorf("Skip is %v, want %v", got, test.want) - } + if got != test.want { + t.Errorf("Skip is %v, want %v", got, test.want) + } + }) } } diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index 5fc4cf83..af9a49f3 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -111,6 +111,7 @@ func TestStep_Snapshot(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client container *pipeline.Container @@ -118,6 +119,7 @@ func TestStep_Snapshot(t *testing.T) { step *library.Step }{ { + name: "running step", build: _build, client: _client, container: _container, @@ -125,6 +127,7 @@ func TestStep_Snapshot(t *testing.T) { step: _step, }, { + name: "exited step", build: _build, client: _client, container: _exitCode, @@ -135,7 +138,9 @@ func TestStep_Snapshot(t *testing.T) { // run test for _, test := range tests { - Snapshot(test.container, test.build, test.client, nil, test.repo, test.step) + t.Run(test.name, func(t *testing.T) { + Snapshot(test.container, test.build, test.client, nil, test.repo, test.step) + }) } } @@ -235,6 +240,7 @@ func TestStep_SnapshotInit(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client container *pipeline.Container @@ -243,6 +249,7 @@ func TestStep_SnapshotInit(t *testing.T) { step *library.Step }{ { + name: "running step", build: _build, client: _client, container: _container, @@ -251,6 +258,7 @@ func TestStep_SnapshotInit(t *testing.T) { step: _step, }, { + name: "exited step", build: _build, client: _client, container: _exitCode, @@ -262,6 +270,8 @@ func TestStep_SnapshotInit(t *testing.T) { // run test for _, test := range tests { - SnapshotInit(test.container, test.build, test.client, nil, test.repo, test.step, test.log) + t.Run(test.name, func(t *testing.T) { + SnapshotInit(test.container, test.build, test.client, nil, test.repo, test.step, test.log) + }) } } diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index 10bf7dac..7fe607bb 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -120,6 +120,7 @@ func TestStep_Upload(t *testing.T) { } tests := []struct { + name string build *library.Build client *vela.Client container *pipeline.Container @@ -127,6 +128,7 @@ func TestStep_Upload(t *testing.T) { step *library.Step }{ { + name: "running step", build: _build, client: _client, container: _container, @@ -134,6 +136,7 @@ func TestStep_Upload(t *testing.T) { step: _step, }, { + name: "canceled step", build: _build, client: _client, container: _container, @@ -141,6 +144,7 @@ func TestStep_Upload(t *testing.T) { step: &_canceled, }, { + name: "errored step", build: _build, client: _client, container: _container, @@ -148,6 +152,7 @@ func TestStep_Upload(t *testing.T) { step: &_error, }, { + name: "pending step", build: _build, client: _client, container: _container, @@ -155,6 +160,7 @@ func TestStep_Upload(t *testing.T) { step: &_pending, }, { + name: "exited step", build: _build, client: _client, container: _exitCode, @@ -165,6 +171,8 @@ func TestStep_Upload(t *testing.T) { // run test for _, test := range tests { - Upload(test.container, test.build, test.client, nil, test.repo, test.step) + t.Run(test.name, func(t *testing.T) { + Upload(test.container, test.build, test.client, nil, test.repo, test.step) + }) } } diff --git a/internal/volume/volume_test.go b/internal/volume/volume_test.go index f7f458c4..3946be19 100644 --- a/internal/volume/volume_test.go +++ b/internal/volume/volume_test.go @@ -12,10 +12,12 @@ import ( func TestVolume_Parse(t *testing.T) { // setup tests tests := []struct { + name string volume string want *Volume }{ { + name: "same src and dest", volume: "/foo", want: &Volume{ Source: "/foo", @@ -24,6 +26,7 @@ func TestVolume_Parse(t *testing.T) { }, }, { + name: "different src and dest", volume: "/foo:/bar", want: &Volume{ Source: "/foo", @@ -32,6 +35,7 @@ func TestVolume_Parse(t *testing.T) { }, }, { + name: "read-only different src and dest", volume: "/foo:/bar:ro", want: &Volume{ Source: "/foo", @@ -40,6 +44,7 @@ func TestVolume_Parse(t *testing.T) { }, }, { + name: "read-write different src and dest", volume: "/foo:/bar:rw", want: &Volume{ Source: "/foo", @@ -48,6 +53,7 @@ func TestVolume_Parse(t *testing.T) { }, }, { + name: "invalid", volume: "/foo:/bar:/foo:bar", want: nil, }, @@ -55,22 +61,26 @@ func TestVolume_Parse(t *testing.T) { // run tests for _, test := range tests { - got := Parse(test.volume) + t.Run(test.name, func(t *testing.T) { + got := Parse(test.volume) - if !reflect.DeepEqual(got, test.want) { - t.Errorf("Parse is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("Parse is %v, want %v", got, test.want) + } + }) } } func TestImage_ParseWithError(t *testing.T) { // setup tests tests := []struct { + name string failure bool volume string want *Volume }{ { + name: "same src and dest", failure: false, volume: "/foo", want: &Volume{ @@ -80,6 +90,7 @@ func TestImage_ParseWithError(t *testing.T) { }, }, { + name: "different src and dest", failure: false, volume: "/foo:/bar", want: &Volume{ @@ -89,6 +100,7 @@ func TestImage_ParseWithError(t *testing.T) { }, }, { + name: "read-only different src and dest", failure: false, volume: "/foo:/bar:ro", want: &Volume{ @@ -98,6 +110,7 @@ func TestImage_ParseWithError(t *testing.T) { }, }, { + name: "read-write different src and dest", failure: false, volume: "/foo:/bar:rw", want: &Volume{ @@ -107,6 +120,7 @@ func TestImage_ParseWithError(t *testing.T) { }, }, { + name: "invalid", failure: true, volume: "/foo:/bar:/foo:bar", want: nil, @@ -115,26 +129,28 @@ func TestImage_ParseWithError(t *testing.T) { // run tests for _, test := range tests { - got, err := ParseWithError(test.volume) + t.Run(test.name, func(t *testing.T) { + got, err := ParseWithError(test.volume) - if test.failure { - if err == nil { - t.Errorf("ParseWithError should have returned err") - } + if test.failure { + if err == nil { + t.Errorf("ParseWithError should have returned err") + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("ParseWithError is %s want %s", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("ParseWithError is %s want %s", got, test.want) + } - continue - } + return // continue to next test + } - if err != nil { - t.Errorf("ParseWithError returned err: %v", err) - } + if err != nil { + t.Errorf("ParseWithError returned err: %v", err) + } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("ParseWithError is %v, want %v", got, test.want) - } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("ParseWithError is %v, want %v", got, test.want) + } + }) } } From 66838c70e5d0b9b4f8526b45877e886aa85a07d2 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 22 Apr 2022 14:52:28 -0500 Subject: [PATCH 276/430] fix(ci): Fix silent failures in GHA reviewdog workflow (#319) --- .github/workflows/reviewdog.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 1e0515d0..7a53e50c 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -5,12 +5,14 @@ name: reviewdog on: pull_request: +# NOTE: We have to specify `go_version: 1.17` because the action was installing 1.18. +# 1.18, in turn, is not fully supported by golangci-lint yet, and it can fail silently: +# see: https://github.com/reviewdog/action-golangci-lint/issues/249 + # pipeline to execute jobs: diff-review: runs-on: ubuntu-latest - container: - image: golang:1.17 steps: - name: clone uses: actions/checkout@v3 @@ -19,15 +21,14 @@ jobs: uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} - golangci_lint_flags: "--config=.golangci.yml" + go_version: 1.17.9 + golangci_lint_flags: "--config=.golangci.yml --verbose" fail_on_error: true filter_mode: diff_context reporter: github-pr-review full-review: runs-on: ubuntu-latest - container: - image: golang:1.17 steps: - name: clone uses: actions/checkout@v3 @@ -36,6 +37,7 @@ jobs: uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} - golangci_lint_flags: "--config=.golangci.yml" + go_version: 1.17.9 + golangci_lint_flags: "--config=.golangci.yml --verbose" fail_on_error: false filter_mode: nofilter From f15a6a1fb99cf0e19be0540a5c246b3abc81f77e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Apr 2022 15:51:21 -0500 Subject: [PATCH 277/430] fix(deps): update deps (patch) (#310) Co-authored-by: Renovate Bot --- go.mod | 10 +++++----- go.sum | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index c0b9378f..ec8b9a0f 100644 --- a/go.mod +++ b/go.mod @@ -9,19 +9,19 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.13.0 - github.com/go-vela/server v0.13.0 + github.com/go-vela/server v0.13.1 github.com/go-vela/types v0.13.0 github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.4.0 + github.com/urfave/cli/v2 v2.4.4 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.1.0 - k8s.io/api v0.23.5 - k8s.io/apimachinery v0.23.5 - k8s.io/client-go v0.23.5 + k8s.io/api v0.23.6 + k8s.io/apimachinery v0.23.6 + k8s.io/client-go v0.23.6 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index b4927198..9fcf1280 100644 --- a/go.sum +++ b/go.sum @@ -51,6 +51,7 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -201,8 +202,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.13.0 h1:aHC6RWXr664GtmlLHs2IW59gmSNk3jcLXuxfZwM51ks= github.com/go-vela/sdk-go v0.13.0/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= -github.com/go-vela/server v0.13.0 h1:wcPH5fcu4QP7srVkJXXrftyHpVCCD4q6KnkLmmxVWfs= github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= +github.com/go-vela/server v0.13.1 h1:5Ht9uqRtIzhf8kusM1Y5WzIwFIY1BW1aBFx+lWUPXmQ= +github.com/go-vela/server v0.13.1/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= github.com/go-vela/types v0.13.0 h1:PX/0wtKMXbtqHbrWgwlCDzuBzeh+4V042k56siDSm1o= github.com/go-vela/types v0.13.0/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -588,8 +590,9 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I= github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= +github.com/urfave/cli/v2 v2.4.4 h1:IvwT3XfI6RytTmIzC35UAu9oyK+bHgUPXDDZNqribkI= +github.com/urfave/cli/v2 v2.4.4/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= 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= @@ -1059,13 +1062,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= -k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= +k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= +k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= -k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= -k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= +k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= +k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= +k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From ad581e5006d365322b1190d3ba8b4244f71c46cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Apr 2022 23:31:00 +0000 Subject: [PATCH 278/430] fix(deps): update module gotest.tools/v3 to v3.2.0 (#321) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ec8b9a0f..8d01a079 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.4.4 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - gotest.tools/v3 v3.1.0 + gotest.tools/v3 v3.2.0 k8s.io/api v0.23.6 k8s.io/apimachinery v0.23.6 k8s.io/client-go v0.23.6 diff --git a/go.sum b/go.sum index 9fcf1280..6a394c7c 100644 --- a/go.sum +++ b/go.sum @@ -1053,8 +1053,8 @@ gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVcl gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= +gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 52a74ffc53cddba16731ab7ca8100ff31f96b3f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 22:33:20 +0000 Subject: [PATCH 279/430] fix(deps): update module github.com/urfave/cli/v2 to v2.4.8 (#320) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8d01a079..11c45f57 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.4.4 + github.com/urfave/cli/v2 v2.4.8 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.2.0 k8s.io/api v0.23.6 diff --git a/go.sum b/go.sum index 6a394c7c..d28c346b 100644 --- a/go.sum +++ b/go.sum @@ -591,8 +591,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= -github.com/urfave/cli/v2 v2.4.4 h1:IvwT3XfI6RytTmIzC35UAu9oyK+bHgUPXDDZNqribkI= -github.com/urfave/cli/v2 v2.4.4/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= +github.com/urfave/cli/v2 v2.4.8 h1:9HuvvddU3oEJr1tJlwUVVsk3snVWMuKSpyAO+SzTNuI= +github.com/urfave/cli/v2 v2.4.8/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= 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= From 7943bced264ae55a5fe3d6730273f937b8794812 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 28 Apr 2022 09:35:54 -0500 Subject: [PATCH 280/430] enhancement: Make context handling for log streaming more explicit (#317) --- cmd/vela-worker/exec.go | 15 +- executor/engine.go | 3 + executor/executor_test.go | 26 +++- executor/linux/build.go | 44 ++++++ executor/linux/build_test.go | 257 +++++++++++++++++++++++++++++++++ executor/linux/linux.go | 49 ++++++- executor/linux/linux_test.go | 88 +++++++++++ executor/linux/opts.go | 14 ++ executor/linux/opts_test.go | 51 +++++++ executor/linux/secret.go | 17 ++- executor/linux/secret_test.go | 5 + executor/linux/service.go | 23 +-- executor/linux/service_test.go | 5 + executor/linux/stage_test.go | 5 + executor/linux/step.go | 23 +-- executor/linux/step_test.go | 5 + executor/local/build.go | 39 +++++ executor/local/build_test.go | 226 ++++++++++++++++++++++++++++- executor/local/local.go | 43 +++++- executor/local/local_test.go | 88 +++++++++++ executor/local/opts.go | 12 ++ executor/local/service.go | 14 +- executor/local/service_test.go | 5 + executor/local/stage_test.go | 5 + executor/local/step.go | 15 +- executor/local/step_test.go | 5 + executor/setup_test.go | 14 +- internal/message/doc.go | 11 ++ internal/message/stream.go | 44 ++++++ 29 files changed, 1065 insertions(+), 86 deletions(-) create mode 100644 internal/message/doc.go create mode 100644 internal/message/stream.go diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 984e31dd..2fa746b0 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -94,11 +94,12 @@ func (w *Worker) exec(index int) error { } // create a background context - ctx := context.Background() + buildCtx, done := context.WithCancel(context.Background()) + defer done() // add to the background context with a timeout // built in for ensuring a build doesn't run forever - ctx, timeout := context.WithTimeout(ctx, t) + ctx, timeout := context.WithTimeout(buildCtx, t) defer timeout() defer func() { @@ -128,6 +129,16 @@ func (w *Worker) exec(index int) error { return nil } + // log streaming uses buildCtx so that it is not subject to the timeout. + go func() { + logger.Info("streaming build logs") + // execute the build with the executor + err = _executor.StreamBuild(buildCtx) + if err != nil { + logger.Errorf("unable to stream build logs: %v", err) + } + }() + logger.Info("assembling build") // assemble the build with the executor err = _executor.AssembleBuild(ctx) diff --git a/executor/engine.go b/executor/engine.go index b3fba545..7f2f9048 100644 --- a/executor/engine.go +++ b/executor/engine.go @@ -53,6 +53,9 @@ type Engine interface { // ExecBuild defines a function that // runs a pipeline for a build. ExecBuild(context.Context) error + // StreamBuild defines a function that receives a StreamRequest + // and then runs StreamService or StreamStep in a goroutine. + StreamBuild(context.Context) error // DestroyBuild defines a function that // cleans up the build after execution. DestroyBuild(context.Context) error diff --git a/executor/executor_test.go b/executor/executor_test.go index e69c2cea..fa2537ac 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" "github.com/go-vela/server/mock/server" @@ -77,6 +78,7 @@ func TestExecutor_New(t *testing.T) { failure bool setup *Setup want Engine + equal interface{} }{ { name: "driver-darwin", @@ -91,7 +93,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: nil, + want: nil, + equal: reflect.DeepEqual, }, { name: "driver-linux", @@ -108,7 +111,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: _linux, + want: _linux, + equal: linux.Equal, }, { name: "driver-local", @@ -123,7 +127,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: _local, + want: _local, + equal: local.Equal, }, { name: "driver-windows", @@ -138,7 +143,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: nil, + want: nil, + equal: reflect.DeepEqual, }, { name: "driver-invalid", @@ -153,7 +159,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: nil, + want: nil, + equal: reflect.DeepEqual, }, { name: "driver-empty", @@ -168,7 +175,8 @@ func TestExecutor_New(t *testing.T) { User: _user, Version: "v1.0.0", }, - want: nil, + want: nil, + equal: reflect.DeepEqual, }, } @@ -193,8 +201,10 @@ func TestExecutor_New(t *testing.T) { t.Errorf("New returned err: %v", err) } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("New is %v, want %v", got, test.want) + // Comparing with reflect.DeepEqual(x, y interface) panics due to the + // unexported streamRequests channel. + if diff := cmp.Diff(test.want, got, cmp.Comparer(test.equal)); diff != "" { + t.Errorf("engine mismatch (-want +got):\n%v", diff) } }) } diff --git a/executor/linux/build.go b/executor/linux/build.go index 2b5ba4a1..b488aae0 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -491,6 +491,50 @@ func (c *client) ExecBuild(ctx context.Context) error { return c.err } +// StreamBuild receives a StreamRequest and then +// runs StreamService or StreamStep in a goroutine. +func (c *client) StreamBuild(ctx context.Context) error { + // create an error group with the parent context + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + streams, streamCtx := errgroup.WithContext(ctx) + + defer func() { + c.Logger.Trace("waiting for stream functions to return") + + err := streams.Wait() + if err != nil { + c.Logger.Errorf("error in a stream request, %v", err) + } + + c.Logger.Info("all stream functions have returned") + }() + + for { + select { + case req := <-c.streamRequests: + streams.Go(func() error { + // update engine logger with step metadata + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry.WithField + logger := c.Logger.WithField(req.Key, req.Container.Name) + + logger.Debugf("streaming %s container %s", req.Key, req.Container.ID) + + err := req.Stream(streamCtx, req.Container) + if err != nil { + logger.Error(err) + } + + return nil + }) + case <-ctx.Done(): + // build done or canceled + return nil + } + } +} + // DestroyBuild cleans up the build after execution. func (c *client) DestroyBuild(ctx context.Context) error { var err error diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 5c9a742f..a591b7d4 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -9,16 +9,19 @@ import ( "flag" "net/http/httptest" "testing" + "time" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" "github.com/urfave/cli/v2" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" + "github.com/go-vela/types/pipeline" "github.com/gin-gonic/gin" ) @@ -247,6 +250,9 @@ func TestLinux_AssembleBuild(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + tests := []struct { name string failure bool @@ -334,6 +340,7 @@ func TestLinux_AssembleBuild(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -385,6 +392,9 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + tests := []struct { name string failure bool @@ -442,6 +452,7 @@ func TestLinux_ExecBuild(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -504,6 +515,252 @@ func TestLinux_ExecBuild(t *testing.T) { } } +func TestLinux_StreamBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + _metadata := testMetadata() + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + type planFuncType = func(context.Context, *pipeline.Container) error + + // planNothing is a planFuncType that does nothing + planNothing := func(ctx context.Context, container *pipeline.Container) error { + return nil + } + + tests := []struct { + name string + failure bool + pipeline string + messageKey string + ctn *pipeline.Container + streamFunc func(*client) message.StreamFunc + planFunc func(*client) planFuncType + }{ + { + name: "basic services pipeline", + failure: false, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + return c.PlanService + }, + ctn: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { + name: "basic services pipeline with StreamService failure", + failure: false, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanService + return planNothing + }, + ctn: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { + name: "basic steps pipeline", + failure: false, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "basic steps pipeline with StreamStep failure", + failure: false, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanStep + return planNothing + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "basic stages pipeline", + failure: false, + pipeline: "testdata/build/stages/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "basic secrets pipeline", + failure: false, + pipeline: "testdata/build/secrets/basic.yml", + messageKey: "secret", + streamFunc: func(c *client) message.StreamFunc { + return c.secret.stream + }, + planFunc: func(c *client) planFuncType { + // no plan function equivalent for secret containers + return planNothing + }, + ctn: &pipeline.Container{ + ID: "secret_github_octocat_1_vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "not_present", + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + buildCtx, done := context.WithCancel(context.Background()) + defer done() + + streamRequests := make(chan message.StreamRequest) + + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + withStreamRequests(streamRequests), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(buildCtx) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + // simulate ExecBuild() which runs concurrently with StreamBuild() + go func() { + // ExecBuild calls PlanService()/PlanStep() before ExecService()/ExecStep() + // (ExecStage() calls PlanStep() before ExecStep()). + _engine.err = test.planFunc(_engine)(buildCtx, test.ctn) + + // ExecService()/ExecStep()/secret.exec() send this message + streamRequests <- message.StreamRequest{ + Key: test.messageKey, + Stream: test.streamFunc(_engine), + Container: test.ctn, + } + + // simulate exec build duration + time.Sleep(100 * time.Microsecond) + + // signal the end of the build so StreamBuild can terminate + done() + }() + + err = _engine.StreamBuild(buildCtx) + + if test.failure { + if err == nil { + t.Errorf("StreamBuild for %s should have returned err", test.pipeline) + } + + return // continue to next test + } + + if err != nil { + t.Errorf("StreamBuild for %s returned err: %v", test.pipeline, err) + } + }) + } +} + func TestLinux_DestroyBuild(t *testing.T) { // setup types compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 71ccd041..fe388cd0 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -5,11 +5,13 @@ package linux import ( + "reflect" "sync" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) @@ -29,19 +31,20 @@ type ( secret *secretSvc // private fields - init *pipeline.Container - logMethod string - maxLogSize uint - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - // nolint: structcheck,unused // ignore false positives + init *pipeline.Container + logMethod string + maxLogSize uint + build *library.Build + pipeline *pipeline.Build + repo *library.Repo secrets sync.Map services sync.Map serviceLogs sync.Map steps sync.Map stepLogs sync.Map + streamRequests chan message.StreamRequest + user *library.User err error } @@ -52,6 +55,35 @@ type ( } ) +// Equal returns true if the other client is the equivalent. +func Equal(a, b *client) bool { + // handle any nil comparisons + if a == nil || b == nil { + return a == nil && b == nil + } + + return reflect.DeepEqual(a.Logger, b.Logger) && + reflect.DeepEqual(a.Vela, b.Vela) && + reflect.DeepEqual(a.Runtime, b.Runtime) && + reflect.DeepEqual(a.Secrets, b.Secrets) && + a.Hostname == b.Hostname && + a.Version == b.Version && + reflect.DeepEqual(a.init, b.init) && + a.logMethod == b.logMethod && + a.maxLogSize == b.maxLogSize && + reflect.DeepEqual(a.build, b.build) && + reflect.DeepEqual(a.pipeline, b.pipeline) && + reflect.DeepEqual(a.repo, b.repo) && + reflect.DeepEqual(&a.secrets, &b.secrets) && + reflect.DeepEqual(&a.services, &b.services) && + reflect.DeepEqual(&a.serviceLogs, &b.serviceLogs) && + reflect.DeepEqual(&a.steps, &b.steps) && + reflect.DeepEqual(&a.stepLogs, &b.stepLogs) && + // do not compare streamRequests channel + reflect.DeepEqual(a.user, b.user) && + reflect.DeepEqual(a.err, b.err) +} + // New returns an Executor implementation that integrates with a Linux instance. // // nolint: revive // ignore unexported type as it is intentional @@ -69,6 +101,9 @@ func New(opts ...Opt) (*client, error) { // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry c.Logger = logrus.NewEntry(logger) + // instantiate streamRequests channel (which may be overridden using withStreamRequests()). + c.streamRequests = make(chan message.StreamRequest) + // apply all provided configuration options for _, opt := range opts { err := opt(c) diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 82911867..46abe49b 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -21,6 +21,94 @@ import ( "github.com/go-vela/types/pipeline" ) +func TestEqual(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _linux, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create linux executor: %v", err) + } + + _alternate, err := New( + WithBuild(testBuild()), + WithHostname("a.different.host"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create alternate local executor: %v", err) + } + + tests := []struct { + name string + a *client + b *client + want bool + }{ + { + name: "both nil", + a: nil, + b: nil, + want: true, + }, + { + name: "left nil", + a: nil, + b: _linux, + want: false, + }, + { + name: "right nil", + a: _linux, + b: nil, + want: false, + }, + { + name: "equal", + a: _linux, + b: _linux, + want: true, + }, + { + name: "not equal", + a: _linux, + b: _alternate, + want: false, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if got := Equal(test.a, test.b); got != test.want { + t.Errorf("Equal() = %v, want %v", got, test.want) + } + }) + } +} + func TestLinux_New(t *testing.T) { // setup types gin.SetMode(gin.TestMode) diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 04f23146..4095a055 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -10,6 +10,7 @@ import ( "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/sirupsen/logrus" ) @@ -198,3 +199,16 @@ func WithVersion(version string) Opt { return nil } } + +// withStreamRequests sets the streamRequests channel in the executor client for Linux +// (primarily used for tests). +func withStreamRequests(s chan message.StreamRequest) Opt { + return func(c *client) error { + c.Logger.Trace("configuring stream requests in linux executor client") + + // set the streamRequests channel in the client + c.streamRequests = s + + return nil + } +} diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 9e4ed641..ac49f04b 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" "github.com/go-vela/server/mock/server" @@ -159,6 +160,7 @@ func TestLinux_Opt_WithMaxLogSize(t *testing.T) { }) } } + func TestLinux_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { @@ -195,6 +197,55 @@ func TestLinux_Opt_WithHostname(t *testing.T) { } } +func TestLinux_Opt_WithLogger(t *testing.T) { + // setup tests + tests := []struct { + name string + failure bool + logger *logrus.Entry + }{ + { + name: "provided logger", + failure: false, + logger: &logrus.Entry{}, + }, + { + name: "nil logger", + failure: false, + logger: nil, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithLogger(test.logger), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogger should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("WithLogger returned err: %v", err) + } + + if test.logger == nil && _engine.Logger == nil { + t.Errorf("_engine.Logger should not be nil even if nil is passed to WithLogger") + } + + if test.logger != nil && !reflect.DeepEqual(_engine.Logger, test.logger) { + t.Errorf("WithLogger set %v, want %v", _engine.Logger, test.logger) + } + }) + } +} + func TestLinux_Opt_WithPipeline(t *testing.T) { // setup types _steps := testSteps() diff --git a/executor/linux/secret.go b/executor/linux/secret.go index ad2c2b25..6417070d 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -16,6 +16,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" "github.com/sirupsen/logrus" @@ -135,14 +136,12 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { return err } - go func() { - logger.Debug("stream logs for container") - // stream logs from container - err = s.client.secret.stream(ctx, _secret.Origin) - if err != nil { - logger.Error(err) - } - }() + // trigger StreamStep goroutine with logging context + s.client.streamRequests <- message.StreamRequest{ + Key: "secret", + Stream: s.stream, + Container: _secret.Origin, + } logger.Debug("waiting for container") // wait for the runtime container @@ -325,6 +324,8 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { } } + logger.Info("finished streaming logs") + return scanner.Err() } diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 24427f8c..b0643661 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" @@ -265,6 +266,9 @@ func TestLinux_Secret_exec(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -302,6 +306,7 @@ func TestLinux_Secret_exec(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/linux/service.go b/executor/linux/service.go index 66fa3309..b20cc22e 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -15,8 +15,8 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/service" - "golang.org/x/sync/errgroup" ) // CreateService configures the service for execution. @@ -143,21 +143,12 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error return err } - // create an error group with the parent context - // - // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext - logs, logCtx := errgroup.WithContext(ctx) - - logs.Go(func() error { - logger.Debug("streaming logs for container") - // stream logs from container - err := c.StreamService(logCtx, ctn) - if err != nil { - logger.Error(err) - } - - return nil - }) + // trigger StreamService goroutine with logging context + c.streamRequests <- message.StreamRequest{ + Key: "service", + Stream: c.StreamService, + Container: ctn, + } return nil } diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 70ca8aec..c95a488c 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -13,6 +13,7 @@ import ( "github.com/go-vela/server/mock/server" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" @@ -231,6 +232,9 @@ func TestLinux_ExecService(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -284,6 +288,7 @@ func TestLinux_ExecService(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 0b2ad832..42eeff12 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -18,6 +18,7 @@ import ( "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" @@ -302,6 +303,9 @@ func TestLinux_ExecStage(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -377,6 +381,7 @@ func TestLinux_ExecStage(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/linux/step.go b/executor/linux/step.go index f823aede..49c755e1 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -16,8 +16,8 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" - "golang.org/x/sync/errgroup" ) // CreateStep configures the step for execution. @@ -155,21 +155,12 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { return err } - // create an error group with the parent context - // - // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext - logs, logCtx := errgroup.WithContext(ctx) - - logs.Go(func() error { - logger.Debug("streaming logs for container") - // stream logs from container - err := c.StreamStep(logCtx, ctn) - if err != nil { - logger.Error(err) - } - - return nil - }) + // trigger StreamStep goroutine with logging context + c.streamRequests <- message.StreamRequest{ + Key: "step", + Stream: c.StreamStep, + Container: ctn, + } // do not wait for detached containers if ctn.Detach { diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 4012238c..078dce96 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -15,6 +15,7 @@ import ( "github.com/go-vela/server/mock/server" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" @@ -238,6 +239,9 @@ func TestLinux_ExecStep(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -314,6 +318,7 @@ func TestLinux_ExecStep(t *testing.T) { WithRuntime(_runtime), WithUser(_user), WithVelaClient(_client), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/local/build.go b/executor/local/build.go index 21c3efaf..c079787b 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -344,6 +344,45 @@ func (c *client) ExecBuild(ctx context.Context) error { return c.err } +// StreamBuild receives a StreamRequest and then +// runs StreamService or StreamStep in a goroutine. +func (c *client) StreamBuild(ctx context.Context) error { + // create an error group with the parent context + // + // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext + streams, streamCtx := errgroup.WithContext(ctx) + + defer func() { + fmt.Fprintln(os.Stdout, "waiting for stream functions to return") + + err := streams.Wait() + if err != nil { + fmt.Fprintln(os.Stdout, "error in a stream request:", err) + } + + fmt.Fprintln(os.Stdout, "all stream functions have returned") + }() + + for { + select { + case req := <-c.streamRequests: + streams.Go(func() error { + fmt.Fprintf(os.Stdout, "streaming %s container %s", req.Key, req.Container.ID) + + err := req.Stream(streamCtx, req.Container) + if err != nil { + fmt.Fprintln(os.Stdout, "error streaming:", err) + } + + return nil + }) + case <-ctx.Done(): + // build done or canceled + return nil + } + } +} + // DestroyBuild cleans up the build after execution. func (c *client) DestroyBuild(ctx context.Context) error { var err error diff --git a/executor/local/build_test.go b/executor/local/build_test.go index fa95675c..35a2ada1 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -8,10 +8,13 @@ import ( "context" "flag" "testing" + "time" - "github.com/go-vela/server/compiler/native" "github.com/urfave/cli/v2" + "github.com/go-vela/server/compiler/native" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" ) @@ -186,6 +189,9 @@ func TestLocal_AssembleBuild(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + tests := []struct { name string failure bool @@ -257,6 +263,7 @@ func TestLocal_AssembleBuild(t *testing.T) { WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -298,6 +305,9 @@ func TestLocal_ExecBuild(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + tests := []struct { name string failure bool @@ -354,6 +364,7 @@ func TestLocal_ExecBuild(t *testing.T) { WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) @@ -382,6 +393,219 @@ func TestLocal_ExecBuild(t *testing.T) { } } +func TestLocal_StreamBuild(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + _repo := testRepo() + _user := testUser() + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + type planFuncType = func(context.Context, *pipeline.Container) error + + // planNothing is a planFuncType that does nothing + planNothing := func(ctx context.Context, container *pipeline.Container) error { + return nil + } + + tests := []struct { + name string + failure bool + pipeline string + messageKey string + ctn *pipeline.Container + streamFunc func(*client) message.StreamFunc + planFunc func(*client) planFuncType + }{ + { + name: "basic services pipeline", + failure: false, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + return c.PlanService + }, + ctn: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { + name: "basic services pipeline with StreamService failure", + failure: false, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanService + return planNothing + }, + ctn: &pipeline.Container{ + ID: "service_github_octocat_1_postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, + { + name: "basic steps pipeline", + failure: false, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "basic steps pipeline with StreamStep failure", + failure: false, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanStep + return planNothing + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "basic stages pipeline", + failure: false, + pipeline: "testdata/build/stages/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + buildCtx, done := context.WithCancel(context.Background()) + defer done() + + streamRequests := make(chan message.StreamRequest) + + _pipeline, err := compiler. + WithBuild(_build). + WithRepo(_repo). + WithLocal(true). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(_build), + WithPipeline(_pipeline), + WithRepo(_repo), + WithRuntime(_runtime), + WithUser(_user), + withStreamRequests(streamRequests), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + // run create to init steps to be created properly + err = _engine.CreateBuild(buildCtx) + if err != nil { + t.Errorf("unable to create build: %v", err) + } + + // simulate ExecBuild() + go func() { + // ExecBuild calls PlanService()/PlanStep() before ExecService()/ExecStep() + // (ExecStage() calls PlanStep() before ExecStep()). + _engine.err = test.planFunc(_engine)(buildCtx, test.ctn) + + // ExecService()/ExecStep()/secret.exec() send this message + streamRequests <- message.StreamRequest{ + Key: test.messageKey, + Stream: test.streamFunc(_engine), + Container: test.ctn, + } + + // simulate exec build duration + time.Sleep(100 * time.Microsecond) + + // signal the end of the build so StreamBuild can terminate + done() + }() + + err = _engine.StreamBuild(buildCtx) + + if test.failure { + if err == nil { + t.Errorf("StreamBuild for %s should have returned err", test.pipeline) + } + + return // continue to next test + } + + if err != nil { + t.Errorf("StreamBuild for %s returned err: %v", test.pipeline, err) + } + }) + } +} + func TestLocal_DestroyBuild(t *testing.T) { // setup types compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) diff --git a/executor/local/local.go b/executor/local/local.go index 6674931a..5fb45c3e 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -5,11 +5,13 @@ package local import ( + "reflect" "sync" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" ) @@ -22,17 +24,39 @@ type ( Version string // private fields - init *pipeline.Container - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - services sync.Map - steps sync.Map - user *library.User - err error + init *pipeline.Container + build *library.Build + pipeline *pipeline.Build + repo *library.Repo + services sync.Map + steps sync.Map + user *library.User + err error + streamRequests chan message.StreamRequest } ) +// equal returns true if the other client is the equivalent. +func Equal(a, b *client) bool { + // handle any nil comparisons + if a == nil || b == nil { + return a == nil && b == nil + } + + return reflect.DeepEqual(a.Vela, b.Vela) && + reflect.DeepEqual(a.Runtime, b.Runtime) && + a.Hostname == b.Hostname && + a.Version == b.Version && + reflect.DeepEqual(a.init, b.init) && + reflect.DeepEqual(a.build, b.build) && + reflect.DeepEqual(a.pipeline, b.pipeline) && + reflect.DeepEqual(a.repo, b.repo) && + reflect.DeepEqual(&a.services, &b.services) && + reflect.DeepEqual(&a.steps, &b.steps) && + reflect.DeepEqual(a.user, b.user) && + reflect.DeepEqual(a.err, b.err) +} + // New returns an Executor implementation that integrates with the local system. // // nolint: revive // ignore unexported type as it is intentional @@ -40,6 +64,9 @@ func New(opts ...Opt) (*client, error) { // create new local client c := new(client) + // instantiate streamRequests channel (which may be overridden using withStreamRequests()). + c.streamRequests = make(chan message.StreamRequest) + // apply all provided configuration options for _, opt := range opts { err := opt(c) diff --git a/executor/local/local_test.go b/executor/local/local_test.go index 083a0ca3..113f4e70 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -20,6 +20,94 @@ import ( "github.com/go-vela/types/pipeline" ) +func TestEqual(t *testing.T) { + // setup types + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + _local, err := New( + WithBuild(testBuild()), + WithHostname("localhost"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create local executor: %v", err) + } + + _alternate, err := New( + WithBuild(testBuild()), + WithHostname("a.different.host"), + WithPipeline(testSteps()), + WithRepo(testRepo()), + WithRuntime(_runtime), + WithUser(testUser()), + WithVelaClient(_client), + ) + if err != nil { + t.Errorf("unable to create alternate local executor: %v", err) + } + + tests := []struct { + name string + a *client + b *client + want bool + }{ + { + name: "both nil", + a: nil, + b: nil, + want: true, + }, + { + name: "left nil", + a: nil, + b: _local, + want: false, + }, + { + name: "right nil", + a: _local, + b: nil, + want: false, + }, + { + name: "equal", + a: _local, + b: _local, + want: true, + }, + { + name: "not equal", + a: _local, + b: _alternate, + want: false, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if got := Equal(test.a, test.b); got != test.want { + t.Errorf("Equal() = %v, want %v", got, test.want) + } + }) + } +} + func TestLocal_New(t *testing.T) { // setup types gin.SetMode(gin.TestMode) diff --git a/executor/local/opts.go b/executor/local/opts.go index 6b7a489a..d4b0ba55 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -7,6 +7,7 @@ package local import ( "fmt" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/sdk-go/vela" @@ -119,3 +120,14 @@ func WithVersion(version string) Opt { return nil } } + +// withStreamRequests sets the streamRequests channel in the executor client for Linux +// (primarily used for tests). +func withStreamRequests(s chan message.StreamRequest) Opt { + return func(c *client) error { + // set the streamRequests channel in the client + c.streamRequests = s + + return nil + } +} diff --git a/executor/local/service.go b/executor/local/service.go index bc5269c5..eba3ee96 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -11,6 +11,7 @@ import ( "os" "time" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/service" "github.com/go-vela/types/constants" @@ -96,13 +97,12 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error return err } - go func() { - // stream logs from container - err := c.StreamService(context.Background(), ctn) - if err != nil { - fmt.Fprintln(os.Stdout, "unable to stream logs for service:", err) - } - }() + // trigger StreamService goroutine with logging context + c.streamRequests <- message.StreamRequest{ + Key: "service", + Stream: c.StreamService, + Container: ctn, + } return nil } diff --git a/executor/local/service_test.go b/executor/local/service_test.go index cc619c4d..304c28ae 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -8,6 +8,7 @@ import ( "context" "testing" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/library" @@ -180,6 +181,9 @@ func TestLocal_ExecService(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -232,6 +236,7 @@ func TestLocal_ExecService(t *testing.T) { WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index c5f9559b..2aa5f887 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -15,6 +15,7 @@ import ( "github.com/go-vela/server/compiler/native" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/pipeline" @@ -260,6 +261,9 @@ func TestLocal_ExecStage(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -316,6 +320,7 @@ func TestLocal_ExecStage(t *testing.T) { WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/local/step.go b/executor/local/step.go index 032ccbbf..27c6bcac 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -14,6 +14,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" ) @@ -103,14 +104,12 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { return err } - go func() { - // stream logs from container - err := c.StreamStep(context.Background(), ctn) - if err != nil { - // TODO: Should this be changed or removed? - fmt.Println(err) - } - }() + // trigger StreamStep goroutine with logging context + c.streamRequests <- message.StreamRequest{ + Key: "step", + Stream: c.StreamStep, + Container: ctn, + } // do not wait for detached containers if ctn.Detach { diff --git a/executor/local/step_test.go b/executor/local/step_test.go index 5a549368..8d452a92 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -8,6 +8,7 @@ import ( "context" "testing" + "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/types/library" @@ -187,6 +188,9 @@ func TestLocal_ExecStep(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + // setup tests tests := []struct { name string @@ -262,6 +266,7 @@ func TestLocal_ExecStep(t *testing.T) { WithRepo(_repo), WithRuntime(_runtime), WithUser(_user), + withStreamRequests(streamRequests), ) if err != nil { t.Errorf("unable to create executor engine: %v", err) diff --git a/executor/setup_test.go b/executor/setup_test.go index 2c44193c..069993d1 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -6,10 +6,10 @@ package executor import ( "net/http/httptest" - "reflect" "testing" "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" "github.com/go-vela/server/mock/server" @@ -111,8 +111,10 @@ func TestExecutor_Setup_Linux(t *testing.T) { t.Errorf("Linux returned err: %v", err) } - if !reflect.DeepEqual(got, want) { - t.Errorf("Linux is %v, want %v", got, want) + // Comparing with reflect.DeepEqual(x, y interface) panics due to the + // unexported streamRequests channel. + if diff := cmp.Diff(want, got, cmp.Comparer(linux.Equal)); diff != "" { + t.Errorf("linux Engine mismatch (-want +got):\n%v", diff) } } @@ -164,8 +166,10 @@ func TestExecutor_Setup_Local(t *testing.T) { t.Errorf("Local returned err: %v", err) } - if !reflect.DeepEqual(got, want) { - t.Errorf("Local is %v, want %v", got, want) + // Comparing with reflect.DeepEqual(x, y interface) panics due to the + // unexported streamRequests channel. + if diff := cmp.Diff(want, got, cmp.Comparer(local.Equal)); diff != "" { + t.Errorf("local Engine mismatch (-want +got):\n%v", diff) } } diff --git a/internal/message/doc.go b/internal/message/doc.go new file mode 100644 index 00000000..10bad174 --- /dev/null +++ b/internal/message/doc.go @@ -0,0 +1,11 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package message provides message types used in the executor. +// These types have to be in a separate package to prevent circular imports. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/message" +package message diff --git a/internal/message/stream.go b/internal/message/stream.go new file mode 100644 index 00000000..9534f38e --- /dev/null +++ b/internal/message/stream.go @@ -0,0 +1,44 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package message + +import ( + "context" + + "github.com/go-vela/types/pipeline" +) + +// StreamFunc is either StreamService or StreamStep in executor.Engine. +type StreamFunc = func(context.Context, *pipeline.Container) error + +// StreamRequest is the message used to begin streaming for a container +// (requests goes from ExecService / ExecStep to StreamBuild in executor). +type StreamRequest struct { + // Key is either "service" or "step". + Key string + // Stream is either Engine.StreamService or Engine.StreamStep. + Stream StreamFunc + // Container is the container for the service or step to stream logs for. + Container *pipeline.Container +} + +// MockStreamRequestsWithCancel discards all requests until you call the cancel function. +func MockStreamRequestsWithCancel(ctx context.Context) (chan StreamRequest, context.CancelFunc) { + cancelCtx, done := context.WithCancel(ctx) + streamRequests := make(chan StreamRequest) + + // discard all stream requests + go func() { + for { + select { + case <-streamRequests: + case <-cancelCtx.Done(): + return + } + } + }() + + return streamRequests, done +} From a6191ab95869ca3323911912bb78a363b15f9256 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 28 Apr 2022 10:13:36 -0500 Subject: [PATCH 281/430] bugfix(k8s): skip false error in logs correctly (#323) --- runtime/kubernetes/container.go | 14 ++------ runtime/kubernetes/container_test.go | 50 +++++++++++++++++++++++++++ runtime/kubernetes/kubernetes_test.go | 2 ++ 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 11428e3a..1b25b442 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -53,17 +53,9 @@ func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) // avoid a panic if the build ends without terminating all containers if cst.State.Terminated == nil { - for _, container := range pod.Spec.Containers { - if cst.Name != container.Name { - continue - } - - // steps that were not executed will still be "running" the pause image as expected. - if container.Image == pauseImage { - return nil - } - - break + // steps that were not executed will still be "running" the pause image as expected. + if cst.Image == pauseImage || cst.Image == image.Parse(pauseImage) { + return nil } return fmt.Errorf("expected container %s to be terminated, got %v", ctn.ID, cst.State) diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 2efc8043..d71d3753 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/image" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" v1 "k8s.io/api/core/v1" @@ -52,6 +53,53 @@ func TestKubernetes_InspectContainer(t *testing.T) { State: v1.ContainerState{ Running: &v1.ContainerStateRunning{}, }, + Image: _container.Image, + }, + }, + }, + }, + container: _container, + }, + { + name: "build stops before container execution with raw pauseImage", + failure: false, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + // container not patched yet with correct image + Image: pauseImage, + }, + }, + }, + }, + container: _container, + }, + { + name: "build stops before container execution with canonical pauseImage", + failure: false, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + // container not patched yet with correct image + Image: image.Parse(pauseImage), }, }, }, @@ -411,6 +459,7 @@ func TestKubernetes_WaitContainer(t *testing.T) { ExitCode: 0, }, }, + Image: "alpine:latest", }, { Name: "step-github-octocat-1-clone", @@ -420,6 +469,7 @@ func TestKubernetes_WaitContainer(t *testing.T) { ExitCode: 0, }, }, + Image: "target/vela-git:v0.4.0", }, }, }, diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 39da9c63..364a90b0 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -106,6 +106,7 @@ var ( ExitCode: 0, }, }, + Image: "target/vela-git:v0.4.0", }, { Name: "step-github-octocat-1-echo", @@ -115,6 +116,7 @@ var ( ExitCode: 0, }, }, + Image: "alpine:latest", }, }, }, From 8a2d69664e45c3aa3ac699b8f98995090c219856 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:22:20 -0500 Subject: [PATCH 282/430] chore(deps): update dependency redis to v7 (#328) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9f20ba9c..876a9ff4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -109,7 +109,7 @@ services: # https://redis.io/ redis: container_name: redis - image: redis:6-alpine + image: redis:7-alpine networks: - vela ports: From b1a4e15b3fbeaef419dc4fc9911bcf0148bd6bd5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:25:39 -0500 Subject: [PATCH 283/430] chore(deps): update github/codeql-action action to v2 (#322) --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a60d441c..20575b78 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -50,7 +50,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -64,4 +64,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 8319eef7bc9cc636c8c128e882dacf2edd3f318c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:31:19 -0500 Subject: [PATCH 284/430] fix(deps): update module github.com/urfave/cli/v2 to v2.5.1 (#325) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 11c45f57..0712adc2 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.4.8 + github.com/urfave/cli/v2 v2.5.1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.2.0 k8s.io/api v0.23.6 diff --git a/go.sum b/go.sum index d28c346b..184c69f6 100644 --- a/go.sum +++ b/go.sum @@ -591,8 +591,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= -github.com/urfave/cli/v2 v2.4.8 h1:9HuvvddU3oEJr1tJlwUVVsk3snVWMuKSpyAO+SzTNuI= -github.com/urfave/cli/v2 v2.4.8/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= +github.com/urfave/cli/v2 v2.5.1 h1:YKwdkyA0xTBzOaP2G0DVxBnCheHGP+Y9VbKAs4K1Ess= +github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= 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= From b98bab1c59c633532457ca5d71dc3bc25027287d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 08:55:08 -0500 Subject: [PATCH 285/430] fix(deps): update module github.com/google/go-cmp to v0.5.8 (#327) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0712adc2..9ba514a6 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-vela/sdk-go v0.13.0 github.com/go-vela/server v0.13.1 github.com/go-vela/types v0.13.0 - github.com/google/go-cmp v0.5.7 + github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 diff --git a/go.sum b/go.sum index 184c69f6..cc85b3b6 100644 --- a/go.sum +++ b/go.sum @@ -263,8 +263,9 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= @@ -907,7 +908,6 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= From 07a1a5904780b8f119a27fd87c89dc854d1ec2dc Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 29 Apr 2022 19:05:26 -0500 Subject: [PATCH 286/430] bugfix: make sure kubernetes log streaming gets canceled with build (#329) --- runtime/kubernetes/container.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 1b25b442..430a9e8a 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -238,6 +238,10 @@ func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { c.Logger.Tracef("tailing output for container %s", ctn.ID) + // create a logsContext that will be canceled at the end of this + logsContext, logsDone := context.WithCancel(ctx) + defer logsDone() + // create object to store container logs var logs io.ReadCloser @@ -261,7 +265,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io stream, err := c.Kubernetes.CoreV1(). Pods(c.config.Namespace). GetLogs(c.Pod.ObjectMeta.Name, opts). - Stream(context.Background()) + Stream(logsContext) if err != nil { c.Logger.Errorf("%v", err) return false, nil @@ -305,7 +309,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // perform the function to capture logs with periodic backoff // // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#ExponentialBackoff - err := wait.ExponentialBackoff(backoff, logsFunc) + err := wait.ExponentialBackoffWithContext(logsContext, backoff, logsFunc) if err != nil { return nil, err } From 9c5312eaede5d477aed9e9ae61e62e4a644a45a5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 29 Apr 2022 19:10:17 -0500 Subject: [PATCH 287/430] refactor(executor): clarify why use different contexts (#304) --- cmd/vela-worker/exec.go | 17 ++++++++++------- cmd/vela-worker/operate.go | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2fa746b0..c6033c8d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -93,18 +93,21 @@ func (w *Worker) exec(index int) error { t = time.Duration(item.Repo.GetTimeout()) * time.Minute } - // create a background context + // create a build context (from a background context + // so that other builds can't inadvertently cancel this build) buildCtx, done := context.WithCancel(context.Background()) defer done() // add to the background context with a timeout // built in for ensuring a build doesn't run forever - ctx, timeout := context.WithTimeout(buildCtx, t) + timeoutCtx, timeout := context.WithTimeout(buildCtx, t) defer timeout() defer func() { logger.Info("destroying build") - // destroy the build with the executor + + // destroy the build with the executor (pass a background + // context to guarantee all build resources are destroyed). err = _executor.DestroyBuild(context.Background()) if err != nil { logger.Errorf("unable to destroy build: %v", err) @@ -115,7 +118,7 @@ func (w *Worker) exec(index int) error { logger.Info("creating build") // create the build with the executor - err = _executor.CreateBuild(ctx) + err = _executor.CreateBuild(timeoutCtx) if err != nil { logger.Errorf("unable to create build: %v", err) return nil @@ -123,7 +126,7 @@ func (w *Worker) exec(index int) error { logger.Info("planning build") // plan the build with the executor - err = _executor.PlanBuild(ctx) + err = _executor.PlanBuild(timeoutCtx) if err != nil { logger.Errorf("unable to plan build: %v", err) return nil @@ -141,7 +144,7 @@ func (w *Worker) exec(index int) error { logger.Info("assembling build") // assemble the build with the executor - err = _executor.AssembleBuild(ctx) + err = _executor.AssembleBuild(timeoutCtx) if err != nil { logger.Errorf("unable to assemble build: %v", err) return nil @@ -149,7 +152,7 @@ func (w *Worker) exec(index int) error { logger.Info("executing build") // execute the build with the executor - err = _executor.ExecBuild(ctx) + err = _executor.ExecBuild(timeoutCtx) if err != nil { logger.Errorf("unable to execute build: %v", err) return nil diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 4d7b9196..ac625353 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -105,6 +105,8 @@ func (w *Worker) operate(ctx context.Context) error { return nil default: // exec operator subprocess to poll and execute builds + // (do not pass the context to avoid errors in one + // executor+build inadvertently canceling other builds) // nolint: contextcheck // ignore passing context err = w.exec(id) if err != nil { From cf98982eab0ea5f4345e61613ac987040a5b950a Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Fri, 29 Apr 2022 18:33:32 -0600 Subject: [PATCH 288/430] feat(internal/skip): add event action handling for skip method (#326) --- go.mod | 12 ++++++------ go.sum | 20 +++++++++++++------- internal/step/skip.go | 10 +++++++++- internal/step/skip_test.go | 4 ++++ 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 9ba514a6..7e97dbf8 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.13.0 github.com/go-vela/server v0.13.1 - github.com/go-vela/types v0.13.0 - github.com/google/go-cmp v0.5.8 + github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281 + github.com/google/go-cmp v0.5.7 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.19.0 // indirect + github.com/alicebob/miniredis/v2 v2.20.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -87,11 +87,11 @@ require ( github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.1.11 // indirect - github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect - go.starlark.net v0.0.0-20220302181546-5411bad688d1 // indirect + github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect + go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect + golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index cc85b3b6..fdec590b 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,9 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.19.0 h1:oexn9tOmXrfpceZsMvH6lKiOOoo/hLop7d5q6grNQrM= github.com/alicebob/miniredis/v2 v2.19.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= +github.com/alicebob/miniredis/v2 v2.20.0 h1:NJSfJcoyPvs9t+wqnox5BTcNVn7J9KxYl0RioTcE8S4= +github.com/alicebob/miniredis/v2 v2.20.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -205,8 +206,9 @@ github.com/go-vela/sdk-go v0.13.0/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkj github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= github.com/go-vela/server v0.13.1 h1:5Ht9uqRtIzhf8kusM1Y5WzIwFIY1BW1aBFx+lWUPXmQ= github.com/go-vela/server v0.13.1/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= -github.com/go-vela/types v0.13.0 h1:PX/0wtKMXbtqHbrWgwlCDzuBzeh+4V042k56siDSm1o= github.com/go-vela/types v0.13.0/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= +github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281 h1:2QYp82wFAUZQ/3gL5GKaCmIJn9iU8playVu6SdVUwB4= +github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281/go.mod h1:LDI9YXINK8Zz0DvvruJLFLoJyxaxetXme1pZAXvQkhU= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -263,9 +265,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= @@ -438,6 +439,7 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -601,8 +603,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= +github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -612,8 +615,9 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20220302181546-5411bad688d1 h1:i0Sz4b+qJi5xwOaFZqZ+RNHkIpaKLDofei/Glt+PMNc= go.starlark.net v0.0.0-20220302181546-5411bad688d1/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= +go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -739,8 +743,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -908,6 +913,7 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= diff --git a/internal/step/skip.go b/internal/step/skip.go index a4491228..40867f54 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -21,12 +21,20 @@ func Skip(c *pipeline.Container, b *library.Build, r *library.Repo) bool { return true } + event := b.GetEvent() + action := b.GetEventAction() + + // if the build has an event action, concatenate event and event action for matching + if !strings.EqualFold(action, "") { + event = event + ":" + action + } + // create ruledata from build and repository information // // https://pkg.go.dev/github.com/go-vela/types/pipeline#RuleData ruledata := &pipeline.RuleData{ Branch: b.GetBranch(), - Event: b.GetEvent(), + Event: event, Repo: r.GetFullName(), Status: b.GetStatus(), } diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index 619a9e61..d5efe4c4 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -19,6 +19,7 @@ func TestStep_Skip(t *testing.T) { Number: vela.Int(1), Parent: vela.Int(1), Event: vela.String("push"), + EventAction: vela.String(""), Status: vela.String("success"), Error: vela.String(""), Enqueued: vela.Int64(1563474077), @@ -46,6 +47,7 @@ func TestStep_Skip(t *testing.T) { Number: vela.Int(1), Parent: vela.Int(1), Event: vela.String("comment"), + EventAction: vela.String("created"), Status: vela.String("success"), Error: vela.String(""), Enqueued: vela.Int64(1563474077), @@ -73,6 +75,7 @@ func TestStep_Skip(t *testing.T) { Number: vela.Int(1), Parent: vela.Int(1), Event: vela.String("deployment"), + EventAction: vela.String(""), Status: vela.String("success"), Error: vela.String(""), Enqueued: vela.Int64(1563474077), @@ -100,6 +103,7 @@ func TestStep_Skip(t *testing.T) { Number: vela.Int(1), Parent: vela.Int(1), Event: vela.String("tag"), + EventAction: vela.String(""), Status: vela.String("success"), Error: vela.String(""), Enqueued: vela.Int64(1563474077), From dfd68b1dcb24139e78a3bde6693085173751e8b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 09:04:45 -0500 Subject: [PATCH 289/430] fix(deps): update deps (patch) (#330) --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7e97dbf8..a4cf5b46 100644 --- a/go.mod +++ b/go.mod @@ -8,10 +8,10 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.13.0 + github.com/go-vela/sdk-go v0.13.1 github.com/go-vela/server v0.13.1 github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281 - github.com/google/go-cmp v0.5.7 + github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 diff --git a/go.sum b/go.sum index fdec590b..bd8bece5 100644 --- a/go.sum +++ b/go.sum @@ -201,8 +201,8 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.13.0 h1:aHC6RWXr664GtmlLHs2IW59gmSNk3jcLXuxfZwM51ks= -github.com/go-vela/sdk-go v0.13.0/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= +github.com/go-vela/sdk-go v0.13.1 h1:qjilbDwJSYg+fdm6KcsP5/SVlcSVuR5am6tM238Oxos= +github.com/go-vela/sdk-go v0.13.1/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= github.com/go-vela/server v0.13.1 h1:5Ht9uqRtIzhf8kusM1Y5WzIwFIY1BW1aBFx+lWUPXmQ= github.com/go-vela/server v0.13.1/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= @@ -265,8 +265,9 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= @@ -913,7 +914,6 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= From 49a00eb6654450f8ec2285975dce2a5be40501c0 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 2 May 2022 21:34:33 -0500 Subject: [PATCH 290/430] enhance(kubernetes): Add podTracker and containerTracker to use k8s API more like a k8s controller (#302) --- cmd/vela-worker/exec.go | 2 +- executor/linux/build.go | 7 + executor/local/build.go | 7 + runtime/docker/build.go | 8 + runtime/docker/build_test.go | 35 +++ runtime/engine.go | 4 + runtime/kubernetes/build.go | 50 ++++ runtime/kubernetes/build_test.go | 91 +++++- runtime/kubernetes/container.go | 107 +++---- runtime/kubernetes/container_test.go | 191 +++++++++++-- runtime/kubernetes/kubernetes.go | 15 +- runtime/kubernetes/kubernetes_test.go | 39 --- runtime/kubernetes/pod_tracker.go | 264 +++++++++++++++++ runtime/kubernetes/pod_tracker_test.go | 379 +++++++++++++++++++++++++ runtime/kubernetes/volume.go | 1 + 15 files changed, 1068 insertions(+), 132 deletions(-) create mode 100644 runtime/kubernetes/pod_tracker.go create mode 100644 runtime/kubernetes/pod_tracker_test.go diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index c6033c8d..62aa1198 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -132,7 +132,7 @@ func (w *Worker) exec(index int) error { return nil } - // log streaming uses buildCtx so that it is not subject to the timeout. + // log/event streaming uses buildCtx so that it is not subject to the timeout. go func() { logger.Info("streaming build logs") // execute the build with the executor diff --git a/executor/linux/build.go b/executor/linux/build.go index b488aae0..c31e2938 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -510,6 +510,13 @@ func (c *client) StreamBuild(ctx context.Context) error { c.Logger.Info("all stream functions have returned") }() + // allow the runtime to do log/event streaming setup at build-level + streams.Go(func() error { + // If needed, the runtime should handle synchronizing with + // AssembleBuild which runs concurrently with StreamBuild. + return c.Runtime.StreamBuild(streamCtx, c.pipeline) + }) + for { select { case req := <-c.streamRequests: diff --git a/executor/local/build.go b/executor/local/build.go index c079787b..70556d9e 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -363,6 +363,13 @@ func (c *client) StreamBuild(ctx context.Context) error { fmt.Fprintln(os.Stdout, "all stream functions have returned") }() + // allow the runtime to do log/event streaming setup at build-level + streams.Go(func() error { + // If needed, the runtime should handle synchronizing with + // AssembleBuild which runs concurrently with StreamBuild. + return c.Runtime.StreamBuild(streamCtx, c.pipeline) + }) + for { select { case req := <-c.streamRequests: diff --git a/runtime/docker/build.go b/runtime/docker/build.go index 305422ba..e47145b2 100644 --- a/runtime/docker/build.go +++ b/runtime/docker/build.go @@ -26,6 +26,14 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { return nil } +// StreamBuild initializes log/event streaming for build. +// This is a no-op for docker. +func (c *client) StreamBuild(ctx context.Context, b *pipeline.Build) error { + c.Logger.Tracef("no-op: streaming build %s", b.ID) + + return nil +} + // AssembleBuild finalizes pipeline build setup. // This is a no-op for docker. func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { diff --git a/runtime/docker/build_test.go b/runtime/docker/build_test.go index 35b61dae..1b678f8e 100644 --- a/runtime/docker/build_test.go +++ b/runtime/docker/build_test.go @@ -91,6 +91,41 @@ func TestDocker_SetupBuild(t *testing.T) { } } +func TestKubernetes_StreamBuild(t *testing.T) { + tests := []struct { + name string + failure bool + pipeline *pipeline.Build + }{ + { + name: "steps", + failure: false, + pipeline: _pipeline, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + err = _engine.StreamBuild(context.Background(), test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("StreamBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("StreamBuild returned err: %v", err) + } + }) + } +} func TestDocker_AssembleBuild(t *testing.T) { // setup tests tests := []struct { diff --git a/runtime/engine.go b/runtime/engine.go index 918f55c1..6b538a4c 100644 --- a/runtime/engine.go +++ b/runtime/engine.go @@ -29,6 +29,10 @@ type Engine interface { // SetupBuild defines a function that // prepares the pipeline build. SetupBuild(context.Context, *pipeline.Build) error + // StreamBuild defines a function that initializes + // log/event streaming if the runtime needs it. + // StreamBuild and AssembleBuild run concurrently. + StreamBuild(context.Context, *pipeline.Build) error // AssembleBuild defines a function that // finalizes pipeline build setup. AssembleBuild(context.Context, *pipeline.Build) error diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index 3938cfef..ad94681f 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -7,12 +7,14 @@ package kubernetes import ( "context" "fmt" + "time" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/tools/cache" // The k8s libraries have some quirks around yaml marshaling (see opts.go). // So, just use the same library for all kubernetes-related YAML. @@ -79,6 +81,7 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { // https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1?tab=doc#ObjectMeta c.Pod.ObjectMeta = metav1.ObjectMeta{ Name: b.ID, + Namespace: c.config.Namespace, // this is used by the podTracker Labels: labels, Annotations: c.PipelinePodTemplate.Metadata.Annotations, } @@ -124,6 +127,33 @@ func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error { } } + // initialize the PodTracker now that we have a Pod for it to track + tracker, err := newPodTracker(c.Logger, c.Kubernetes, c.Pod, time.Second*30) + if err != nil { + return err + } + + c.PodTracker = tracker + + return nil +} + +// StreamBuild initializes log/event streaming for build. +func (c *client) StreamBuild(ctx context.Context, b *pipeline.Build) error { + c.Logger.Tracef("streaming build %s", b.ID) + + select { + case <-ctx.Done(): + // bail out, as build timed out or was canceled. + return nil + case <-c.PodTracker.Ready: + // AssembleBuild signaled that the PodTracker is ready. + break + } + + // Populate the PodTracker caches before creating the pipeline pod + c.PodTracker.Start(ctx) + return nil } @@ -182,6 +212,17 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { } } + // setup containerTeachers now that all containers are defined. + c.PodTracker.TrackContainers(c.Pod.Spec.Containers) + + // send signal to StreamBuild now that PodTracker is ready to be started. + close(c.PodTracker.Ready) + + // wait for the PodTracker caches to populate before creating the pipeline pod. + if ok := cache.WaitForCacheSync(ctx.Done(), c.PodTracker.PodSynced); !ok { + return fmt.Errorf("failed to wait for caches to sync") + } + // If the api call to create the pod fails, the pod might // partially exist. So, set this first to make sure all // remnants get deleted. @@ -206,6 +247,15 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { func (c *client) RemoveBuild(ctx context.Context, b *pipeline.Build) error { c.Logger.Tracef("removing build %s", b.ID) + // PodTracker gets created in SetupBuild before pod is created + defer func() { + // check for nil as RemoveBuild may get called multiple times + if c.PodTracker != nil { + c.PodTracker.Stop() + c.PodTracker = nil + } + }() + if !c.createdPod { // nothing to do return nil diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index d1d06215..50f304ea 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -376,6 +376,82 @@ func TestKubernetes_SetupBuild(t *testing.T) { } } +func TestKubernetes_StreamBuild(t *testing.T) { + tests := []struct { + name string + failure bool + doCancel bool + doReady bool + pipeline *pipeline.Build + pod *v1.Pod + }{ + { + name: "stages canceled", + failure: false, + doCancel: true, + pipeline: _stages, + pod: _stagesPod, + }, + { + name: "steps canceled", + failure: false, + doCancel: true, + pipeline: _steps, + pod: _pod, + }, + { + name: "stages ready", + failure: false, + doReady: true, + pipeline: _stages, + pod: _stagesPod, + }, + { + name: "steps ready", + failure: false, + doReady: true, + pipeline: _steps, + pod: _pod, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := NewMock(test.pod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // StreamBuild and AssembleBuild coordinate their work. + go func() { + if test.doCancel { + // simulate canceled build + cancel() + } else if test.doReady { + // simulate AssembleBuild + close(_engine.PodTracker.Ready) + } + }() + + err = _engine.StreamBuild(ctx, test.pipeline) + + if test.failure { + if err == nil { + t.Errorf("StreamBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("StreamBuild returned err: %v", err) + } + }) + } +} + func TestKubernetes_AssembleBuild(t *testing.T) { // setup tests tests := []struct { @@ -421,6 +497,10 @@ func TestKubernetes_AssembleBuild(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { _engine, err := NewMock(test.k8sPod) + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + _engine.Pod = test.enginePod _engine.containersLookup = map[string]int{} @@ -428,9 +508,14 @@ func TestKubernetes_AssembleBuild(t *testing.T) { _engine.containersLookup[ctn.Name] = i } - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } + // StreamBuild and AssembleBuild coordinate their work, so, emulate + // executor.StreamBuild which calls runtime.StreamBuild concurrently. + go func() { + err := _engine.StreamBuild(context.Background(), test.pipeline) + if err != nil { + t.Errorf("unable to start PodTracker via StreamBuild") + } + }() err = _engine.AssembleBuild(context.Background(), test.pipeline) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 430a9e8a..28e0932d 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -19,7 +19,6 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" ) @@ -28,15 +27,10 @@ import ( func (c *client) InspectContainer(ctx context.Context, ctn *pipeline.Container) error { c.Logger.Tracef("inspecting container %s", ctn.ID) - // create options for getting the container - opts := metav1.GetOptions{} - - // send API call to capture the container - // - // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface - pod, err := c.Kubernetes.CoreV1(). + // get the pod from the local cache, which the Informer keeps up-to-date + pod, err := c.PodTracker.PodLister. Pods(c.config.Namespace). - Get(ctx, c.Pod.ObjectMeta.Name, opts) + Get(c.Pod.ObjectMeta.Name) if err != nil { return err } @@ -321,74 +315,55 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io func (c *client) WaitContainer(ctx context.Context, ctn *pipeline.Container) error { c.Logger.Tracef("waiting for container %s", ctn.ID) - // create label selector for watching the pod - selector := fmt.Sprintf("pipeline=%s", fields.EscapeValue(c.Pod.ObjectMeta.Name)) - - // create options for watching the container - opts := metav1.ListOptions{ - LabelSelector: selector, - Watch: true, + // get the containerTracker for this container + tracker, ok := c.PodTracker.Containers[ctn.ID] + if !ok { + return fmt.Errorf("containerTracker is missing for %s", ctn.ID) } - // send API call to capture channel for watching the container - // - // https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1?tab=doc#PodInterface - // -> - // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface - podWatch, err := c.Kubernetes.CoreV1(). - Pods(c.config.Namespace). - Watch(ctx, opts) - if err != nil { - return err - } + // wait for the container terminated signal + <-tracker.Terminated - defer podWatch.Stop() + return nil +} - for { - // capture new result from the channel - // - // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#Interface - result := <-podWatch.ResultChan() +// inspectContainerStatuses signals when a container reaches a terminal state. +func (p *podTracker) inspectContainerStatuses(pod *v1.Pod) { + // check if the pod is in a pending state + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodStatus + if pod.Status.Phase == v1.PodPending { + p.Logger.Debugf("skipping container status inspection as pod %s is pending", p.TrackedPod) + + // nothing to inspect if pod is in a pending state + return + } - // convert the object from the result to a pod - pod, ok := result.Object.(*v1.Pod) + // iterate through each container in the pod + for _, cst := range pod.Status.ContainerStatuses { + // get the containerTracker for this container + tracker, ok := p.Containers[cst.Name] if !ok { - return fmt.Errorf("unable to watch pod %s", c.Pod.ObjectMeta.Name) - } + // unknown container (probably a sidecar injected by an admissions controller) + p.Logger.Debugf("ignoring untracked container %s from pod %s", cst.Name, p.TrackedPod) - // check if the pod is in a pending state - // - // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodStatus - if pod.Status.Phase == v1.PodPending { - // skip pod if it's in a pending state continue } - // iterate through each container in the pod - for _, cst := range pod.Status.ContainerStatuses { - // check if the container has a matching ID - // - // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerStatus - if !strings.EqualFold(cst.Name, ctn.ID) { - // skip container if it's not a matching ID - continue - } - - // check if the container is in a terminated state - // - // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerState - if cst.State.Terminated == nil { - // skip container if it's not in a terminated state - break - } + // cst.State has details about the cst.Image's exit. + // cst.LastTerminationState has details about the kubernetes/pause image's exit. + // cst.RestartCount is 1 at exit due to switch from kubernetes/pause to final image. - // check if the container has a terminated state reason - // - // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerStateTerminated - if len(cst.State.Terminated.Reason) > 0 { - // break watching the container as it's complete - return nil - } + // check if the container is in a terminated state + // + // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ContainerState + if cst.State.Terminated != nil { + tracker.terminatedOnce.Do(func() { + p.Logger.Debugf("container completed: %s in pod %s, %v", cst.Name, p.TrackedPod, cst) + + // let WaitContainer know the container is terminated + close(tracker.Terminated) + }) } } } diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index d71d3753..74369658 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -13,9 +13,8 @@ import ( "github.com/go-vela/worker/internal/image" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" ) func TestKubernetes_InspectContainer(t *testing.T) { @@ -424,33 +423,29 @@ func TestKubernetes_WaitContainer(t *testing.T) { name string failure bool container *pipeline.Container - object runtime.Object + oldPod *v1.Pod + newPod *v1.Pod }{ { name: "default order in ContainerStatuses", failure: false, container: _container, - object: _pod, + oldPod: _pod, + newPod: _pod, }, { name: "inverted order in ContainerStatuses", failure: false, container: _container, - object: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "github-octocat-1", - Namespace: "test", - Labels: map[string]string{ - "pipeline": "github-octocat-1", - }, - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: "v1", - Kind: "Pod", - }, + oldPod: _pod, + newPod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, Status: v1.PodStatus{ Phase: v1.PodRunning, ContainerStatuses: []v1.ContainerStatus{ + // alternate order { Name: "step-github-octocat-1-echo", State: v1.ContainerState{ @@ -476,25 +471,57 @@ func TestKubernetes_WaitContainer(t *testing.T) { }, }, { - name: "watch returns invalid type", + name: "container goes from running to terminated", + failure: false, + container: _container, + oldPod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + }, + }, + }, + }, + newPod: _pod, + }, + { + name: "if client.Pod.Spec is empty podTracker fails", failure: true, container: _container, - object: new(v1.PodTemplate), + oldPod: _pod, + newPod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Status: _pod.Status, + // if client.Pod.Spec is empty, podTracker will fail + //Spec: _pod.Spec, + }, }, } // run tests for _, test := range tests { t.Run(test.name, func(t *testing.T) { - // setup types - _engine, _watch, err := newMockWithWatch(_pod, "pods") + // set up the fake k8s clientset so that it returns the final/updated state + _engine, err := NewMock(test.newPod) if err != nil { t.Errorf("unable to create runtime engine: %v", err) } go func() { - // simulate adding a pod to the watcher - _watch.Add(test.object) + oldPod := test.oldPod.DeepCopy() + oldPod.SetResourceVersion("older") + + // simulate a re-sync/PodUpdate event + _engine.PodTracker.HandlePodUpdate(oldPod, _engine.Pod) }() err = _engine.WaitContainer(context.Background(), test.container) @@ -513,3 +540,123 @@ func TestKubernetes_WaitContainer(t *testing.T) { }) } } + +func Test_podTracker_inspectContainerStatuses(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + + tests := []struct { + name string + trackedPod string + ctnName string + terminated bool + pod *v1.Pod + }{ + { + name: "container is terminated", + trackedPod: "test/github-octocat-1", + ctnName: "step-github-octocat-1-clone", + terminated: true, + pod: _pod, + }, + { + name: "pod is pending", + trackedPod: "test/github-octocat-1", + ctnName: "step-github-octocat-1-clone", + terminated: false, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodPending, + }, + }, + }, + { + name: "container is running", + trackedPod: "test/github-octocat-1", + ctnName: "step-github-octocat-1-clone", + terminated: false, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + }, + }, + }, + }, + }, + { + name: "pod has an untracked container", + trackedPod: "test/github-octocat-1", + ctnName: "step-github-octocat-1-clone", + terminated: true, + pod: &v1.Pod{ + ObjectMeta: _pod.ObjectMeta, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + ContainerStatuses: []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }, + { + Name: "injected-by-admissions-controller", + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + }, + }, + }, + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ctnTracker := containerTracker{ + Name: test.ctnName, + Terminated: make(chan struct{}), + } + podTracker := podTracker{ + Logger: logger, + TrackedPod: test.trackedPod, + Containers: map[string]*containerTracker{}, + // other fields not used by inspectContainerStatuses + // if they're needed, use newPodTracker + } + podTracker.Containers[test.ctnName] = &ctnTracker + + podTracker.inspectContainerStatuses(test.pod) + + func() { + defer func() { + // nolint: errcheck // repeat close() panics (otherwise it won't) + recover() + }() + + close(ctnTracker.Terminated) + + // this will only run if close() did not panic + if test.terminated { + t.Error("inspectContainerStatuses should have signaled termination") + } + }() + }) + } +} diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index f35c4188..5532bafb 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -44,6 +44,8 @@ type client struct { Pod *v1.Pod // containersLookup maps the container name to its index in Containers containersLookup map[string]int + // PodTracker wraps the Kubernetes client to simplify watching the pod for changes + PodTracker *podTracker // PipelinePodTemplate has default values to be used in Setup* methods PipelinePodTemplate *velav1alpha1.PipelinePodTemplate // commonVolumeMounts includes workspace mount and any global host mounts (VELA_RUNTIME_VOLUMES) @@ -163,7 +165,8 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { c.config.Namespace = "test" // set the Kubernetes pod in the runtime client - c.Pod = _pod + c.Pod = _pod.DeepCopy() + c.Pod.SetResourceVersion("0") // apply all provided configuration options for _, opt := range opts { @@ -188,5 +191,15 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { }, ) + // set the PodTracker (normally populated in SetupBuild) + tracker, err := mockPodTracker(c.Logger, c.Kubernetes, c.Pod) + if err != nil { + return c, err + } + + c.PodTracker = tracker + + // The test is responsible for calling c.PodTracker.Start() if needed + return c, nil } diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 364a90b0..60e2a5ed 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -11,9 +11,6 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/fake" - testcore "k8s.io/client-go/testing" ) func TestKubernetes_New(t *testing.T) { @@ -325,39 +322,3 @@ var ( }, } ) - -// newMockWithWatch returns an Engine implementation that -// integrates with a Kubernetes runtime and a FakeWatcher -// that can be used to inject resource events into it. -func newMockWithWatch(pod *v1.Pod, watchResource string, opts ...ClientOpt) (*client, *watch.RaceFreeFakeWatcher, error) { - // setup types - _engine, err := NewMock(pod, opts...) - if err != nil { - return nil, nil, err - } - - // create a new fake kubernetes client - // - // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset - _kubernetes := fake.NewSimpleClientset(pod) - - // create a new fake watcher - // - // https://pkg.go.dev/k8s.io/apimachinery/pkg/watch?tab=doc#NewRaceFreeFake - _watch := watch.NewRaceFreeFake() - - // create a new watch reactor with the fake watcher - // - // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#DefaultWatchReactor - reactor := testcore.DefaultWatchReactor(_watch, nil) - - // add watch reactor to beginning of the client chain - // - // https://pkg.go.dev/k8s.io/client-go/testing?tab=doc#Fake.PrependWatchReactor - _kubernetes.PrependWatchReactor(watchResource, reactor) - - // overwrite the mock kubernetes client - _engine.Kubernetes = _kubernetes - - return _engine, _watch, nil -} diff --git a/runtime/kubernetes/pod_tracker.go b/runtime/kubernetes/pod_tracker.go new file mode 100644 index 00000000..221e881f --- /dev/null +++ b/runtime/kubernetes/pod_tracker.go @@ -0,0 +1,264 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/sirupsen/logrus" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/selection" + kubeinformers "k8s.io/client-go/informers" + informers "k8s.io/client-go/informers/core/v1" + "k8s.io/client-go/kubernetes" + listers "k8s.io/client-go/listers/core/v1" + "k8s.io/client-go/tools/cache" +) + +// containerTracker contains useful signals that are managed by the podTracker. +type containerTracker struct { + // Name is the name of the container + Name string + // terminatedOnce ensures that the Terminated channel only gets closed once. + terminatedOnce sync.Once + // Terminated will be closed once the container reaches a terminal state. + Terminated chan struct{} + // TODO: collect streaming logs here before TailContainer is called +} + +// podTracker contains Informers used to watch and synchronize local k8s caches. +// This is similar to a typical Kubernetes controller (eg like k8s.io/sample-controller.Controller). +type podTracker struct { + // https://pkg.go.dev/github.com/sirupsen/logrus#Entry + Logger *logrus.Entry + // TrackedPod is the Namespace/Name of the tracked pod + TrackedPod string + + // informerFactory is used to create Informers and Listers + informerFactory kubeinformers.SharedInformerFactory + // informerDone is a function used to stop the informerFactory + informerDone context.CancelFunc + // podInformer watches the given pod, caches the results, and makes them available in podLister + podInformer informers.PodInformer + + // PodLister helps list Pods. All objects returned here must be treated as read-only. + PodLister listers.PodLister + // PodSynced is a function that can be used to determine if an informer has synced. + // This is useful for determining if caches have synced. + PodSynced cache.InformerSynced + + // Containers maps the container name to a containerTracker + Containers map[string]*containerTracker + + // Ready signals when the PodTracker is done with setup and ready to Start. + Ready chan struct{} +} + +// HandlePodAdd is an AddFunc for cache.ResourceEventHandlerFuncs for Pods. +func (p *podTracker) HandlePodAdd(newObj interface{}) { + newPod := p.getTrackedPod(newObj) + if newPod == nil { + // not valid or not our tracked pod + return + } + + p.Logger.Tracef("handling pod add event for %s", p.TrackedPod) + + p.inspectContainerStatuses(newPod) +} + +// HandlePodUpdate is an UpdateFunc for cache.ResourceEventHandlerFuncs for Pods. +func (p *podTracker) HandlePodUpdate(oldObj, newObj interface{}) { + oldPod := p.getTrackedPod(oldObj) + newPod := p.getTrackedPod(newObj) + + if oldPod == nil || newPod == nil { + // not valid or not our tracked pod + return + } + // if we need to optimize and avoid the resync update events, we can do this: + //if newPod.ResourceVersion == oldPod.ResourceVersion { + // // Periodic resync will send update events for all known Pods + // // If ResourceVersion is the same we have to look harder for Status changes + // if newPod.Status.Phase == oldPod.Status.Phase && newPod.Status.Size() == oldPod.Status.Size() { + // return + // } + //} + + p.Logger.Tracef("handling pod update event for %s", p.TrackedPod) + + p.inspectContainerStatuses(newPod) +} + +// HandlePodDelete is an DeleteFunc for cache.ResourceEventHandlerFuncs for Pods. +func (p *podTracker) HandlePodDelete(oldObj interface{}) { + oldPod := p.getTrackedPod(oldObj) + if oldPod == nil { + // not valid or not our tracked pod + return + } + + p.Logger.Tracef("handling pod delete event for %s", p.TrackedPod) + + p.inspectContainerStatuses(oldPod) +} + +// getTrackedPod tries to convert the obj into a Pod and makes sure it is the tracked Pod. +// This should only be used by the funcs of cache.ResourceEventHandlerFuncs. +func (p *podTracker) getTrackedPod(obj interface{}) *v1.Pod { + var ( + pod *v1.Pod + ok bool + ) + + if pod, ok = obj.(*v1.Pod); !ok { + tombstone, ok := obj.(cache.DeletedFinalStateUnknown) + if !ok { + p.Logger.Errorf("error decoding pod, invalid type") + return nil + } + + pod, ok = tombstone.Obj.(*v1.Pod) + if !ok { + p.Logger.Errorf("error decoding pod tombstone, invalid type") + return nil + } + } + + trackedPod := pod.GetNamespace() + "/" + pod.GetName() + if trackedPod != p.TrackedPod { + p.Logger.Errorf("error got unexpected pod: %s", trackedPod) + return nil + } + + return pod +} + +// Start kicks off the API calls to start populating the cache. +// There is no need to run this in a separate goroutine (ie go podTracker.Start(ctx)). +func (p *podTracker) Start(ctx context.Context) { + p.Logger.Tracef("starting PodTracker for pod %s", p.TrackedPod) + + informerCtx, done := context.WithCancel(ctx) + p.informerDone = done + + // Start method is non-blocking and runs all registered informers in a dedicated goroutine. + p.informerFactory.Start(informerCtx.Done()) +} + +// Stop shuts down any informers (e.g. stop watching APIs). +func (p *podTracker) Stop() { + p.Logger.Tracef("stopping PodTracker for pod %s", p.TrackedPod) + + if p.informerDone != nil { + p.informerDone() + } +} + +// TrackContainers creates a containerTracker for each container. +func (p *podTracker) TrackContainers(containers []v1.Container) { + p.Logger.Tracef("tracking %d more containers for pod %s", len(containers), p.TrackedPod) + + if p.Containers == nil { + p.Containers = map[string]*containerTracker{} + } + + for _, ctn := range containers { + p.Containers[ctn.Name] = &containerTracker{ + Name: ctn.Name, + Terminated: make(chan struct{}), + } + } +} + +// newPodTracker initializes a podTracker with a given clientset for a given pod. +func newPodTracker(log *logrus.Entry, clientset kubernetes.Interface, pod *v1.Pod, defaultResync time.Duration) (*podTracker, error) { + if pod == nil { + return nil, fmt.Errorf("newPodTracker expected a pod, got nil") + } + + trackedPod := pod.ObjectMeta.Namespace + "/" + pod.ObjectMeta.Name + if pod.ObjectMeta.Name == "" || pod.ObjectMeta.Namespace == "" { + return nil, fmt.Errorf("newPodTracker expects pod to have Name and Namespace, got %s", trackedPod) + } + + log.Tracef("creating PodTracker for pod %s", trackedPod) + + // create label selector for watching the pod + selector, err := labels.NewRequirement( + "pipeline", + selection.Equals, + []string{fields.EscapeValue(pod.ObjectMeta.Name)}, + ) + if err != nil { + return nil, err + } + + // create filtered Informer factory which is commonly used for k8s controllers + informerFactory := kubeinformers.NewSharedInformerFactoryWithOptions( + clientset, + defaultResync, + kubeinformers.WithNamespace(pod.ObjectMeta.Namespace), + kubeinformers.WithTweakListOptions(func(listOptions *metav1.ListOptions) { + listOptions.LabelSelector = selector.String() + }), + ) + podInformer := informerFactory.Core().V1().Pods() + + // initialize podTracker + tracker := podTracker{ + Logger: log, + TrackedPod: trackedPod, + informerFactory: informerFactory, + podInformer: podInformer, + PodLister: podInformer.Lister(), + PodSynced: podInformer.Informer().HasSynced, + Ready: make(chan struct{}), + } + + // register event handler funcs in podInformer + podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: tracker.HandlePodAdd, + UpdateFunc: tracker.HandlePodUpdate, + DeleteFunc: tracker.HandlePodDelete, + }) + + return &tracker, nil +} + +// mockPodTracker returns a new podTracker with the given pod pre-loaded in the cache. +func mockPodTracker(log *logrus.Entry, clientset kubernetes.Interface, pod *v1.Pod) (*podTracker, error) { + // Make sure test pods are valid before passing to PodTracker (ie support &v1.Pod{}). + if pod.ObjectMeta.Name == "" { + pod.ObjectMeta.Name = "test-pod" + } + + if pod.ObjectMeta.Namespace == "" { + pod.ObjectMeta.Namespace = "test" + } + + tracker, err := newPodTracker(log, clientset, pod, 0*time.Second) + if err != nil { + return nil, err + } + + // init containerTrackers as well + tracker.TrackContainers(pod.Spec.Containers) + + // pre-populate the podInformer cache + err = tracker.podInformer.Informer().GetIndexer().Add(pod) + if err != nil { + return nil, err + } + + return tracker, err +} diff --git a/runtime/kubernetes/pod_tracker_test.go b/runtime/kubernetes/pod_tracker_test.go new file mode 100644 index 00000000..79b84621 --- /dev/null +++ b/runtime/kubernetes/pod_tracker_test.go @@ -0,0 +1,379 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "context" + "reflect" + "testing" + "time" + + "github.com/sirupsen/logrus" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/fake" + "k8s.io/client-go/tools/cache" +) + +func TestNewPodTracker(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + clientset := fake.NewSimpleClientset() + + tests := []struct { + name string + pod *v1.Pod + wantErr bool + }{ + { + name: "pass-with-pod", + pod: _pod, + wantErr: false, + }, + { + name: "error-with-nil-pod", + pod: nil, + wantErr: true, + }, + { + name: "error-with-empty-pod", + pod: &v1.Pod{}, + wantErr: true, + }, + { + name: "error-with-pod-without-namespace", + pod: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod"}, + }, + wantErr: true, + }, + { + name: "fail-with-pod", + pod: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "github-octocat-1-for-some-odd-reason-this-name-is-way-too-long-and-will-cause-an-error", + Namespace: _pod.ObjectMeta.Namespace, + Labels: _pod.ObjectMeta.Labels, + }, + TypeMeta: _pod.TypeMeta, + Spec: _pod.Spec, + Status: _pod.Status, + }, + wantErr: true, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _, err := newPodTracker(logger, clientset, test.pod, 0*time.Second) + if (err != nil) != test.wantErr { + t.Errorf("newPodTracker() error = %v, wantErr %v", err, test.wantErr) + return + } + }) + } +} + +func Test_podTracker_getTrackedPod(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + + tests := []struct { + name string + trackedPod string // namespace/podName + obj interface{} + want *v1.Pod + }{ + { + name: "got-tracked-pod", + trackedPod: "test/github-octocat-1", + obj: _pod, + want: _pod, + }, + { + name: "wrong-pod", + trackedPod: "test/github-octocat-2", + obj: _pod, + want: nil, + }, + { + name: "invalid-type", + trackedPod: "test/github-octocat-1", + obj: new(v1.PodTemplate), + want: nil, + }, + { + name: "nil", + trackedPod: "test/nil", + obj: nil, + want: nil, + }, + { + name: "tombstone-pod", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: _pod, + }, + want: _pod, + }, + { + name: "tombstone-nil", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: nil, + }, + want: nil, + }, + { + name: "tombstone-invalid-type", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: new(v1.PodTemplate), + }, + want: nil, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + p := podTracker{ + Logger: logger, + TrackedPod: test.trackedPod, + // other fields not used by getTrackedPod + // if they're needed, use newPodTracker + } + if got := p.getTrackedPod(test.obj); !reflect.DeepEqual(got, test.want) { + t.Errorf("getTrackedPod() = %v, want %v", got, test.want) + } + }) + } +} + +func Test_podTracker_HandlePodAdd(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + + tests := []struct { + name string + trackedPod string // namespace/podName + obj interface{} + }{ + { + name: "got-tracked-pod", + trackedPod: "test/github-octocat-1", + obj: _pod, + }, + { + name: "wrong-pod", + trackedPod: "test/github-octocat-2", + obj: _pod, + }, + { + name: "invalid-type", + trackedPod: "test/github-octocat-1", + obj: new(v1.PodTemplate), + }, + { + name: "nil", + trackedPod: "test/nil", + obj: nil, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + p := &podTracker{ + Logger: logger, + TrackedPod: test.trackedPod, + // other fields not used by getTrackedPod + // if they're needed, use newPodTracker + } + + // just make sure this doesn't panic + p.HandlePodAdd(test.obj) + }) + } +} + +func Test_podTracker_HandlePodUpdate(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + + tests := []struct { + name string + trackedPod string // namespace/podName + oldObj interface{} + newObj interface{} + }{ + { + name: "re-sync event without change", + trackedPod: "test/github-octocat-1", + oldObj: _pod, + newObj: _pod, + }, + { + name: "wrong-pod", + trackedPod: "test/github-octocat-2", + oldObj: _pod, + newObj: _pod, + }, + { + name: "invalid-type-old", + trackedPod: "test/github-octocat-1", + oldObj: new(v1.PodTemplate), + newObj: _pod, + }, + { + name: "nil-old", + trackedPod: "test/github-octocat-1", + oldObj: nil, + newObj: _pod, + }, + { + name: "invalid-type-new", + trackedPod: "test/github-octocat-1", + oldObj: _pod, + newObj: new(v1.PodTemplate), + }, + { + name: "nil-new", + trackedPod: "test/github-octocat-1", + oldObj: _pod, + newObj: nil, + }, + { + name: "invalid-type-both", + trackedPod: "test/github-octocat-1", + oldObj: new(v1.PodTemplate), + newObj: new(v1.PodTemplate), + }, + { + name: "nil-both", + trackedPod: "test/nil", + oldObj: nil, + newObj: nil, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + p := &podTracker{ + Logger: logger, + TrackedPod: test.trackedPod, + // other fields not used by getTrackedPod + // if they're needed, use newPodTracker + } + + // just make sure this doesn't panic + p.HandlePodUpdate(test.oldObj, test.newObj) + }) + } +} + +func Test_podTracker_HandlePodDelete(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + + tests := []struct { + name string + trackedPod string // namespace/podName + obj interface{} + }{ + { + name: "got-tracked-pod", + trackedPod: "test/github-octocat-1", + obj: _pod, + }, + { + name: "wrong-pod", + trackedPod: "test/github-octocat-2", + obj: _pod, + }, + { + name: "invalid-type", + trackedPod: "test/github-octocat-1", + obj: new(v1.PodTemplate), + }, + { + name: "nil", + trackedPod: "test/nil", + obj: nil, + }, + { + name: "tombstone-pod", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: _pod, + }, + }, + { + name: "tombstone-nil", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: nil, + }, + }, + { + name: "tombstone-invalid-type", + trackedPod: "test/github-octocat-1", + obj: cache.DeletedFinalStateUnknown{ + Key: "test/github-octocat-1", + Obj: new(v1.PodTemplate), + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + p := &podTracker{ + Logger: logger, + TrackedPod: test.trackedPod, + // other fields not used by getTrackedPod + // if they're needed, use newPodTracker + } + + // just make sure this doesn't panic + p.HandlePodDelete(test.obj) + }) + } +} + +func Test_podTracker_Stop(t *testing.T) { + // setup types + logger := logrus.NewEntry(logrus.StandardLogger()) + clientset := fake.NewSimpleClientset() + + tests := []struct { + name string + pod *v1.Pod + started bool + }{ + { + name: "started", + pod: _pod, + started: true, + }, + { + name: "not started", + pod: _pod, + started: false, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + tracker, err := newPodTracker(logger, clientset, test.pod, 0*time.Second) + if err != nil { + t.Errorf("newPodTracker() error = %v", err) + return + } + + if test.started { + tracker.Start(context.Background()) + } + tracker.Stop() + }) + } +} diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go index 8cf7cd2d..a786d193 100644 --- a/runtime/kubernetes/volume.go +++ b/runtime/kubernetes/volume.go @@ -122,6 +122,7 @@ func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { // // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodSpec c.Pod.Spec.Volumes = []v1.Volume{} + c.commonVolumeMounts = []v1.VolumeMount{} return nil } From 9d3dfbdc7c860fbcf5c077028eae024114f15df5 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 3 May 2022 07:52:08 -0500 Subject: [PATCH 291/430] fix(executor): tests from compiler changes (#332) --- executor/linux/build_test.go | 18 ++++++++----- executor/linux/secret_test.go | 6 ++++- executor/linux/stage_test.go | 3 ++- executor/local/build_test.go | 18 ++++++++----- executor/local/stage_test.go | 3 ++- go.mod | 16 ++++++------ go.sum | 49 +++++++++++++++++++++++++---------- 7 files changed, 77 insertions(+), 36 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index a591b7d4..5422a951 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -90,7 +90,8 @@ func TestLinux_CreateBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). @@ -182,7 +183,8 @@ func TestLinux_PlanBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). @@ -323,7 +325,8 @@ func TestLinux_AssembleBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). @@ -435,7 +438,8 @@ func TestLinux_ExecBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). @@ -695,7 +699,8 @@ func TestLinux_StreamBuild(t *testing.T) { streamRequests := make(chan message.StreamRequest) - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). @@ -834,7 +839,8 @@ func TestLinux_DestroyBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index b0643661..ccd1c69d 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -292,12 +292,16 @@ func TestLinux_Secret_exec(t *testing.T) { t.Run(test.name, func(t *testing.T) { file, _ := ioutil.ReadFile(test.pipeline) - p, _ := compiler. + p, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithUser(_user). WithMetadata(_metadata). Compile(file) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } _engine, err := New( WithBuild(_build), diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 42eeff12..2beeba80 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -36,7 +36,8 @@ func TestLinux_CreateStage(t *testing.T) { compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithMetadata(_metadata). diff --git a/executor/local/build_test.go b/executor/local/build_test.go index 35a2ada1..ac5ba4f3 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -56,7 +56,8 @@ func TestLocal_CreateBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). @@ -132,7 +133,8 @@ func TestLocal_PlanBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). @@ -247,7 +249,8 @@ func TestLocal_AssembleBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). @@ -348,7 +351,8 @@ func TestLocal_ExecBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). @@ -541,7 +545,8 @@ func TestLocal_StreamBuild(t *testing.T) { streamRequests := make(chan message.StreamRequest) - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). @@ -659,7 +664,8 @@ func TestLocal_DestroyBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index 2aa5f887..fa680351 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -30,7 +30,8 @@ func TestLocal_CreateStage(t *testing.T) { compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) - _pipeline, err := compiler. + _pipeline, _, err := compiler. + Duplicate(). WithBuild(_build). WithRepo(_repo). WithLocal(true). diff --git a/go.mod b/go.mod index a4cf5b46..ac54c68c 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 github.com/go-vela/sdk-go v0.13.1 - github.com/go-vela/server v0.13.1 - github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281 + github.com/go-vela/server v0.14.0-rc1 + github.com/go-vela/types v0.14.0-rc1 github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -50,11 +50,11 @@ require ( github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect - github.com/go-redis/redis/v8 v8.11.4 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-github/v42 v42.0.0 // indirect + github.com/google/go-github/v44 v44.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -63,7 +63,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.0 // indirect + github.com/hashicorp/go-retryablehttp v0.7.1 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.11 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -83,7 +83,7 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/afero v1.8.1 // indirect + github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.1.11 // indirect @@ -91,7 +91,7 @@ require ( go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect + golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index bd8bece5..52f83333 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.43.10/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.4/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -196,26 +197,28 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.13.1 h1:qjilbDwJSYg+fdm6KcsP5/SVlcSVuR5am6tM238Oxos= github.com/go-vela/sdk-go v0.13.1/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= -github.com/go-vela/server v0.13.1 h1:5Ht9uqRtIzhf8kusM1Y5WzIwFIY1BW1aBFx+lWUPXmQ= -github.com/go-vela/server v0.13.1/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= +github.com/go-vela/server v0.14.0-rc1 h1:V/7RL4FZ9Dd/mC0Ox0Ucx8Mk/Sko1hAWILvJWWZ+eBE= +github.com/go-vela/server v0.14.0-rc1/go.mod h1:/wFifmrBPEqTm+NOb2l23LaFRgbk09UlhAvqxbpvf1k= github.com/go-vela/types v0.13.0/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= -github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281 h1:2QYp82wFAUZQ/3gL5GKaCmIJn9iU8playVu6SdVUwB4= -github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281/go.mod h1:LDI9YXINK8Zz0DvvruJLFLoJyxaxetXme1pZAXvQkhU= +github.com/go-vela/types v0.14.0-rc1 h1:zckr7Cywbw97IfYu/F/e1yscIW72HL0VhhNtp1NV5kQ= +github.com/go-vela/types v0.14.0-rc1/go.mod h1:g2C+XdTuq2hzrsEUt+jVLLqmhgogoXryQEok3EK3HkE= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.0 h1:EmVIxB5jzbllGIjiCV5JG4VylbK3KE400tLGLI1cdfU= github.com/golang-jwt/jwt/v4 v4.4.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -269,8 +272,9 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= +github.com/google/go-github/v44 v44.0.0 h1:1Lfk2mhM7pTWqwGC6Ft16S3c2LBw8DLcw9TOhYoQ9zE= +github.com/google/go-github/v44 v44.0.0/go.mod h1:CqZYQRxOcb81M+ufZB7duWNS0lFfas/r7cEAKpLBYww= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -292,6 +296,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -331,8 +336,9 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= +github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= @@ -349,6 +355,7 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/vault/api v1.4.1/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= +github.com/hashicorp/vault/api v1.5.0/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= github.com/hashicorp/vault/sdk v0.4.1/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -370,6 +377,7 @@ github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfG github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.12.0/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= @@ -383,25 +391,30 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1: github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.14.1/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= +github.com/jackc/pgx/v4 v4.16.0/go.mod h1:N0A9sFdWzkw/Jy1lwoiB64F2+ugFZi987zRxcPez/wI= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -458,6 +471,7 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -501,13 +515,17 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -569,8 +587,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.8.1 h1:izYHOT71f9iZ7iq37Uqjael60/vYC6vMtzedudZ0zEk= github.com/spf13/afero v1.8.1/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -745,8 +764,8 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1056,8 +1075,12 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= +gorm.io/driver/postgres v1.3.5/go.mod h1:EGCWefLFQSVFrHGy4J8EtiHCWX5Q8t0yz2Jt9aKkGzU= gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= +gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= From 0d8cb2faae46fe22cd97c42f67beb6a6232b1860 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Tue, 3 May 2022 09:34:48 -0500 Subject: [PATCH 292/430] chore(release): dependency updates for v0.14.0-rc1 (#333) --- go.mod | 2 +- go.sum | 34 ++-------------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index ac54c68c..23eb18df 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.7.7 - github.com/go-vela/sdk-go v0.13.1 + github.com/go-vela/sdk-go v0.14.0-rc2 github.com/go-vela/server v0.14.0-rc1 github.com/go-vela/types v0.14.0-rc1 github.com/google/go-cmp v0.5.8 diff --git a/go.sum b/go.sum index 52f83333..ce7b370f 100644 --- a/go.sum +++ b/go.sum @@ -78,7 +78,6 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.19.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/alicebob/miniredis/v2 v2.20.0 h1:NJSfJcoyPvs9t+wqnox5BTcNVn7J9KxYl0RioTcE8S4= github.com/alicebob/miniredis/v2 v2.20.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -86,7 +85,6 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.43.10/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.4/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -94,7 +92,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bradleyfalzon/ghinstallation/v2 v2.0.3/go.mod h1:tlgi+JWCXnKFx/Y4WtnDbZEINo31N5bcvnCoqieefmk= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= @@ -197,26 +194,21 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.13.1 h1:qjilbDwJSYg+fdm6KcsP5/SVlcSVuR5am6tM238Oxos= -github.com/go-vela/sdk-go v0.13.1/go.mod h1:nhfjNURKBw9tumFIaCaRko1z0Tlf2Z0NLFkjVseHjBo= -github.com/go-vela/server v0.13.0/go.mod h1:mxoUplM5cTM6qi9FbtmubGTsTXTlh3tchHYD8TwF6OU= +github.com/go-vela/sdk-go v0.14.0-rc2 h1:809omJ1XX573S3ebNQj3AO2C68HNETWi13lBIEwL8hE= +github.com/go-vela/sdk-go v0.14.0-rc2/go.mod h1:eSlRP4kaI9hwXpwrZnG2WD0kwTaYt6gtfsmhsuhRQ9M= github.com/go-vela/server v0.14.0-rc1 h1:V/7RL4FZ9Dd/mC0Ox0Ucx8Mk/Sko1hAWILvJWWZ+eBE= github.com/go-vela/server v0.14.0-rc1/go.mod h1:/wFifmrBPEqTm+NOb2l23LaFRgbk09UlhAvqxbpvf1k= -github.com/go-vela/types v0.13.0/go.mod h1:n2aGQj5hzLFUvl1LnxyzItaPKSgC7jSiuSq+6XkRly8= github.com/go-vela/types v0.14.0-rc1 h1:zckr7Cywbw97IfYu/F/e1yscIW72HL0VhhNtp1NV5kQ= github.com/go-vela/types v0.14.0-rc1/go.mod h1:g2C+XdTuq2hzrsEUt+jVLLqmhgogoXryQEok3EK3HkE= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -267,12 +259,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= github.com/google/go-github/v44 v44.0.0 h1:1Lfk2mhM7pTWqwGC6Ft16S3c2LBw8DLcw9TOhYoQ9zE= github.com/google/go-github/v44 v44.0.0/go.mod h1:CqZYQRxOcb81M+ufZB7duWNS0lFfas/r7cEAKpLBYww= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -336,7 +325,6 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -354,7 +342,6 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.4.1/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= github.com/hashicorp/vault/api v1.5.0/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= github.com/hashicorp/vault/sdk v0.4.1/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -376,7 +363,6 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.12.0/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= @@ -390,25 +376,21 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.14.1/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= github.com/jackc/pgx/v4 v4.16.0/go.mod h1:N0A9sFdWzkw/Jy1lwoiB64F2+ugFZi987zRxcPez/wI= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= @@ -452,7 +434,6 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -470,7 +451,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -522,7 +502,6 @@ github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= @@ -587,7 +566,6 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.8.1/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= @@ -613,7 +591,6 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= github.com/urfave/cli/v2 v2.5.1 h1:YKwdkyA0xTBzOaP2G0DVxBnCheHGP+Y9VbKAs4K1Ess= github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -623,7 +600,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= @@ -635,7 +611,6 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20220302181546-5411bad688d1/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -763,7 +738,6 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1074,11 +1048,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.3.1/go.mod h1:WwvWOuR9unCLpGWCL6Y3JOeBWvbKi6JLhayiVclSZZU= gorm.io/driver/postgres v1.3.5/go.mod h1:EGCWefLFQSVFrHGy4J8EtiHCWX5Q8t0yz2Jt9aKkGzU= -gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg= gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= -gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= @@ -1093,7 +1064,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= -k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= From f7fcedd542e715f78874e13fdc71a5c80f100b3a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 12:10:28 -0500 Subject: [PATCH 293/430] fix(deps): update kubernetes packages to v0.24.0 (#334) Co-authored-by: Renovate Bot --- go.mod | 29 ++++++++++++++++++----------- go.sum | 54 ++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 23eb18df..43109c78 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.5.1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.2.0 - k8s.io/api v0.23.6 - k8s.io/apimachinery v0.23.6 - k8s.io/client-go v0.23.6 + k8s.io/api v0.24.0 + k8s.io/apimachinery v0.24.0 + k8s.io/client-go v0.24.0 sigs.k8s.io/yaml v1.3.0 ) @@ -43,10 +43,14 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/drone/envsubst v1.0.3 // indirect + github.com/emicklei/go-restful v2.9.5+incompatible // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.2.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/swag v0.19.14 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect @@ -54,11 +58,11 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v44 v44.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect github.com/goware/urlx v0.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -66,8 +70,10 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.1 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.11 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/leodido/go-urn v1.2.0 // indirect + github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect @@ -76,6 +82,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -89,13 +96,13 @@ require ( github.com/ugorji/go/codec v1.1.11 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect - golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect + golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect google.golang.org/grpc v1.41.0 // indirect @@ -103,9 +110,9 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + k8s.io/klog/v2 v2.60.1 // indirect + k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect + k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect + sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect ) diff --git a/go.sum b/go.sum index ce7b370f..887081a9 100644 --- a/go.sum +++ b/go.sum @@ -84,6 +84,7 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.44.4/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= @@ -139,6 +140,8 @@ github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -183,9 +186,14 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -248,6 +256,8 @@ github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -294,7 +304,6 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= @@ -401,6 +410,8 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -437,6 +448,8 @@ github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -482,6 +495,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= @@ -641,8 +656,9 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa h1:idItI2DDfCokpg0N51B2VtiLdJ4vAuXC9fnCb2gACo4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -722,6 +738,7 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -737,7 +754,7 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -820,11 +837,11 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/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 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -842,8 +859,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1062,27 +1079,32 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= -k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= -k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= +k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= +k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= -k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= +k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= +k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= +k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= +k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= From 798dac1bcd08618934cd182c47d0a0697f5bffb7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 08:48:52 -0500 Subject: [PATCH 294/430] fix(deps): update module github.com/urfave/cli/v2 to v2.6.0 (#335) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 43109c78..470aa0f6 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.5.1 + github.com/urfave/cli/v2 v2.6.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c gotest.tools/v3 v3.2.0 k8s.io/api v0.24.0 diff --git a/go.sum b/go.sum index 887081a9..476acb2c 100644 --- a/go.sum +++ b/go.sum @@ -606,8 +606,9 @@ github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= -github.com/urfave/cli/v2 v2.5.1 h1:YKwdkyA0xTBzOaP2G0DVxBnCheHGP+Y9VbKAs4K1Ess= github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= +github.com/urfave/cli/v2 v2.6.0 h1:yj2Drkflh8X/zUrkWlWlUjZYHyWN7WMmpVxyxXIUyv8= +github.com/urfave/cli/v2 v2.6.0/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= 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= From b7499401bfea13ebb73e84a98f649dda4b454b34 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 11 May 2022 08:50:13 -0500 Subject: [PATCH 295/430] bugfix(k8s): Drop TailContainer's logsContext to avoid early cancel (#337) --- executor/linux/build.go | 1 + executor/local/build.go | 2 +- runtime/kubernetes/container.go | 11 ++++------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index c31e2938..d59d5700 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -536,6 +536,7 @@ func (c *client) StreamBuild(ctx context.Context) error { return nil }) case <-ctx.Done(): + c.Logger.Debug("streaming context canceled") // build done or canceled return nil } diff --git a/executor/local/build.go b/executor/local/build.go index 70556d9e..233c1c49 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -374,7 +374,7 @@ func (c *client) StreamBuild(ctx context.Context) error { select { case req := <-c.streamRequests: streams.Go(func() error { - fmt.Fprintf(os.Stdout, "streaming %s container %s", req.Key, req.Container.ID) + fmt.Fprintf(os.Stdout, "[%s: %s] > Streaming container '%s'...\n", req.Key, req.Container.Name, req.Container.ID) err := req.Stream(streamCtx, req.Container) if err != nil { diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 28e0932d..ab6914c1 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -232,10 +232,6 @@ func (c *client) setupContainerEnvironment(ctn *pipeline.Container) error { func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io.ReadCloser, error) { c.Logger.Tracef("tailing output for container %s", ctn.ID) - // create a logsContext that will be canceled at the end of this - logsContext, logsDone := context.WithCancel(ctx) - defer logsDone() - // create object to store container logs var logs io.ReadCloser @@ -259,9 +255,9 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io stream, err := c.Kubernetes.CoreV1(). Pods(c.config.Namespace). GetLogs(c.Pod.ObjectMeta.Name, opts). - Stream(logsContext) + Stream(ctx) if err != nil { - c.Logger.Errorf("%v", err) + c.Logger.Errorf("error while requesting pod/logs stream for container %s: %v", ctn.ID, err) return false, nil } @@ -303,8 +299,9 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // perform the function to capture logs with periodic backoff // // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#ExponentialBackoff - err := wait.ExponentialBackoffWithContext(logsContext, backoff, logsFunc) + err := wait.ExponentialBackoffWithContext(ctx, backoff, logsFunc) if err != nil { + c.Logger.Errorf("exponential backoff error while tailing container %s: %v", ctn.ID, err) return nil, err } From c2c2cc7987dafe7c63712b4c3c8b85ccc6777092 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 13:24:19 -0500 Subject: [PATCH 296/430] fix(deps): update module github.com/prometheus/client_golang to v1.12.2 (#341) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 470aa0f6..f16c8fae 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.6.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c diff --git a/go.sum b/go.sum index 476acb2c..4b77e058 100644 --- a/go.sum +++ b/go.sum @@ -540,8 +540,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= From 73d81c5d6d33af58cc7dac94820319f8b349f71a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 13:30:46 -0500 Subject: [PATCH 297/430] fix(deps): update golang.org/x/sync digest to 0976fa6 (#342) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index f16c8fae..e3cbf919 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.6.0 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 gotest.tools/v3 v3.2.0 k8s.io/api v0.24.0 k8s.io/apimachinery v0.24.0 diff --git a/go.sum b/go.sum index 4b77e058..84e8ef59 100644 --- a/go.sum +++ b/go.sum @@ -769,8 +769,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 158d8c69b18ac2dfdf2337098c828a29b945cf00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 May 2022 13:43:01 -0500 Subject: [PATCH 298/430] fix(deps): update module github.com/urfave/cli/v2 to v2.8.1 (#343) --- go.mod | 3 ++- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e3cbf919..19870bc1 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 - github.com/urfave/cli/v2 v2.6.0 + github.com/urfave/cli/v2 v2.8.1 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 gotest.tools/v3 v3.2.0 k8s.io/api v0.24.0 @@ -94,6 +94,7 @@ require ( github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.1.11 // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect diff --git a/go.sum b/go.sum index 84e8ef59..3a52bc46 100644 --- a/go.sum +++ b/go.sum @@ -608,8 +608,10 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= -github.com/urfave/cli/v2 v2.6.0 h1:yj2Drkflh8X/zUrkWlWlUjZYHyWN7WMmpVxyxXIUyv8= -github.com/urfave/cli/v2 v2.6.0/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= +github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= +github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= 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= From 85572a7ef56ac7460780d082fee896060f371041 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 May 2022 14:46:22 -0500 Subject: [PATCH 299/430] fix(deps): update deps (patch) to v0.24.1 (#344) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 19870bc1..a3370c5f 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.8.1 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 gotest.tools/v3 v3.2.0 - k8s.io/api v0.24.0 - k8s.io/apimachinery v0.24.0 - k8s.io/client-go v0.24.0 + k8s.io/api v0.24.1 + k8s.io/apimachinery v0.24.1 + k8s.io/client-go v0.24.1 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 3a52bc46..1aa4e983 100644 --- a/go.sum +++ b/go.sum @@ -1084,13 +1084,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= -k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= +k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= +k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= -k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= -k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= +k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= +k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= +k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From ddc4aabe0ccb32c4bd63f7301fb4f0dfaf162817 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 27 May 2022 16:07:15 -0500 Subject: [PATCH 300/430] test: add API mock for Vela Worker (#338) --- mock/worker/build.go | 86 +++++++++++++++++++++++++++++++++++++++++ mock/worker/doc.go | 10 +++++ mock/worker/executor.go | 63 ++++++++++++++++++++++++++++++ mock/worker/pipeline.go | 60 ++++++++++++++++++++++++++++ mock/worker/repo.go | 62 +++++++++++++++++++++++++++++ mock/worker/server.go | 35 +++++++++++++++++ 6 files changed, 316 insertions(+) create mode 100644 mock/worker/build.go create mode 100644 mock/worker/doc.go create mode 100644 mock/worker/executor.go create mode 100644 mock/worker/pipeline.go create mode 100644 mock/worker/repo.go create mode 100644 mock/worker/server.go diff --git a/mock/worker/build.go b/mock/worker/build.go new file mode 100644 index 00000000..d8e05fc9 --- /dev/null +++ b/mock/worker/build.go @@ -0,0 +1,86 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" +) + +const ( + // BuildResp represents a JSON return for a single build. + BuildResp = `{ + "id": 1, + "repo_id": 1, + "number": 1, + "parent": 1, + "event": "push", + "status": "created", + "error": "", + "enqueued": 1563474077, + "created": 1563474076, + "started": 1563474077, + "finished": 0, + "deploy": "", + "clone": "https://github.com/github/octocat.git", + "source": "https://github.com/github/octocat/commit/48afb5bdc41ad69bf22588491333f7cf71135163", + "title": "push received from https://github.com/github/octocat", + "message": "First commit...", + "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", + "sender": "OctoKitty", + "author": "OctoKitty", + "email": "octokitty@github.com", + "link": "https://vela.example.company.com/github/octocat/1", + "branch": "master", + "ref": "refs/heads/master", + "base_ref": "", + "host": "example.company.com", + "runtime": "docker", + "distribution": "linux" +}` +) + +// getBuild has a param :build returns mock JSON for a http GET. +func getBuild(c *gin.Context) { + b := c.Param("build") + + if strings.EqualFold(b, "0") { + msg := fmt.Sprintf("Build %s does not exist", b) + + c.AbortWithStatusJSON(http.StatusNotFound, types.Error{Message: &msg}) + + return + } + + data := []byte(BuildResp) + + var body library.Build + _ = json.Unmarshal(data, &body) + + c.JSON(http.StatusOK, body) +} + +// cancelBuild has a param :build returns mock JSON for a http DELETE. +// +// Pass "0" to :build to test receiving a http 404 response. +func cancelBuild(c *gin.Context) { + b := c.Param("build") + + if strings.EqualFold(b, "0") { + msg := fmt.Sprintf("Build %s does not exist", b) + + c.AbortWithStatusJSON(http.StatusNotFound, types.Error{Message: &msg}) + + return + } + + c.JSON(http.StatusOK, BuildResp) +} diff --git a/mock/worker/doc.go b/mock/worker/doc.go new file mode 100644 index 00000000..281bb581 --- /dev/null +++ b/mock/worker/doc.go @@ -0,0 +1,10 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package worker provides a mock for using the Worker API. +// +// Usage: +// +// import "github.com/go-vela/worker/mock/worker" +package worker diff --git a/mock/worker/executor.go b/mock/worker/executor.go new file mode 100644 index 00000000..f9af3c47 --- /dev/null +++ b/mock/worker/executor.go @@ -0,0 +1,63 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" +) + +const ( + // ExecutorResp represents a JSON return for a single worker. + ExecutorResp = ` + { + "id": 1, + "host": "worker_1", + "runtime": "docker", + "distribution": "linux", + "build": ` + BuildResp + `, + "pipeline": ` + PipelineResp + `, + "repo": ` + RepoResp + ` + }` + + // ExecutorsResp represents a JSON return for one to many workers. + ExecutorsResp = `[ ` + ExecutorResp + `,` + ExecutorResp + `]` +) + +// getExecutors returns mock JSON for a http GET. +func getExecutors(c *gin.Context) { + data := []byte(ExecutorsResp) + + var body []library.Executor + _ = json.Unmarshal(data, &body) + + c.JSON(http.StatusOK, body) +} + +// getExecutor has a param :executor returns mock JSON for a http GET. +func getExecutor(c *gin.Context) { + w := c.Param("executor") + + if strings.EqualFold(w, "0") { + msg := fmt.Sprintf("Executor %s does not exist", w) + + c.AbortWithStatusJSON(http.StatusNotFound, types.Error{Message: &msg}) + + return + } + + data := []byte(ExecutorResp) + + var body library.Executor + _ = json.Unmarshal(data, &body) + + c.JSON(http.StatusOK, body) +} diff --git a/mock/worker/pipeline.go b/mock/worker/pipeline.go new file mode 100644 index 00000000..9184615d --- /dev/null +++ b/mock/worker/pipeline.go @@ -0,0 +1,60 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/go-vela/types/library" + + "github.com/gin-gonic/gin" + "github.com/go-vela/types" +) + +const ( + // PipelineResp represents a JSON return for a single pipeline. + PipelineResp = `{ + "id": 1, + "repo_id": 1, + "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", + "flavor": "", + "platform": "", + "ref": "refs/heads/master", + "type": "yaml", + "version": "1", + "external_secrets": false, + "internal_secrets": false, + "services": false, + "stages": false, + "steps": true, + "templates": false, + "data": "LS0tCnZlcnNpb246ICIxIgoKc3RlcHM6CiAgLSBuYW1lOiBlY2hvCiAgICBpbWFnZTogYWxwaW5lOmxhdGVzdAogICAgY29tbWFuZHM6IFtlY2hvIGZvb10=" +}` +) + +// getPipeline has a param :pipeline returns mock YAML for a http GET. +// +// Pass "0" to :pipeline to test receiving a http 404 response. +func getPipeline(c *gin.Context) { + p := c.Param("pipeline") + + if strings.EqualFold(p, "0") { + msg := fmt.Sprintf("Pipeline %s does not exist", p) + + c.AbortWithStatusJSON(http.StatusNotFound, types.Error{Message: &msg}) + + return + } + + data := []byte(PipelineResp) + + var body library.Pipeline + _ = json.Unmarshal(data, &body) + + c.JSON(http.StatusOK, body) +} diff --git a/mock/worker/repo.go b/mock/worker/repo.go new file mode 100644 index 00000000..da6d1d47 --- /dev/null +++ b/mock/worker/repo.go @@ -0,0 +1,62 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" +) + +const ( + // RepoResp represents a JSON return for a single repo. + RepoResp = `{ + "id": 1, + "user_id": 1, + "org": "github", + "name": "octocat", + "full_name": "github/octocat", + "link": "https://github.com/github/octocat", + "clone": "https://github.com/github/octocat", + "branch": "master", + "build_limit": 10, + "timeout": 60, + "visibility": "public", + "private": false, + "trusted": true, + "active": true, + "allow_pr": false, + "allow_push": true, + "allow_deploy": false, + "allow_tag": false +}` +) + +// getRepo has a param :repo returns mock JSON for a http GET. +// +// Pass "not-found" to :repo to test receiving a http 404 response. +func getRepo(c *gin.Context) { + r := c.Param("repo") + + if strings.Contains(r, "not-found") { + msg := fmt.Sprintf("Repo %s does not exist", r) + + c.AbortWithStatusJSON(http.StatusNotFound, types.Error{Message: &msg}) + + return + } + + data := []byte(RepoResp) + + var body library.Repo + _ = json.Unmarshal(data, &body) + + c.JSON(http.StatusOK, body) +} diff --git a/mock/worker/server.go b/mock/worker/server.go new file mode 100644 index 00000000..a3a687b6 --- /dev/null +++ b/mock/worker/server.go @@ -0,0 +1,35 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// FakeHandler returns an http.Handler that is capable of handling +// Vela API requests and returning mock responses. +func FakeHandler() http.Handler { + gin.SetMode(gin.TestMode) + + e := gin.New() + + // mock endpoints for executor calls + e.GET("/api/v1/executors", getExecutors) + e.GET("/api/v1/executors/:executor", getExecutor) + + // mock endpoints for build calls + e.GET("/api/v1/executors/:executor/build", getBuild) + e.DELETE("/api/v1/executors/:executor/build/cancel", cancelBuild) + + // mock endpoints for pipeline calls + e.GET("/api/v1/executors/:executor/pipeline", getPipeline) + + // mock endpoints for repo calls + e.GET("/api/v1/executors/:executor/repo", getRepo) + + return e +} From d0ed541003672a8a6cc707273e16c0a1cd614e56 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 11:08:03 -0500 Subject: [PATCH 301/430] fix(deps): update module github.com/gin-gonic/gin to v1.8.0 (#345) --- go.mod | 18 ++++++++++-------- go.sum | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index a3370c5f..21e855ae 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 - github.com/gin-gonic/gin v1.7.7 + github.com/gin-gonic/gin v1.8.0 github.com/go-vela/sdk-go v0.14.0-rc2 github.com/go-vela/server v0.14.0-rc1 github.com/go-vela/types v0.14.0-rc1 @@ -51,10 +51,11 @@ require ( github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/swag v0.19.14 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -72,9 +73,9 @@ require ( github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/leodido/go-urn v1.2.0 // indirect + github.com/leodido/go-urn v1.2.1 // indirect github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect @@ -84,6 +85,7 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect @@ -93,7 +95,7 @@ require ( github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/ugorji/go/codec v1.1.11 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect @@ -107,7 +109,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect google.golang.org/grpc v1.41.0 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 1aa4e983..a7d6bb2a 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= +github.com/gin-gonic/gin v1.8.0 h1:4WFH5yycBMA3za5Hnl425yd9ymdw1XPm4666oab+hv4= +github.com/gin-gonic/gin v1.8.0/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -196,12 +197,15 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -213,6 +217,8 @@ github.com/go-vela/server v0.14.0-rc1 h1:V/7RL4FZ9Dd/mC0Ox0Ucx8Mk/Sko1hAWILvJWWZ github.com/go-vela/server v0.14.0-rc1/go.mod h1:/wFifmrBPEqTm+NOb2l23LaFRgbk09UlhAvqxbpvf1k= github.com/go-vela/types v0.14.0-rc1 h1:zckr7Cywbw97IfYu/F/e1yscIW72HL0VhhNtp1NV5kQ= github.com/go-vela/types v0.14.0-rc1/go.mod h1:g2C+XdTuq2hzrsEUt+jVLLqmhgogoXryQEok3EK3HkE= +github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -433,14 +439,16 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -462,8 +470,9 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -500,7 +509,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -525,8 +533,11 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -564,6 +575,8 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -598,15 +611,18 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV 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/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.1.11 h1:O5AKWOf+CnfWi6L1WtdBtZpA+YNjoQd2YfbtkowsMrs= github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.1.11 h1:GaQDxjNe1J3vCZvlVaDjUIHIbFuUByFXY7rMqnhB5ck= github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= @@ -840,6 +856,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/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= @@ -1038,14 +1055,16 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= From f05edee9c3c36825a73157c94f1642ea60b0afca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jun 2022 09:42:09 -0500 Subject: [PATCH 302/430] fix(deps): update golang.org/x/sync digest to 0de741c (#346) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 21e855ae..2262f124 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.8.1 - golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 + golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f gotest.tools/v3 v3.2.0 k8s.io/api v0.24.1 k8s.io/apimachinery v0.24.1 diff --git a/go.sum b/go.sum index a7d6bb2a..c214a5f8 100644 --- a/go.sum +++ b/go.sum @@ -788,8 +788,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 196e4db367940f1a35ae9ceb4e55e44affcaafc8 Mon Sep 17 00:00:00 2001 From: JayCeeJr <1265665+JayCeeJr@users.noreply.github.com> Date: Thu, 2 Jun 2022 11:20:09 -0500 Subject: [PATCH 303/430] add tag to ruleset for deployment event, if it is from a tag #606 (#347) --- internal/step/skip.go | 5 +++++ internal/step/skip_test.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/internal/step/skip.go b/internal/step/skip.go index 40867f54..2daef324 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -47,6 +47,11 @@ func Skip(c *pipeline.Container, b *library.Build, r *library.Repo) bool { // check if the build event is deployment if strings.EqualFold(b.GetEvent(), constants.EventDeploy) { + // handle when deployment event is for a tag + if strings.HasPrefix(b.GetRef(), "refs/tags/") { + // add tag information to ruledata with refs/tags prefix removed + ruledata.Tag = strings.TrimPrefix(b.GetRef(), "refs/tags/") + } // add deployment target information to ruledata ruledata.Target = b.GetDeploy() } diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index d5efe4c4..829bbd5c 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -98,6 +98,34 @@ func TestStep_Skip(t *testing.T) { Distribution: vela.String("linux"), } + _deployFromTag := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("deployment"), + EventAction: vela.String(""), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/tags/v1.0.0"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + _tag := &library.Build{ ID: vela.Int64(1), Number: vela.Int(1), @@ -183,6 +211,13 @@ func TestStep_Skip(t *testing.T) { repo: _repo, want: false, }, + { + name: "deployFromTag", + build: _deployFromTag, + container: _container, + repo: _repo, + want: false, + }, { name: "tag", build: _tag, From 7e87b90d42b593c69f69bc5eb36b069bc421b0fa Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 3 Jun 2022 16:04:11 +0000 Subject: [PATCH 304/430] chore(release): v0.14.0-rc2 (#348) --- go.mod | 12 +++++------ go.sum | 63 ++++++++++++++++++++-------------------------------------- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/go.mod b/go.mod index 2262f124..c8c901d7 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.8.0 - github.com/go-vela/sdk-go v0.14.0-rc2 - github.com/go-vela/server v0.14.0-rc1 - github.com/go-vela/types v0.14.0-rc1 + github.com/go-vela/sdk-go v0.14.0-rc3 + github.com/go-vela/server v0.14.0-rc2 + github.com/go-vela/types v0.14.0-rc2 github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.20.0 // indirect + github.com/alicebob/miniredis/v2 v2.21.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -60,7 +60,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-github/v44 v44.0.0 // indirect + github.com/google/go-github/v44 v44.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -101,7 +101,7 @@ require ( go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect + golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index c214a5f8..a70a9bb1 100644 --- a/go.sum +++ b/go.sum @@ -78,15 +78,15 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.20.0 h1:NJSfJcoyPvs9t+wqnox5BTcNVn7J9KxYl0RioTcE8S4= -github.com/alicebob/miniredis/v2 v2.20.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= +github.com/alicebob/miniredis/v2 v2.21.0 h1:CdmwIlKUWFBDS+4464GtQiQ0R1vpzOgu4Vnd74rBL7M= +github.com/alicebob/miniredis/v2 v2.21.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.4/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.25/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -168,7 +168,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gin-gonic/gin v1.8.0 h1:4WFH5yycBMA3za5Hnl425yd9ymdw1XPm4666oab+hv4= github.com/gin-gonic/gin v1.8.0/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -197,13 +196,10 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= @@ -211,12 +207,12 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.14.0-rc2 h1:809omJ1XX573S3ebNQj3AO2C68HNETWi13lBIEwL8hE= -github.com/go-vela/sdk-go v0.14.0-rc2/go.mod h1:eSlRP4kaI9hwXpwrZnG2WD0kwTaYt6gtfsmhsuhRQ9M= -github.com/go-vela/server v0.14.0-rc1 h1:V/7RL4FZ9Dd/mC0Ox0Ucx8Mk/Sko1hAWILvJWWZ+eBE= -github.com/go-vela/server v0.14.0-rc1/go.mod h1:/wFifmrBPEqTm+NOb2l23LaFRgbk09UlhAvqxbpvf1k= -github.com/go-vela/types v0.14.0-rc1 h1:zckr7Cywbw97IfYu/F/e1yscIW72HL0VhhNtp1NV5kQ= -github.com/go-vela/types v0.14.0-rc1/go.mod h1:g2C+XdTuq2hzrsEUt+jVLLqmhgogoXryQEok3EK3HkE= +github.com/go-vela/sdk-go v0.14.0-rc3 h1:Jdhk6JoIuGTO3hO1i51bWWenOmpqPsnVqXgi6YjoHPo= +github.com/go-vela/sdk-go v0.14.0-rc3/go.mod h1:yEcjATqNZZzHV9G0CGaOBVxi84jDRvY7u33L4agxbUM= +github.com/go-vela/server v0.14.0-rc2 h1:fRdvgrYywJz4nKu8Go4rtUzdPxr8GB0e2Cpy8BkNMJk= +github.com/go-vela/server v0.14.0-rc2/go.mod h1:tlZtJy5gUWTVeWWpfbXNyk+3SEEhpEvPL7ArPrgvPaI= +github.com/go-vela/types v0.14.0-rc2 h1:LrThnunJJHAyPyL8gc8CNxquIKQ8AjtVntSD0JHdRzY= +github.com/go-vela/types v0.14.0-rc2/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -275,11 +271,10 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v44 v44.0.0 h1:1Lfk2mhM7pTWqwGC6Ft16S3c2LBw8DLcw9TOhYoQ9zE= -github.com/google/go-github/v44 v44.0.0/go.mod h1:CqZYQRxOcb81M+ufZB7duWNS0lFfas/r7cEAKpLBYww= +github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= +github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -309,8 +304,6 @@ 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/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= @@ -346,8 +339,10 @@ github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR3 github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.5/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -357,8 +352,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.5.0/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= -github.com/hashicorp/vault/sdk v0.4.1/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= +github.com/hashicorp/vault/api v1.6.0/go.mod h1:h1K70EO2DgnBaTz5IsL6D5ERsNt5Pce93ueVS2+t0Xc= +github.com/hashicorp/vault/sdk v0.5.0/go.mod h1:UJZHlfwj7qUJG8g22CuxUgkdJouFrBNvBHCyx8XAPdo= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -378,7 +373,7 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.12.0/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= +github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= @@ -402,7 +397,7 @@ github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08 github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.16.0/go.mod h1:N0A9sFdWzkw/Jy1lwoiB64F2+ugFZi987zRxcPez/wI= +github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -446,14 +441,13 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -487,7 +481,7 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -551,7 +545,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -615,15 +608,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.1.11/go.mod h1:kbRrdMyHY64ADdazOwkrQP9btxt35Z26OJueD3Tq0/4= github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.1.11/go.mod h1:svMFxxx5FVQJPnJ9vbpAgscNufuiXDyldvzApI86qQo= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= @@ -759,7 +747,6 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -775,8 +762,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -857,7 +844,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/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-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= @@ -1089,7 +1075,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.3.5/go.mod h1:EGCWefLFQSVFrHGy4J8EtiHCWX5Q8t0yz2Jt9aKkGzU= +gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= @@ -1105,7 +1091,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= -k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= @@ -1113,20 +1098,16 @@ k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From 8245b4386e954de358884847c1f21dcee1e63c51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Jun 2022 09:21:15 -0500 Subject: [PATCH 305/430] fix(deps): update module github.com/gin-gonic/gin to v1.8.1 (#349) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c8c901d7..cbd7c108 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 - github.com/gin-gonic/gin v1.8.0 + github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.14.0-rc3 github.com/go-vela/server v0.14.0-rc2 github.com/go-vela/types v0.14.0-rc2 diff --git a/go.sum b/go.sum index a70a9bb1..cbf715f0 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,9 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.0 h1:4WFH5yycBMA3za5Hnl425yd9ymdw1XPm4666oab+hv4= github.com/gin-gonic/gin v1.8.0/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 06706498c2278e4a051eb609c531348ef14fd816 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:15:57 -0500 Subject: [PATCH 306/430] chore(release): v0.14.0-rc3 (#350) --- go.mod | 6 +++--- go.sum | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index cbd7c108..4d887456 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.14.0-rc3 - github.com/go-vela/server v0.14.0-rc2 - github.com/go-vela/types v0.14.0-rc2 + github.com/go-vela/sdk-go v0.14.0-rc4 + github.com/go-vela/server v0.14.0-rc3 + github.com/go-vela/types v0.14.0-rc3 github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index cbf715f0..dd652336 100644 --- a/go.sum +++ b/go.sum @@ -86,7 +86,7 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.25/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.30/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -168,7 +168,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.0/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -208,12 +207,12 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.14.0-rc3 h1:Jdhk6JoIuGTO3hO1i51bWWenOmpqPsnVqXgi6YjoHPo= -github.com/go-vela/sdk-go v0.14.0-rc3/go.mod h1:yEcjATqNZZzHV9G0CGaOBVxi84jDRvY7u33L4agxbUM= -github.com/go-vela/server v0.14.0-rc2 h1:fRdvgrYywJz4nKu8Go4rtUzdPxr8GB0e2Cpy8BkNMJk= -github.com/go-vela/server v0.14.0-rc2/go.mod h1:tlZtJy5gUWTVeWWpfbXNyk+3SEEhpEvPL7ArPrgvPaI= -github.com/go-vela/types v0.14.0-rc2 h1:LrThnunJJHAyPyL8gc8CNxquIKQ8AjtVntSD0JHdRzY= -github.com/go-vela/types v0.14.0-rc2/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= +github.com/go-vela/sdk-go v0.14.0-rc4 h1:CQFjMbm5nB04AKb90f5dHYU8wU9CoDQV5bcA+qyCGbc= +github.com/go-vela/sdk-go v0.14.0-rc4/go.mod h1:yTwNQPpzzuFmsTBRgC9z0lcyydjY0DZk9XKPn3jWb8c= +github.com/go-vela/server v0.14.0-rc3 h1:n6HPMXYQktMHZszyG1ymHB+MlXbOS6ayZgXOAhzsXu0= +github.com/go-vela/server v0.14.0-rc3/go.mod h1:I5oK2THbQTCbkCGcGdO2GlqMmfuff8qOL5MPA/jWXGo= +github.com/go-vela/types v0.14.0-rc3 h1:qvVgyOB/YjR/DEZE++ZYb/yQ2AhbtDuKY/i8SI7ORto= +github.com/go-vela/types v0.14.0-rc3/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -340,7 +339,7 @@ github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR3 github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.5/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= @@ -353,8 +352,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.6.0/go.mod h1:h1K70EO2DgnBaTz5IsL6D5ERsNt5Pce93ueVS2+t0Xc= -github.com/hashicorp/vault/sdk v0.5.0/go.mod h1:UJZHlfwj7qUJG8g22CuxUgkdJouFrBNvBHCyx8XAPdo= +github.com/hashicorp/vault/api v1.7.2/go.mod h1:xbfA+1AvxFseDzxxdWaL0uO99n1+tndus4GCrtouy0M= +github.com/hashicorp/vault/sdk v0.5.1/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -1077,7 +1076,7 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= -gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= +gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= From e6c596e05a85a5bdadc62c50d48632cb375f0a45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 09:50:00 -0500 Subject: [PATCH 307/430] fix(deps): update module gotest.tools/v3 to v3.3.0 (#352) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4d887456..a71bdc85 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli/v2 v2.8.1 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f - gotest.tools/v3 v3.2.0 + gotest.tools/v3 v3.3.0 k8s.io/api v0.24.1 k8s.io/apimachinery v0.24.1 k8s.io/client-go v0.24.1 diff --git a/go.sum b/go.sum index dd652336..b2512a60 100644 --- a/go.sum +++ b/go.sum @@ -1080,8 +1080,8 @@ gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM1 gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= -gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 8a71216d4d3f888a594ca84e6f82211cbec5ac03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:06:53 -0500 Subject: [PATCH 308/430] fix(deps): update deps (patch) to v0.24.2 (#351) --- go.mod | 6 +++--- go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index a71bdc85..eedf3ede 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.8.1 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f gotest.tools/v3 v3.3.0 - k8s.io/api v0.24.1 - k8s.io/apimachinery v0.24.1 - k8s.io/client-go v0.24.1 + k8s.io/api v0.24.2 + k8s.io/apimachinery v0.24.2 + k8s.io/client-go v0.24.2 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index b2512a60..663aa741 100644 --- a/go.sum +++ b/go.sum @@ -1089,12 +1089,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= -k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= -k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= +k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= +k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= -k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= +k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= +k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= +k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From d057703d1ae5be8982ae22bbb959e7d4ab9daf3d Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 22 Jun 2022 11:30:34 -0500 Subject: [PATCH 309/430] chore(release): dependency updates for v0.14.0 (#353) --- go.mod | 6 +++--- go.sum | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index eedf3ede..cebd0aeb 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.10+incompatible github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.14.0-rc4 - github.com/go-vela/server v0.14.0-rc3 - github.com/go-vela/types v0.14.0-rc3 + github.com/go-vela/sdk-go v0.14.0 + github.com/go-vela/server v0.14.0 + github.com/go-vela/types v0.14.0 github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 663aa741..fe210750 100644 --- a/go.sum +++ b/go.sum @@ -86,7 +86,7 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.30/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.38/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -207,12 +207,12 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-vela/sdk-go v0.14.0-rc4 h1:CQFjMbm5nB04AKb90f5dHYU8wU9CoDQV5bcA+qyCGbc= -github.com/go-vela/sdk-go v0.14.0-rc4/go.mod h1:yTwNQPpzzuFmsTBRgC9z0lcyydjY0DZk9XKPn3jWb8c= -github.com/go-vela/server v0.14.0-rc3 h1:n6HPMXYQktMHZszyG1ymHB+MlXbOS6ayZgXOAhzsXu0= -github.com/go-vela/server v0.14.0-rc3/go.mod h1:I5oK2THbQTCbkCGcGdO2GlqMmfuff8qOL5MPA/jWXGo= -github.com/go-vela/types v0.14.0-rc3 h1:qvVgyOB/YjR/DEZE++ZYb/yQ2AhbtDuKY/i8SI7ORto= -github.com/go-vela/types v0.14.0-rc3/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= +github.com/go-vela/sdk-go v0.14.0 h1:JWQnGNsnlEiWh77cTY+YSgvKUGxliE0oWWQYAKysF6s= +github.com/go-vela/sdk-go v0.14.0/go.mod h1:xrl/pF9k6Xzu+fchm7SrJJPdqgVCTLQBdB+L/lyCfjg= +github.com/go-vela/server v0.14.0 h1:G0Ble5hZ904DFPWYN6Nl9m73hZT6hw+41+eq/n1o0NQ= +github.com/go-vela/server v0.14.0/go.mod h1:XcC8Pque6rY01U2XsCv3TSSQNaNFp+tk0B3s0KhyAZw= +github.com/go-vela/types v0.14.0 h1:m75BdRfQm9PC4l/oHSgeplt8mqgau3JmqD3DN+KdePk= +github.com/go-vela/types v0.14.0/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1078,7 +1078,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= @@ -1091,7 +1091,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= -k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= From 5c899c810b013f9b65028f457d6180aa0caaeded Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 14 Jul 2022 18:32:28 -0500 Subject: [PATCH 310/430] enhance(local executor): print to stdout via client field (#339) --- cmd/vela-worker/exec.go | 1 + cmd/vela-worker/worker.go | 1 + executor/local/api.go | 3 +-- executor/local/build.go | 43 ++++++++++++++++++------------------- executor/local/local.go | 19 ++++++++++++++++ executor/local/opts.go | 23 ++++++++++++++++++++ executor/local/opts_test.go | 36 +++++++++++++++++++++++++++++++ executor/local/service.go | 3 +-- executor/local/stage.go | 7 +++--- executor/local/step.go | 3 +-- executor/setup.go | 4 ++++ 11 files changed, 111 insertions(+), 32 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 62aa1198..c5093f3f 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -69,6 +69,7 @@ func (w *Worker) exec(index int) error { // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ Logger: logger, + Mock: w.Config.Mock, Driver: w.Config.Executor.Driver, LogMethod: w.Config.Executor.LogMethod, MaxLogSize: w.Config.Executor.MaxLogSize, diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 02eb4ff1..32c1ce14 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -46,6 +46,7 @@ type ( // Config represents the worker configuration. Config struct { + Mock bool // Mock should only be true for tests API *API Build *Build CheckIn time.Duration diff --git a/executor/local/api.go b/executor/local/api.go index 2be695a5..3f67a5de 100644 --- a/executor/local/api.go +++ b/executor/local/api.go @@ -7,7 +7,6 @@ package local import ( "context" "fmt" - "os" "time" "github.com/go-vela/types/constants" @@ -193,7 +192,7 @@ func (c *client) CancelBuild() (*library.Build, error) { err = c.DestroyBuild(context.Background()) if err != nil { - fmt.Fprintln(os.Stdout, "unable to destroy build:", err) + fmt.Fprintln(c.stdout, "unable to destroy build:", err) } return b, nil diff --git a/executor/local/build.go b/executor/local/build.go index 233c1c49..8c1f0168 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -7,7 +7,6 @@ package local import ( "context" "fmt" - "os" "sync" "time" @@ -97,7 +96,7 @@ func (c *client) PlanBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Inspecting runtime network...") + fmt.Fprintln(c.stdout, _pattern, "> Inspecting runtime network...") // inspect the runtime network for the pipeline network, err := c.Runtime.InspectNetwork(ctx, c.pipeline) @@ -107,7 +106,7 @@ func (c *client) PlanBuild(ctx context.Context) error { } // output the network information to stdout - fmt.Fprintln(os.Stdout, _pattern, string(network)) + fmt.Fprintln(c.stdout, _pattern, string(network)) // create the runtime volume for the pipeline err = c.Runtime.CreateVolume(ctx, c.pipeline) @@ -117,7 +116,7 @@ func (c *client) PlanBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Inspecting runtime volume...") + fmt.Fprintln(c.stdout, _pattern, "> Inspecting runtime volume...") // inspect the runtime volume for the pipeline volume, err := c.Runtime.InspectVolume(ctx, c.pipeline) @@ -127,7 +126,7 @@ func (c *client) PlanBuild(ctx context.Context) error { } // output the volume information to stdout - fmt.Fprintln(os.Stdout, _pattern, string(volume)) + fmt.Fprintln(c.stdout, _pattern, string(volume)) return c.err } @@ -162,7 +161,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Preparing service images...") + fmt.Fprintln(c.stdout, _pattern, "> Preparing service images...") // create the services for the pipeline for _, _service := range c.pipeline.Services { @@ -183,11 +182,11 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output the image information to stdout - fmt.Fprintln(os.Stdout, _pattern, string(image)) + fmt.Fprintln(c.stdout, _pattern, string(image)) } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Preparing stage images...") + fmt.Fprintln(c.stdout, _pattern, "> Preparing stage images...") // create the stages for the pipeline for _, _stage := range c.pipeline.Stages { @@ -206,7 +205,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Preparing step images...") + fmt.Fprintln(c.stdout, _pattern, "> Preparing step images...") // create the steps for the pipeline for _, _step := range c.pipeline.Steps { @@ -229,11 +228,11 @@ func (c *client) AssembleBuild(ctx context.Context) error { } // output the image information to stdout - fmt.Fprintln(os.Stdout, _pattern, string(image)) + fmt.Fprintln(c.stdout, _pattern, string(image)) } // output a new line for readability to stdout - fmt.Fprintln(os.Stdout, "") + fmt.Fprintln(c.stdout, "") // assemble runtime build just before any containers execute c.err = c.Runtime.AssembleBuild(ctx, c.pipeline) @@ -353,14 +352,14 @@ func (c *client) StreamBuild(ctx context.Context) error { streams, streamCtx := errgroup.WithContext(ctx) defer func() { - fmt.Fprintln(os.Stdout, "waiting for stream functions to return") + fmt.Fprintln(c.stdout, "waiting for stream functions to return") err := streams.Wait() if err != nil { - fmt.Fprintln(os.Stdout, "error in a stream request:", err) + fmt.Fprintln(c.stdout, "error in a stream request:", err) } - fmt.Fprintln(os.Stdout, "all stream functions have returned") + fmt.Fprintln(c.stdout, "all stream functions have returned") }() // allow the runtime to do log/event streaming setup at build-level @@ -374,11 +373,11 @@ func (c *client) StreamBuild(ctx context.Context) error { select { case req := <-c.streamRequests: streams.Go(func() error { - fmt.Fprintf(os.Stdout, "[%s: %s] > Streaming container '%s'...\n", req.Key, req.Container.Name, req.Container.ID) + fmt.Fprintf(c.stdout, "[%s: %s] > Streaming container '%s'...\n", req.Key, req.Container.Name, req.Container.ID) err := req.Stream(streamCtx, req.Container) if err != nil { - fmt.Fprintln(os.Stdout, "error streaming:", err) + fmt.Fprintln(c.stdout, "error streaming:", err) } return nil @@ -399,7 +398,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { err = c.Runtime.RemoveBuild(ctx, c.pipeline) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy runtime build:", err) + fmt.Fprintln(c.stdout, "unable to destroy runtime build:", err) } }() @@ -414,7 +413,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { err = c.DestroyStep(ctx, _step) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy step:", err) + fmt.Fprintln(c.stdout, "unable to destroy step:", err) } } @@ -429,7 +428,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { err = c.DestroyStage(ctx, _stage) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy stage:", err) + fmt.Fprintln(c.stdout, "unable to destroy stage:", err) } } @@ -439,7 +438,7 @@ func (c *client) DestroyBuild(ctx context.Context) error { err = c.DestroyService(ctx, _service) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy service:", err) + fmt.Fprintln(c.stdout, "unable to destroy service:", err) } } @@ -447,14 +446,14 @@ func (c *client) DestroyBuild(ctx context.Context) error { err = c.Runtime.RemoveVolume(ctx, c.pipeline) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy runtime volume:", err) + fmt.Fprintln(c.stdout, "unable to destroy runtime volume:", err) } // remove the runtime network for the pipeline err = c.Runtime.RemoveNetwork(ctx, c.pipeline) if err != nil { // output the error information to stdout - fmt.Fprintln(os.Stdout, "unable to destroy runtime network:", err) + fmt.Fprintln(c.stdout, "unable to destroy runtime network:", err) } return err diff --git a/executor/local/local.go b/executor/local/local.go index 5fb45c3e..c974d9e7 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -5,6 +5,7 @@ package local import ( + "os" "reflect" "sync" @@ -33,9 +34,24 @@ type ( user *library.User err error streamRequests chan message.StreamRequest + + // internal field partially exported for tests + stdout *os.File + mockStdoutReader *os.File + } + + // MockedClient is for internal use to facilitate testing the local executor. + MockedClient interface { + MockStdout() *os.File } ) +// MockStdout is for internal use to facilitate testing the local executor. +// MockStdout returns a reader over a mocked Stdout. +func (c *client) MockStdout() *os.File { + return c.mockStdoutReader +} + // equal returns true if the other client is the equivalent. func Equal(a, b *client) bool { // handle any nil comparisons @@ -64,6 +80,9 @@ func New(opts ...Opt) (*client, error) { // create new local client c := new(client) + // Add stdout by default + c.stdout = os.Stdout + // instantiate streamRequests channel (which may be overridden using withStreamRequests()). c.streamRequests = make(chan message.StreamRequest) diff --git a/executor/local/opts.go b/executor/local/opts.go index d4b0ba55..78ff1513 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -6,6 +6,7 @@ package local import ( "fmt" + "os" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" @@ -121,6 +122,28 @@ func WithVersion(version string) Opt { } } +// WithMockStdout adds a mock stdout writer to the client if mock is true. +// If mock is true, then you must use a goroutine to read from +// MockStdout as quickly as possible, or writing to stdout will hang. +func WithMockStdout(mock bool) Opt { + return func(c *client) error { + if !mock { + return nil + } + + // New() sets c.stdout = os.stdout, replace it if a mock is required. + reader, writer, err := os.Pipe() + if err != nil { + return err + } + + c.mockStdoutReader = reader + c.stdout = writer + + return nil + } +} + // withStreamRequests sets the streamRequests channel in the executor client for Linux // (primarily used for tests). func withStreamRequests(s chan message.StreamRequest) Opt { diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index f8fd1dc6..ad98be49 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -331,3 +331,39 @@ func TestLocal_Opt_WithVersion(t *testing.T) { }) } } + +func TestLocal_Opt_WithMockStdout(t *testing.T) { + // setup tests + tests := []struct { + name string + mock bool + wantNil bool + }{ + { + name: "standard", + mock: false, + wantNil: true, + }, + { + name: "mocked", + mock: true, + wantNil: false, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithMockStdout(test.mock), + ) + if err != nil { + t.Errorf("unable to create local engine: %v", err) + } + + if !reflect.DeepEqual(_engine.MockStdout() == nil, test.wantNil) { + t.Errorf("WithMockStdout is %v, wantNil = %v", _engine.MockStdout() == nil, test.wantNil) + } + }) + } +} diff --git a/executor/local/service.go b/executor/local/service.go index eba3ee96..cf465039 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -8,7 +8,6 @@ import ( "bufio" "context" "fmt" - "os" "time" "github.com/go-vela/worker/internal/message" @@ -125,7 +124,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // scan entire container output for scanner.Scan() { // ensure we output to stdout - fmt.Fprintln(os.Stdout, _pattern, scanner.Text()) + fmt.Fprintln(c.stdout, _pattern, scanner.Text()) } return scanner.Err() diff --git a/executor/local/stage.go b/executor/local/stage.go index 668580d1..7aabae3d 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -7,7 +7,6 @@ package local import ( "context" "fmt" - "os" "sync" "github.com/go-vela/types/pipeline" @@ -23,7 +22,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { _pattern := fmt.Sprintf(stagePattern, c.init.Name, c.init.Name) // output init progress to stdout - fmt.Fprintln(os.Stdout, _pattern, "> Preparing step images for stage", s.Name, "...") + fmt.Fprintln(c.stdout, _pattern, "> Preparing step images for stage", s.Name, "...") // create the steps for the stage for _, _step := range s.Steps { @@ -43,7 +42,7 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { } // output the image information to stdout - fmt.Fprintln(os.Stdout, _pattern, string(image)) + fmt.Fprintln(c.stdout, _pattern, string(image)) } return nil @@ -121,7 +120,7 @@ func (c *client) DestroyStage(ctx context.Context, s *pipeline.Stage) error { // destroy the step err = c.DestroyStep(ctx, _step) if err != nil { - fmt.Fprintln(os.Stdout, "unable to destroy step: ", err) + fmt.Fprintln(c.stdout, "unable to destroy step: ", err) } } diff --git a/executor/local/step.go b/executor/local/step.go index 27c6bcac..6a195f4b 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -8,7 +8,6 @@ import ( "bufio" "context" "fmt" - "os" "time" "github.com/go-vela/types/constants" @@ -164,7 +163,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // scan entire container output for scanner.Scan() { // ensure we output to stdout - fmt.Fprintln(os.Stdout, _pattern, scanner.Text()) + fmt.Fprintln(c.stdout, _pattern, scanner.Text()) } return scanner.Err() diff --git a/executor/setup.go b/executor/setup.go index ba1dc615..3044aa37 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -31,6 +31,9 @@ type Setup struct { // Executor Configuration + // Mock should only be true for tests. + Mock bool + // specifies the executor driver to use Driver string // specifies the executor method used to publish logs @@ -106,6 +109,7 @@ func (s *Setup) Local() (Engine, error) { local.WithUser(s.User), local.WithVelaClient(s.Client), local.WithVersion(s.Version), + local.WithMockStdout(s.Mock), ) } From ba5ae5218d5a712c4116ff710f466f37c9773f4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Jul 2022 15:22:08 -0500 Subject: [PATCH 311/430] fix(deps): update module github.com/sirupsen/logrus to v1.9.0 (#356) --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index cebd0aeb..e6d0e6a1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.2 - github.com/sirupsen/logrus v1.8.1 + github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.8.1 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f gotest.tools/v3 v3.3.0 @@ -102,7 +102,7 @@ require ( golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect + golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index fe210750..79eb30c9 100644 --- a/go.sum +++ b/go.sum @@ -585,8 +585,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= @@ -846,8 +847,9 @@ 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-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-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= From 71686403f7e0526fb0d19b4747bea059ae03c7a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Jul 2022 15:45:52 -0500 Subject: [PATCH 312/430] fix(deps): update module github.com/urfave/cli/v2 to v2.11.1 (#354) --- go.mod | 6 +++--- go.sum | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index e6d0e6a1..509a9ff1 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.8.1 + github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f gotest.tools/v3 v3.3.0 k8s.io/api v0.24.2 @@ -38,7 +38,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/containerd/containerd v1.4.13 // indirect github.com/coreos/go-semver v0.3.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect @@ -112,7 +112,7 @@ require ( google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.60.1 // indirect k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect diff --git a/go.sum b/go.sum index 79eb30c9..cf05d390 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,9 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -613,8 +614,9 @@ github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= +github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE= +github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1075,8 +1077,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= From 06cc5f62953250b10b5633585c54d69c5abe4d89 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Aug 2022 13:17:45 -0500 Subject: [PATCH 313/430] fix(deps): update golang.org/x/sync digest to 886fb93 (#358) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 509a9ff1..10e7f6cf 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.11.1 - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 gotest.tools/v3 v3.3.0 k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 diff --git a/go.sum b/go.sum index cf05d390..07c8a12e 100644 --- a/go.sum +++ b/go.sum @@ -778,8 +778,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 0dba60516fe0d34efc34bdb079b19811ea01622b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 09:37:28 -0500 Subject: [PATCH 314/430] fix(deps): update module github.com/prometheus/client_golang to v1.13.0 (#362) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 10e7f6cf..cb39ea61 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 @@ -88,8 +88,8 @@ require ( github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/afero v1.8.2 // indirect @@ -100,7 +100,7 @@ require ( github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect @@ -109,7 +109,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect google.golang.org/grpc v1.41.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 07c8a12e..66562ca1 100644 --- a/go.sum +++ b/go.sum @@ -178,10 +178,12 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= @@ -546,8 +548,10 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -557,15 +561,17 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= 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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -750,8 +756,9 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -765,6 +772,7 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -778,6 +786,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -850,6 +859,7 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1046,8 +1056,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From a7dc4c40af2e92df1ef576a9269dcf49488e939e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:40:39 -0500 Subject: [PATCH 315/430] fix(deps): update deps (patch) to v0.14.3 (#355) --- go.mod | 10 +++++----- go.sum | 17 ++++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index cb39ea61..85e45a8d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-units v0.4.0 github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.14.0 - github.com/go-vela/server v0.14.0 + github.com/go-vela/server v0.14.3 github.com/go-vela/types v0.14.0 github.com/google/go-cmp v0.5.8 github.com/joho/godotenv v1.4.0 @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 gotest.tools/v3 v3.3.0 - k8s.io/api v0.24.2 - k8s.io/apimachinery v0.24.2 - k8s.io/client-go v0.24.2 + k8s.io/api v0.24.3 + k8s.io/apimachinery v0.24.3 + k8s.io/client-go v0.24.3 sigs.k8s.io/yaml v1.3.0 ) @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.21.0 // indirect + github.com/alicebob/miniredis/v2 v2.22.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect diff --git a/go.sum b/go.sum index 66562ca1..b4eb315f 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,9 @@ github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGn github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.21.0 h1:CdmwIlKUWFBDS+4464GtQiQ0R1vpzOgu4Vnd74rBL7M= github.com/alicebob/miniredis/v2 v2.21.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= +github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo= +github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -212,8 +213,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.14.0 h1:JWQnGNsnlEiWh77cTY+YSgvKUGxliE0oWWQYAKysF6s= github.com/go-vela/sdk-go v0.14.0/go.mod h1:xrl/pF9k6Xzu+fchm7SrJJPdqgVCTLQBdB+L/lyCfjg= -github.com/go-vela/server v0.14.0 h1:G0Ble5hZ904DFPWYN6Nl9m73hZT6hw+41+eq/n1o0NQ= github.com/go-vela/server v0.14.0/go.mod h1:XcC8Pque6rY01U2XsCv3TSSQNaNFp+tk0B3s0KhyAZw= +github.com/go-vela/server v0.14.3 h1:IE34fpK7b7tr5a8GldAOCkkMhzQ3QBgZDl428Aa9OjI= +github.com/go-vela/server v0.14.3/go.mod h1:2drMGkMjrOXOe5H5M6lSbXjN4hvTxi1tUwTO9OX8jcM= github.com/go-vela/types v0.14.0 h1:m75BdRfQm9PC4l/oHSgeplt8mqgau3JmqD3DN+KdePk= github.com/go-vela/types v0.14.0/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= @@ -1105,12 +1107,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= -k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= -k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= +k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= +k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= -k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= +k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= +k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= +k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From 1f61fc2f70b01de62e61ed777fa3091bddf360c4 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sun, 11 Sep 2022 22:16:18 -0400 Subject: [PATCH 316/430] Allow creating mocks via `runtime.New()` (#340) --- cmd/vela-worker/exec.go | 1 + runtime/setup.go | 42 ++++++++++++++++++++++------- runtime/setup_test.go | 58 +++++++++++++++++++++++++++++------------ 3 files changed, 75 insertions(+), 26 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index c5093f3f..dc2e3602 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -52,6 +52,7 @@ func (w *Worker) exec(index int) error { // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#New w.Runtime, err = runtime.New(&runtime.Setup{ Logger: logger, + Mock: w.Config.Mock, Driver: w.Config.Runtime.Driver, ConfigFile: w.Config.Runtime.ConfigFile, HostVolumes: w.Config.Runtime.HostVolumes, diff --git a/runtime/setup.go b/runtime/setup.go index 3a88c75a..7207f39c 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -13,6 +13,7 @@ import ( "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" ) // Setup represents the configuration necessary for @@ -24,6 +25,9 @@ type Setup struct { // Runtime Configuration + // Mock should only be true for tests. + Mock bool + // specifies the driver to use for the runtime client Driver string // specifies the path to a configuration file to use for the runtime client @@ -45,14 +49,23 @@ type Setup struct { func (s *Setup) Docker() (Engine, error) { logrus.Trace("creating docker runtime client from setup") - // create new Docker runtime engine - // - // https://pkg.go.dev/github.com/go-vela/worker/runtime/docker?tab=doc#New - return docker.New( + opts := []docker.ClientOpt{ docker.WithHostVolumes(s.HostVolumes), docker.WithPrivilegedImages(s.PrivilegedImages), docker.WithLogger(s.Logger), - ) + } + + if s.Mock { + // create new mock Docker runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/docker?tab=doc#NewMock + return docker.NewMock(opts...) + } + + // create new Docker runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/docker?tab=doc#New + return docker.New(opts...) } // Kubernetes creates and returns a Vela engine capable of @@ -60,17 +73,26 @@ func (s *Setup) Docker() (Engine, error) { func (s *Setup) Kubernetes() (Engine, error) { logrus.Trace("creating kubernetes runtime client from setup") - // create new Kubernetes runtime engine - // - // https://pkg.go.dev/github.com/go-vela/worker/runtime/kubernetes?tab=doc#New - return kubernetes.New( + opts := []kubernetes.ClientOpt{ kubernetes.WithConfigFile(s.ConfigFile), kubernetes.WithHostVolumes(s.HostVolumes), kubernetes.WithNamespace(s.Namespace), kubernetes.WithPodsTemplate(s.PodsTemplateName, s.PodsTemplateFile), kubernetes.WithPrivilegedImages(s.PrivilegedImages), kubernetes.WithLogger(s.Logger), - ) + } + + if s.Mock { + // create new mock Kubernetes runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/kubernetes?tab=doc#NewMock + return kubernetes.NewMock(&v1.Pod{}, opts...) + } + + // create new Kubernetes runtime engine + // + // https://pkg.go.dev/github.com/go-vela/worker/runtime/kubernetes?tab=doc#New + return kubernetes.New(opts...) } // Validate verifies the necessary fields for the diff --git a/runtime/setup_test.go b/runtime/setup_test.go index 8b87fd2b..2484fe2d 100644 --- a/runtime/setup_test.go +++ b/runtime/setup_test.go @@ -11,30 +11,56 @@ import ( ) func TestRuntime_Setup_Docker(t *testing.T) { - // setup types - _setup := &Setup{ - Driver: constants.DriverDocker, + tests := []struct { + name string + mock bool + }{ + {name: "standard", mock: false}, + {name: "mocked", mock: true}, } - // run test - _, err := _setup.Docker() - if err != nil { - t.Errorf("Docker returned err: %v", err) + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + // setup types + _setup := &Setup{ + Mock: test.mock, + Driver: constants.DriverDocker, + } + + _, err := _setup.Docker() + if err != nil { + t.Errorf("Docker returned err: %v", err) + } + }) } } func TestRuntime_Setup_Kubernetes(t *testing.T) { - // setup types - _setup := &Setup{ - Driver: constants.DriverKubernetes, - ConfigFile: "testdata/config", - Namespace: "docker", + tests := []struct { + name string + mock bool + }{ + {name: "standard", mock: false}, + {name: "mocked", mock: true}, } - // run test - _, err := _setup.Kubernetes() - if err != nil { - t.Errorf("Kubernetes returned err: %v", err) + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + // setup types + _setup := &Setup{ + Mock: test.mock, + Driver: constants.DriverKubernetes, + ConfigFile: "testdata/config", + Namespace: "docker", + } + + _, err := _setup.Kubernetes() + if err != nil { + t.Errorf("Kubernetes returned err: %v", err) + } + }) } } From c131fcb80412e0715337de8ba6bb6c197dfb653c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:20:52 -0500 Subject: [PATCH 317/430] fix(deps): update module github.com/google/go-cmp to v0.5.9 (#369) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 85e45a8d..ee585cfd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-vela/sdk-go v0.14.0 github.com/go-vela/server v0.14.3 github.com/go-vela/types v0.14.0 - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.13.0 diff --git a/go.sum b/go.sum index b4eb315f..9372f960 100644 --- a/go.sum +++ b/go.sum @@ -276,8 +276,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= From 4327c5dbc627c1e363562d69a9b0f4a745dd3def Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 14 Sep 2022 19:52:54 +0000 Subject: [PATCH 318/430] chore(go): update to 1.19 (#370) --- .github/workflows/build.yml | 10 +- .github/workflows/prerelease.yml | 14 +- .github/workflows/publish.yml | 14 +- .github/workflows/reviewdog.yml | 13 +- .github/workflows/spec.yml | 10 +- .github/workflows/test.yml | 12 +- .github/workflows/validate.yml | 12 +- Makefile | 2 +- api/doc.go | 2 +- executor/doc.go | 2 +- executor/linux/doc.go | 2 +- executor/local/doc.go | 2 +- go.mod | 2 +- go.sum | 227 ------------------ internal/build/doc.go | 2 +- internal/doc.go | 6 +- internal/image/doc.go | 2 +- internal/message/doc.go | 2 +- internal/service/doc.go | 2 +- internal/step/doc.go | 2 +- internal/volume/doc.go | 2 +- mock/doc.go | 2 +- mock/docker/doc.go | 2 +- mock/worker/doc.go | 2 +- router/doc.go | 2 +- router/middleware/doc.go | 2 +- router/middleware/logger.go | 4 +- router/middleware/perm/doc.go | 2 +- router/middleware/token/doc.go | 2 +- router/middleware/user/doc.go | 2 +- router/router.go | 26 +- runtime/doc.go | 2 +- runtime/docker/doc.go | 2 +- runtime/kubernetes/apis/doc.go | 2 +- runtime/kubernetes/apis/vela/v1alpha1/doc.go | 2 +- .../vela/v1alpha1/zz_generated.deepcopy.go | 1 - runtime/kubernetes/doc.go | 2 +- .../clientset/versioned/fake/register.go | 14 +- .../clientset/versioned/scheme/register.go | 14 +- 39 files changed, 116 insertions(+), 311 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1840ce8f..75a74bdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,12 +10,18 @@ on: jobs: build: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: build run: | make build diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 843e7ae9..3b939d52 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -11,8 +11,7 @@ on: jobs: prerelease: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 @@ -20,6 +19,13 @@ jobs: # ensures we fetch tag history for the repository fetch-depth: 0 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: setup run: | # setup git tag in Actions environment @@ -33,7 +39,7 @@ jobs: make build-static-ci - name: publish - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v4 with: name: target/vela-worker cache: true @@ -42,7 +48,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: publish-alpine - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v4 with: name: target/vela-worker cache: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8f8bab9a..45350807 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,8 +10,7 @@ on: jobs: publish: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 @@ -19,6 +18,13 @@ jobs: # ensures we fetch tag history for the repository fetch-depth: 0 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: build env: GOOS: linux @@ -27,7 +33,7 @@ jobs: make build-static-ci - name: publish - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v4 with: name: target/vela-worker cache: true @@ -35,7 +41,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: publish-alpine - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v4 with: name: target/vela-worker cache: true diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 7a53e50c..159de15a 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -5,10 +5,6 @@ name: reviewdog on: pull_request: -# NOTE: We have to specify `go_version: 1.17` because the action was installing 1.18. -# 1.18, in turn, is not fully supported by golangci-lint yet, and it can fail silently: -# see: https://github.com/reviewdog/action-golangci-lint/issues/249 - # pipeline to execute jobs: diff-review: @@ -21,7 +17,6 @@ jobs: uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} - go_version: 1.17.9 golangci_lint_flags: "--config=.golangci.yml --verbose" fail_on_error: true filter_mode: diff_context @@ -33,11 +28,17 @@ jobs: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 with: github_token: ${{ secrets.github_token }} - go_version: 1.17.9 golangci_lint_flags: "--config=.golangci.yml --verbose" fail_on_error: false filter_mode: nofilter diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 9cc2d9cc..e57fa650 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -10,12 +10,18 @@ on: jobs: schema: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: tags run: | git fetch --tags diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f22da773..63823c60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,15 +10,17 @@ on: jobs: test: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 - - name: install - run: | - go get github.com/mattn/goveralls + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true - name: test run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 0310e8bc..9c1cc5d1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,12 +10,18 @@ on: jobs: validate: runs-on: ubuntu-latest - container: - image: golang:1.17 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: validate run: | # Check that go mod tidy produces a zero diff; clean up any changes afterwards. @@ -29,5 +35,5 @@ jobs: - name: validate spec run: | - make spec-install + sudo make spec-install make spec diff --git a/Makefile b/Makefile index 06d2f890..17a3f42a 100644 --- a/Makefile +++ b/Makefile @@ -275,7 +275,7 @@ spec-install: @apt-get update @apt-get install -y jq moreutils @echo "### Downloading and installing go-swagger" - @curl -o /usr/local/bin/swagger -L "https://github.com/go-swagger/go-swagger/releases/download/v0.27.0/swagger_linux_amd64" + @curl -o /usr/local/bin/swagger -L "https://github.com/go-swagger/go-swagger/releases/download/v0.30.2/swagger_linux_amd64" @chmod +x /usr/local/bin/swagger # The `spec-gen` target is intended to create an api-spec diff --git a/api/doc.go b/api/doc.go index aacdede7..bba5c985 100644 --- a/api/doc.go +++ b/api/doc.go @@ -6,5 +6,5 @@ // // Usage: // -// import "github.com/go-vela/worker/api" +// import "github.com/go-vela/worker/api" package api diff --git a/executor/doc.go b/executor/doc.go index c3dc5a64..b5a194f5 100644 --- a/executor/doc.go +++ b/executor/doc.go @@ -8,5 +8,5 @@ // // Usage: // -// import "github.com/go-vela/worker/executor" +// import "github.com/go-vela/worker/executor" package executor diff --git a/executor/linux/doc.go b/executor/linux/doc.go index f26b67fd..fa22e227 100644 --- a/executor/linux/doc.go +++ b/executor/linux/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/executor/linux" +// import "github.com/go-vela/worker/executor/linux" package linux diff --git a/executor/local/doc.go b/executor/local/doc.go index be55b775..33dc2532 100644 --- a/executor/local/doc.go +++ b/executor/local/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/executor/local" +// import "github.com/go-vela/worker/executor/local" package local diff --git a/go.mod b/go.mod index ee585cfd..2e30c404 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-vela/worker -go 1.17 +go 1.19 require ( github.com/Masterminds/semver/v3 v3.1.1 diff --git a/go.sum b/go.sum index 9372f960..27071cc8 100644 --- a/go.sum +++ b/go.sum @@ -49,13 +49,8 @@ github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935 github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= -github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb/go.mod h1:WsAABbY4HQBgd3mGuG4KMNTbHJCPvx9IVBHzysbknss= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/FZambia/sentinel v1.0.0/go.mod h1:ytL1Am/RLlAoAXG6Kj5LNuw/TRRQrv2rt2FT26vP5gI= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= @@ -74,29 +69,19 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.11.1/go.mod h1:UA48pmi7aSazcGAvcdKcBB49z521IC9VjTTRz2nIaJE= -github.com/alicebob/miniredis/v2 v2.21.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo= github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.38/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -104,24 +89,17 @@ github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/containerd/containerd v1.4.13 h1:Z0CbagVdn9VN4K6htOCY/jApSw8YKP+RdLZ5dkXF8PM= github.com/containerd/containerd v1.4.13/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -153,15 +131,9 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -172,7 +144,6 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -180,7 +151,6 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -209,18 +179,14 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-vela/sdk-go v0.14.0 h1:JWQnGNsnlEiWh77cTY+YSgvKUGxliE0oWWQYAKysF6s= github.com/go-vela/sdk-go v0.14.0/go.mod h1:xrl/pF9k6Xzu+fchm7SrJJPdqgVCTLQBdB+L/lyCfjg= -github.com/go-vela/server v0.14.0/go.mod h1:XcC8Pque6rY01U2XsCv3TSSQNaNFp+tk0B3s0KhyAZw= github.com/go-vela/server v0.14.3 h1:IE34fpK7b7tr5a8GldAOCkkMhzQ3QBgZDl428Aa9OjI= github.com/go-vela/server v0.14.3/go.mod h1:2drMGkMjrOXOe5H5M6lSbXjN4hvTxi1tUwTO9OX8jcM= github.com/go-vela/types v0.14.0 h1:m75BdRfQm9PC4l/oHSgeplt8mqgau3JmqD3DN+KdePk= github.com/go-vela/types v0.14.0/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -257,9 +223,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= @@ -276,7 +239,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= @@ -302,7 +264,6 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -311,7 +272,6 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -322,45 +282,17 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= -github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= -github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.7.2/go.mod h1:xbfA+1AvxFseDzxxdWaL0uO99n1+tndus4GCrtouy0M= -github.com/hashicorp/vault/sdk v0.5.1/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= @@ -370,58 +302,12 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -433,7 +319,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -443,51 +328,23 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.18/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -512,31 +369,22 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -545,14 +393,11 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -561,7 +406,6 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -569,7 +413,6 @@ github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8 github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -580,22 +423,14 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -609,7 +444,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -618,12 +452,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE= github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= @@ -633,11 +464,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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= -github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -github.com/yuin/gopher-lua v0.0.0-20191213034115-f46add6fdb5c/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= 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= @@ -648,34 +476,16 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 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= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -713,7 +523,6 @@ 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/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -729,7 +538,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -755,9 +563,7 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= @@ -789,19 +595,15 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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-20190222072716-a9d3bda3a223/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-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -809,19 +611,15 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -843,7 +641,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -862,10 +659,8 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -882,8 +677,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -893,7 +686,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 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-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/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= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -901,11 +693,8 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -913,7 +702,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -938,14 +726,11 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -979,7 +764,6 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1024,7 +808,6 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1059,7 +842,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1071,15 +853,11 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN 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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -1094,10 +872,6 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= -gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= -gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= @@ -1110,7 +884,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= -k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= diff --git a/internal/build/doc.go b/internal/build/doc.go index e1870f2c..5c15988e 100644 --- a/internal/build/doc.go +++ b/internal/build/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/build" +// import "github.com/go-vela/worker/internal/build" package build diff --git a/internal/doc.go b/internal/doc.go index 7f15e7d5..7aaad1f6 100644 --- a/internal/doc.go +++ b/internal/doc.go @@ -7,10 +7,10 @@ // // More information: // -// * https://golang.org/doc/go1.4#internalpackages -// * https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit +// - https://golang.org/doc/go1.4#internalpackages +// - https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit // // Usage: // -// import "github.com/go-vela/worker/internal" +// import "github.com/go-vela/worker/internal" package internal diff --git a/internal/image/doc.go b/internal/image/doc.go index 8277eab6..fa21f0c0 100644 --- a/internal/image/doc.go +++ b/internal/image/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/image" +// import "github.com/go-vela/worker/internal/image" package image diff --git a/internal/message/doc.go b/internal/message/doc.go index 10bad174..84920b80 100644 --- a/internal/message/doc.go +++ b/internal/message/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/message" +// import "github.com/go-vela/worker/internal/message" package message diff --git a/internal/service/doc.go b/internal/service/doc.go index 93b428e3..34a0aa0f 100644 --- a/internal/service/doc.go +++ b/internal/service/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/service" +// import "github.com/go-vela/worker/internal/service" package service diff --git a/internal/step/doc.go b/internal/step/doc.go index 333ebe65..7209e373 100644 --- a/internal/step/doc.go +++ b/internal/step/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/step" +// import "github.com/go-vela/worker/internal/step" package step diff --git a/internal/volume/doc.go b/internal/volume/doc.go index 1d433f7b..f5b36a01 100644 --- a/internal/volume/doc.go +++ b/internal/volume/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/internal/volume" +// import "github.com/go-vela/worker/internal/volume" package volume diff --git a/mock/doc.go b/mock/doc.go index fa9536ea..9e9203b5 100644 --- a/mock/doc.go +++ b/mock/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/mock" +// import "github.com/go-vela/worker/mock" package mock diff --git a/mock/docker/doc.go b/mock/docker/doc.go index bf56572d..24fa2ed8 100644 --- a/mock/docker/doc.go +++ b/mock/docker/doc.go @@ -8,5 +8,5 @@ // // Usage: // -// import "github.com/go-vela/worker/mock/docker" +// import "github.com/go-vela/worker/mock/docker" package docker diff --git a/mock/worker/doc.go b/mock/worker/doc.go index 281bb581..4f30620b 100644 --- a/mock/worker/doc.go +++ b/mock/worker/doc.go @@ -6,5 +6,5 @@ // // Usage: // -// import "github.com/go-vela/worker/mock/worker" +// import "github.com/go-vela/worker/mock/worker" package worker diff --git a/router/doc.go b/router/doc.go index e43cf3f4..8ce29ea8 100644 --- a/router/doc.go +++ b/router/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/router" +// import "github.com/go-vela/worker/router" package router diff --git a/router/middleware/doc.go b/router/middleware/doc.go index 8fb02358..09d15234 100644 --- a/router/middleware/doc.go +++ b/router/middleware/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/router/middleware" +// import "github.com/go-vela/worker/router/middleware" package middleware diff --git a/router/middleware/logger.go b/router/middleware/logger.go index b9431515..3c610141 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -17,8 +17,8 @@ import ( // Requests without errors are logged using logrus.Info(). // // It receives: -// 1. A time package format string (e.g. time.RFC3339). -// 2. A boolean stating whether to use UTC time zone or local. +// 1. A time package format string (e.g. time.RFC3339). +// 2. A boolean stating whether to use UTC time zone or local. func Logger(logger *logrus.Logger, timeFormat string, utc bool) gin.HandlerFunc { return func(c *gin.Context) { start := time.Now() diff --git a/router/middleware/perm/doc.go b/router/middleware/perm/doc.go index e68e1c71..0f42c133 100644 --- a/router/middleware/perm/doc.go +++ b/router/middleware/perm/doc.go @@ -8,5 +8,5 @@ // // Usage: // -// import "github.com/go-vela/worker/router/middleware/perm" +// import "github.com/go-vela/worker/router/middleware/perm" package perm diff --git a/router/middleware/token/doc.go b/router/middleware/token/doc.go index 63e877fe..a13ef8cf 100644 --- a/router/middleware/token/doc.go +++ b/router/middleware/token/doc.go @@ -8,5 +8,5 @@ // // Usage: // -// import "github.com/go-vela/worker/router/middleware/token" +// import "github.com/go-vela/worker/router/middleware/token" package token diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go index b476b5e2..7ba0a485 100644 --- a/router/middleware/user/doc.go +++ b/router/middleware/user/doc.go @@ -8,5 +8,5 @@ // // Usage: // -// import "github.com/go-vela/worker/router/middleware/user" +// import "github.com/go-vela/worker/router/middleware/user" package user diff --git a/router/router.go b/router/router.go index c515f5c9..222029df 100644 --- a/router/router.go +++ b/router/router.go @@ -6,22 +6,22 @@ // // API for a Vela worker // -// Version: 0.0.0-dev -// Schemes: http, https -// Host: localhost +// Version: 0.0.0-dev +// Schemes: http, https +// Host: localhost // -// Consumes: -// - application/json +// Consumes: +// - application/json // -// Produces: -// - application/json +// Produces: +// - application/json // -// SecurityDefinitions: -// ApiKeyAuth: -// description: Bearer token -// type: apiKey -// in: header -// name: Authorization +// SecurityDefinitions: +// ApiKeyAuth: +// description: Bearer token +// type: apiKey +// in: header +// name: Authorization // // swagger:meta package router diff --git a/runtime/doc.go b/runtime/doc.go index 78ea790f..46169ce4 100644 --- a/runtime/doc.go +++ b/runtime/doc.go @@ -13,5 +13,5 @@ // // Usage: // -// import "github.com/go-vela/worker/runtime" +// import "github.com/go-vela/worker/runtime" package runtime diff --git a/runtime/docker/doc.go b/runtime/docker/doc.go index 9edb7dc0..93a977a5 100644 --- a/runtime/docker/doc.go +++ b/runtime/docker/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/runtime/docker" +// import "github.com/go-vela/worker/runtime/docker" package docker diff --git a/runtime/kubernetes/apis/doc.go b/runtime/kubernetes/apis/doc.go index e45ff9ac..12ffd8cb 100644 --- a/runtime/kubernetes/apis/doc.go +++ b/runtime/kubernetes/apis/doc.go @@ -6,5 +6,5 @@ // // Usage: // -// import "github.com/go-vela/worker/runtime/kubernetes/apis" +// import "github.com/go-vela/worker/runtime/kubernetes/apis" package apis diff --git a/runtime/kubernetes/apis/vela/v1alpha1/doc.go b/runtime/kubernetes/apis/vela/v1alpha1/doc.go index b0a6f8d1..44ad049d 100644 --- a/runtime/kubernetes/apis/vela/v1alpha1/doc.go +++ b/runtime/kubernetes/apis/vela/v1alpha1/doc.go @@ -11,5 +11,5 @@ // // Usage: // -// import "github.com/go-vela/worker/runtime/kubernetes/apis/v1alpha1" +// import "github.com/go-vela/worker/runtime/kubernetes/apis/v1alpha1" package v1alpha1 diff --git a/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go b/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go index ab2a4fa1..01bb54ce 100644 --- a/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go +++ b/runtime/kubernetes/apis/vela/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Copyright (c) 2022 Target Brands, Inc. All rights reserved. // diff --git a/runtime/kubernetes/doc.go b/runtime/kubernetes/doc.go index 76f0ff73..75582084 100644 --- a/runtime/kubernetes/doc.go +++ b/runtime/kubernetes/doc.go @@ -7,5 +7,5 @@ // // Usage: // -// import "github.com/go-vela/worker/runtime/kubernetes" +// import "github.com/go-vela/worker/runtime/kubernetes" package kubernetes diff --git a/runtime/kubernetes/generated/clientset/versioned/fake/register.go b/runtime/kubernetes/generated/clientset/versioned/fake/register.go index c8a5f06d..7ce53f3e 100644 --- a/runtime/kubernetes/generated/clientset/versioned/fake/register.go +++ b/runtime/kubernetes/generated/clientset/versioned/fake/register.go @@ -25,14 +25,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/runtime/kubernetes/generated/clientset/versioned/scheme/register.go b/runtime/kubernetes/generated/clientset/versioned/scheme/register.go index 38f25139..bab57b34 100644 --- a/runtime/kubernetes/generated/clientset/versioned/scheme/register.go +++ b/runtime/kubernetes/generated/clientset/versioned/scheme/register.go @@ -25,14 +25,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. From c23650e2f82d87b175a3d29804380319c59faf5a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:39:02 -0500 Subject: [PATCH 319/430] fix(deps): update golang.org/x/sync digest to f12130a (#364) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2e30c404..12bef6c0 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.11.1 - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 + golang.org/x/sync v0.0.0-20220907140024-f12130a52804 gotest.tools/v3 v3.3.0 k8s.io/api v0.24.3 k8s.io/apimachinery v0.24.3 diff --git a/go.sum b/go.sum index 27071cc8..f9c596a9 100644 --- a/go.sum +++ b/go.sum @@ -595,8 +595,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= +golang.org/x/sync v0.0.0-20220907140024-f12130a52804/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 72bfc7d08030feaa4f43b5285fd48fc1ab1c35c3 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 15 Sep 2022 08:47:36 -0600 Subject: [PATCH 320/430] chore(lint): fix linter errors in worker codebase (#371) * chore(lint): fix linter errors in worker codebase * go mod tidy * fixing struct check Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> Co-authored-by: dave vader <48764154+plyr4@users.noreply.github.com> --- cmd/vela-worker/exec.go | 3 ++- cmd/vela-worker/operate.go | 4 +++- cmd/vela-worker/start.go | 6 ++++-- executor/context.go | 2 +- executor/context_test.go | 6 +++--- executor/executor.go | 3 +-- executor/linux/api.go | 7 ++++--- executor/linux/build.go | 6 ++++-- executor/linux/linux.go | 3 +-- executor/linux/secret.go | 4 +++- executor/linux/secret_test.go | 4 ++-- executor/linux/service.go | 10 +++++++--- executor/linux/step.go | 10 +++++++--- executor/linux/step_test.go | 4 ++-- executor/local/api.go | 7 ++++--- executor/local/build.go | 2 +- executor/local/local.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- mock/docker/config.go | 2 +- mock/docker/container.go | 27 +++++++++++++-------------- mock/docker/docker.go | 6 +++--- mock/docker/image.go | 9 ++++----- mock/docker/network.go | 8 ++++---- mock/docker/secret.go | 2 +- mock/docker/volume.go | 12 ++++++------ router/build.go | 3 +-- router/executor.go | 3 +-- router/middleware/logger_test.go | 2 +- router/middleware/payload.go | 4 ++-- router/middleware/token/token.go | 3 +-- router/pipeline.go | 3 +-- router/repo.go | 3 +-- runtime/context.go | 2 +- runtime/context_test.go | 6 +++--- runtime/docker/docker.go | 7 +++---- runtime/docker/image.go | 3 +-- runtime/kubernetes/container.go | 5 ++--- runtime/kubernetes/container_test.go | 2 +- runtime/kubernetes/kubernetes.go | 4 ++-- runtime/kubernetes/opts.go | 4 ++-- runtime/kubernetes/volume.go | 3 ++- runtime/runtime.go | 3 +-- 43 files changed, 111 insertions(+), 104 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index dc2e3602..0e05264c 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -17,7 +17,8 @@ import ( // exec is a helper function to poll the queue // and execute Vela pipelines for the Worker. -// nolint: nilerr // ignore returning nil - don't want to crash worker +// +//nolint:nilerr // ignore returning nil - don't want to crash worker func (w *Worker) exec(index int) error { var err error diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index ac625353..da223970 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -55,6 +55,7 @@ func (w *Worker) operate(ctx context.Context) error { registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) // register or update the worker + //nolint:contextcheck // ignore passing context err = w.checkIn(registryWorker) if err != nil { logrus.Error(err) @@ -74,6 +75,7 @@ func (w *Worker) operate(ctx context.Context) error { // setup the queue // // https://pkg.go.dev/github.com/go-vela/server/queue?tab=doc#New + //nolint:contextcheck // ignore passing context w.Queue, err = queue.New(w.Config.Queue) if err != nil { return err @@ -107,7 +109,7 @@ func (w *Worker) operate(ctx context.Context) error { // exec operator subprocess to poll and execute builds // (do not pass the context to avoid errors in one // executor+build inadvertently canceling other builds) - // nolint: contextcheck // ignore passing context + //nolint:contextcheck // ignore passing context err = w.exec(id) if err != nil { // log the error received from the executor diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 45422423..46193317 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -12,6 +12,7 @@ import ( "os" "os/signal" "syscall" + "time" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" @@ -34,8 +35,9 @@ func (w *Worker) Start() error { httpHandler, tls := w.server() server := &http.Server{ - Addr: fmt.Sprintf(":%s", w.Config.API.Address.Port()), - Handler: httpHandler, + Addr: fmt.Sprintf(":%s", w.Config.API.Address.Port()), + Handler: httpHandler, + ReadHeaderTimeout: 60 * time.Second, } // goroutine to check for signals to gracefully finish all functions diff --git a/executor/context.go b/executor/context.go index 0ee583ab..f6c5acf9 100644 --- a/executor/context.go +++ b/executor/context.go @@ -54,7 +54,7 @@ func FromGinContext(c *gin.Context) Engine { func WithContext(c context.Context, e Engine) context.Context { // set the executor Engine in the context.Context // - // nolint: revive,staticcheck // ignore using string with context value + //nolint:revive,staticcheck // ignore using string with context value return context.WithValue(c, key, e) } diff --git a/executor/context_test.go b/executor/context_test.go index fc645ae4..280ee973 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -57,7 +57,7 @@ func TestExecutor_FromContext(t *testing.T) { }{ { name: "valid executor in context", - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -68,7 +68,7 @@ func TestExecutor_FromContext(t *testing.T) { }, { name: "invalid executor in context", - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -185,7 +185,7 @@ func TestExecutor_WithContext(t *testing.T) { t.Errorf("unable to create linux engine: %v", err) } - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test diff --git a/executor/executor.go b/executor/executor.go index 031ca6cf..b13fae91 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -12,8 +12,6 @@ import ( "github.com/sirupsen/logrus" ) -// nolint: godot // ignore period at end for comment ending in a list -// // New creates and returns a Vela engine capable of // integrating with the configured executor. // @@ -21,6 +19,7 @@ import ( // // * linux // * local +// . func New(s *Setup) (Engine, error) { // validate the setup being provided // diff --git a/executor/linux/api.go b/executor/linux/api.go index 9ee2150a..c47da637 100644 --- a/executor/linux/api.go +++ b/executor/linux/api.go @@ -47,7 +47,8 @@ func (c *client) GetRepo() (*library.Repo, error) { } // CancelBuild cancels the current build in execution. -// nolint: funlen // process of going through steps/services/stages is verbose and could be funcitonalized +// +//nolint:funlen // process of going through steps/services/stages is verbose and could be funcitonalized func (c *client) CancelBuild() (*library.Build, error) { // get the current build from the client b, err := c.GetBuild() @@ -65,7 +66,7 @@ func (c *client) CancelBuild() (*library.Build, error) { } // cancel non successful services - // nolint: dupl // false positive, steps/services are different + //nolint:dupl // false positive, steps/services are different for _, _service := range pipeline.Services { // load the service from the client // @@ -106,7 +107,7 @@ func (c *client) CancelBuild() (*library.Build, error) { } // cancel non successful steps - // nolint: dupl // false positive, steps/services are different + //nolint:dupl // false positive, steps/services are different for _, _step := range pipeline.Steps { // load the step from the client // diff --git a/executor/linux/build.go b/executor/linux/build.go index d59d5700..8f01fe5d 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -36,6 +36,7 @@ func (c *client) CreateBuild(ctx context.Context) error { // send API call to update the build // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#BuildService.Update + //nolint:contextcheck // ignore passing context c.build, _, c.err = c.Vela.Build.Update(c.repo.GetOrg(), c.repo.GetName(), c.build) if c.err != nil { return fmt.Errorf("unable to upload build state: %w", c.err) @@ -162,6 +163,7 @@ func (c *client) PlanBuild(ctx context.Context) error { c.Logger.Infof("pulling %s %s secret %s", secret.Engine, secret.Type, secret.Name) + //nolint:contextcheck // ignore passing context s, err := c.secret.pull(secret) if err != nil { c.err = err @@ -189,7 +191,7 @@ func (c *client) PlanBuild(ctx context.Context) error { // AssembleBuild prepares the containers within a build for execution. // -// nolint: funlen // ignore function length due to comments and logging messages +//nolint:funlen // ignore function length due to comments and logging messages func (c *client) AssembleBuild(ctx context.Context) error { // defer taking a snapshot of the build // @@ -268,7 +270,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { for _, s := range c.pipeline.Stages { // TODO: remove hardcoded reference // - // nolint: goconst // ignore making a constant for now + //nolint:goconst // ignore making a constant for now if s.Name == "init" { continue } diff --git a/executor/linux/linux.go b/executor/linux/linux.go index fe388cd0..d8650cdc 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -49,7 +49,6 @@ type ( err error } - // nolint: structcheck // ignore false positive svc struct { client *client } @@ -86,7 +85,7 @@ func Equal(a, b *client) bool { // New returns an Executor implementation that integrates with a Linux instance. // -// nolint: revive // ignore unexported type as it is intentional +//nolint:revive // ignore unexported type as it is intentional func New(opts ...Opt) (*client, error) { // create new Linux client c := new(client) diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 6417070d..137a7aca 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -175,6 +175,7 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { // send API call to update the build // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + //nolint:contextcheck // ignore passing context _, _, err = s.client.Vela.Step.Update(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), _init) if err != nil { s.client.Logger.Errorf("unable to upload init state: %v", err) @@ -186,7 +187,7 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { // pull defines a function that pulls the secrets from the server for a given pipeline. func (s *secretSvc) pull(secret *pipeline.Secret) (*library.Secret, error) { - // nolint: staticcheck // reports the value is never used but we return it + //nolint:staticcheck // reports the value is never used but we return it _secret := new(library.Secret) switch secret.Type { @@ -314,6 +315,7 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // send API call to append the logs for the init step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + //nolint:contextcheck // ignore passing context _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), s.client.init.Number, _log) if err != nil { return err diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index ccd1c69d..ac9bfd06 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -7,8 +7,8 @@ package linux import ( "context" "flag" - "io/ioutil" "net/http/httptest" + "os" "testing" "github.com/gin-gonic/gin" @@ -290,7 +290,7 @@ func TestLinux_Secret_exec(t *testing.T) { // run tests for _, test := range tests { t.Run(test.name, func(t *testing.T) { - file, _ := ioutil.ReadFile(test.pipeline) + file, _ := os.ReadFile(test.pipeline) p, _, err := compiler. Duplicate(). diff --git a/executor/linux/service.go b/executor/linux/service.go index b20cc22e..a79cd2ea 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -9,7 +9,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "time" "github.com/go-vela/types/constants" @@ -84,6 +84,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error // send API call to update the service // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#SvcService.Update + //nolint:contextcheck // ignore passing context _service, _, err = c.Vela.Svc.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _service) if err != nil { return err @@ -105,6 +106,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error // send API call to capture the service log // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.GetService + //nolint:contextcheck // ignore passing context _log, _, err := c.Vela.Log.GetService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _service.GetNumber()) if err != nil { return err @@ -155,7 +157,7 @@ func (c *client) ExecService(ctx context.Context, ctn *pipeline.Container) error // StreamService tails the output for a service. // -// nolint: funlen // ignore function length +//nolint:funlen // ignore function length func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) error { // update engine logger with service metadata // @@ -181,7 +183,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err defer rc.Close() // read all output from the runtime container - data, err := ioutil.ReadAll(rc) + data, err := io.ReadAll(rc) if err != nil { logger.Errorf("unable to read container output for upload: %v", err) @@ -204,6 +206,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // send API call to update the logs for the service // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + //nolint:contextcheck // ignore passing context _, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Errorf("unable to upload container logs: %v", err) @@ -323,6 +326,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // send API call to append the logs for the service // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + //nolint:contextcheck // ignore passing context _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { return err diff --git a/executor/linux/step.go b/executor/linux/step.go index 49c755e1..70d5d64d 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -9,7 +9,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "strings" "time" @@ -91,6 +91,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // send API call to update the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#StepService.Update + //nolint:contextcheck // ignore passing context _step, _, err = c.Vela.Step.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _step) if err != nil { return err @@ -112,6 +113,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { // send API call to capture the step log // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.GetStep + //nolint:contextcheck // ignore passing context _log, _, err := c.Vela.Log.GetStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), _step.GetNumber()) if err != nil { return err @@ -186,7 +188,7 @@ func (c *client) ExecStep(ctx context.Context, ctn *pipeline.Container) error { // StreamStep tails the output for a step. // -// nolint: funlen // ignore function length +//nolint:funlen // ignore function length func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error { // TODO: remove hardcoded reference if ctn.Name == "init" { @@ -219,7 +221,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error defer rc.Close() // read all output from the runtime container - data, err := ioutil.ReadAll(rc) + data, err := io.ReadAll(rc) if err != nil { logger.Errorf("unable to read container output for upload: %v", err) @@ -247,6 +249,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // send API call to update the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep + //nolint:contextcheck // ignore passing context _, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Errorf("unable to upload container logs: %v", err) @@ -376,6 +379,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // send API call to append the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep + //nolint:contextcheck // ignore passing context _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { return err diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 078dce96..7c283acc 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -6,8 +6,8 @@ package linux import ( "context" - "io/ioutil" "net/http/httptest" + "os" "reflect" "testing" @@ -566,7 +566,7 @@ func TestLinux_DestroyStep(t *testing.T) { } func TestLinux_getSecretValues(t *testing.T) { - fileSecret, err := ioutil.ReadFile("./testdata/step/secret_text.txt") + fileSecret, err := os.ReadFile("./testdata/step/secret_text.txt") if err != nil { t.Errorf("unable to read from test data file secret. Err: %v", err) } diff --git a/executor/local/api.go b/executor/local/api.go index 3f67a5de..671ff79c 100644 --- a/executor/local/api.go +++ b/executor/local/api.go @@ -47,7 +47,8 @@ func (c *client) GetRepo() (*library.Repo, error) { } // CancelBuild cancels the current build in execution. -// nolint: funlen // process of going through steps/services/stages is verbose and could be funcitonalized +// +//nolint:funlen // process of going through steps/services/stages is verbose and could be funcitonalized func (c *client) CancelBuild() (*library.Build, error) { // get the current build from the client b, err := c.GetBuild() @@ -65,7 +66,7 @@ func (c *client) CancelBuild() (*library.Build, error) { } // cancel non successful services - // nolint: dupl // false positive, steps/services are different + //nolint:dupl // false positive, steps/services are different for _, _service := range pipeline.Services { // load the service from the client // @@ -106,7 +107,7 @@ func (c *client) CancelBuild() (*library.Build, error) { } // cancel non successful steps - // nolint: dupl // false positive, steps/services are different + //nolint:dupl // false positive, steps/services are different for _, _step := range pipeline.Steps { // load the step from the client // diff --git a/executor/local/build.go b/executor/local/build.go index 8c1f0168..2fa79ff8 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -192,7 +192,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { for _, _stage := range c.pipeline.Stages { // TODO: remove hardcoded reference // - // nolint: goconst // ignore making a constant for now + //nolint:goconst // ignore making a constant for now if _stage.Name == "init" { continue } diff --git a/executor/local/local.go b/executor/local/local.go index c974d9e7..db589f84 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -75,7 +75,7 @@ func Equal(a, b *client) bool { // New returns an Executor implementation that integrates with the local system. // -// nolint: revive // ignore unexported type as it is intentional +//nolint:revive // ignore unexported type as it is intentional func New(opts ...Opt) (*client, error) { // create new local client c := new(client) diff --git a/go.mod b/go.mod index 12bef6c0..d89c7231 100644 --- a/go.mod +++ b/go.mod @@ -57,7 +57,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.1 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v44 v44.1.0 // indirect diff --git a/go.sum b/go.sum index f9c596a9..f9b7fc14 100644 --- a/go.sum +++ b/go.sum @@ -190,8 +190,8 @@ github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGF github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/mock/docker/config.go b/mock/docker/config.go index e1d2878e..ebf385cb 100644 --- a/mock/docker/config.go +++ b/mock/docker/config.go @@ -2,7 +2,7 @@ // // Use of this source code is governed by the LICENSE file in this repository. -// nolint: dupl // ignore similar code +//nolint:dupl // ignore similar code package docker import ( diff --git a/mock/docker/container.go b/mock/docker/container.go index d17c1ab7..a39cf3f3 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "strings" "time" @@ -63,7 +62,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe if strings.Contains(ctn, "notfound") && !strings.Contains(ctn, "ignorenotfound") { return container.ContainerCreateCreatedBody{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -72,7 +71,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe if strings.Contains(ctn, "not-found") && !strings.Contains(ctn, "ignore-not-found") { return container.ContainerCreateCreatedBody{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -81,7 +80,7 @@ func (c *ContainerService) ContainerCreate(ctx context.Context, config *containe strings.Contains(config.Image, "not-found") { return container.ContainerCreateCreatedBody{}, errdefs.NotFound( - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", config.Image), ) } @@ -172,7 +171,7 @@ func (c *ContainerService) ContainerInspect(ctx context.Context, ctn string) (ty if strings.Contains(ctn, "notfound") && !strings.Contains(ctn, "ignorenotfound") { return types.ContainerJSON{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -181,7 +180,7 @@ func (c *ContainerService) ContainerInspect(ctx context.Context, ctn string) (ty if strings.Contains(ctn, "not-found") && !strings.Contains(ctn, "ignore-not-found") { return types.ContainerJSON{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -217,7 +216,7 @@ func (c *ContainerService) ContainerInspectWithRaw(ctx context.Context, ctn stri strings.Contains(ctn, "not-found") { return types.ContainerJSON{}, nil, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -256,7 +255,7 @@ func (c *ContainerService) ContainerKill(ctx context.Context, ctn, signal string // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -285,7 +284,7 @@ func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, option // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages return nil, errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -308,7 +307,7 @@ func (c *ContainerService) ContainerLogs(ctx context.Context, ctn string, option return nil, err } - return ioutil.NopCloser(response), nil + return io.NopCloser(response), nil } // ContainerPause is a helper function to simulate @@ -331,7 +330,7 @@ func (c *ContainerService) ContainerRemove(ctx context.Context, ctn string, opti // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -375,7 +374,7 @@ func (c *ContainerService) ContainerStart(ctx context.Context, ctn string, optio // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -412,7 +411,7 @@ func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, timeou // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages return errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) } @@ -464,7 +463,7 @@ func (c *ContainerService) ContainerWait(ctx context.Context, ctn string, condit // check if the container is not found if strings.Contains(ctn, "notfound") || strings.Contains(ctn, "not-found") { // propagate the error to the error channel - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errCh <- errdefs.NotFound(fmt.Errorf("Error: No such container: %s", ctn)) return ctnCh, errCh diff --git a/mock/docker/docker.go b/mock/docker/docker.go index eab1fb7b..58752c18 100644 --- a/mock/docker/docker.go +++ b/mock/docker/docker.go @@ -4,8 +4,6 @@ package docker -// nolint: godot // ignore comment ending in a list -// // Version represents the supported Docker API version for the mock. // // The Docker API version is pinned to ensure compatibility between the @@ -19,11 +17,13 @@ package docker // // * the Docker version of v20.10 has a maximum API version of v1.41 // * to maintain n-1, the API version is pinned to v1.40 +// . const Version = "v1.40" // New returns a client that is capable of handling // Docker client calls and returning stub responses. -// nolint:revive // ignore unexported type as it is intentional +// +//nolint:revive // ignore unexported type as it is intentional func New() (*mock, error) { return &mock{ ConfigService: ConfigService{}, diff --git a/mock/docker/image.go b/mock/docker/image.go index 887d399a..d3cb7dd4 100644 --- a/mock/docker/image.go +++ b/mock/docker/image.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "strings" "time" @@ -90,7 +89,7 @@ func (i *ImageService) ImageInspectWithRaw(ctx context.Context, image string) (t return types.ImageInspect{}, nil, errdefs.NotFound( - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } @@ -165,7 +164,7 @@ func (i *ImageService) ImagePull(ctx context.Context, image string, options type !strings.Contains(image, "ignorenotfound") { return nil, errdefs.NotFound( - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } @@ -176,13 +175,13 @@ func (i *ImageService) ImagePull(ctx context.Context, image string, options type !strings.Contains(image, "ignore-not-found") { return nil, errdefs.NotFound( - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages fmt.Errorf("Error response from daemon: manifest for %s not found: manifest unknown", image), ) } // create response object to return - response := ioutil.NopCloser( + response := io.NopCloser( bytes.NewReader( []byte( fmt.Sprintf("%s\n%s\n%s\n%s\n", diff --git a/mock/docker/network.go b/mock/docker/network.go index a82b8ef7..d00b1a7b 100644 --- a/mock/docker/network.go +++ b/mock/docker/network.go @@ -47,7 +47,7 @@ func (n *NetworkService) NetworkCreate(ctx context.Context, name string, options if strings.Contains(name, "notfound") && !strings.Contains(name, "ignorenotfound") { return types.NetworkCreateResponse{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) } @@ -56,7 +56,7 @@ func (n *NetworkService) NetworkCreate(ctx context.Context, name string, options if strings.Contains(name, "not-found") && !strings.Contains(name, "ignore-not-found") { return types.NetworkCreateResponse{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", name)) } @@ -89,14 +89,14 @@ func (n *NetworkService) NetworkInspect(ctx context.Context, network string, opt // check if the network is notfound if strings.Contains(network, "notfound") { return types.NetworkResource{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) } // check if the network is not-found if strings.Contains(network, "not-found") { return types.NetworkResource{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such network: %s", network)) } diff --git a/mock/docker/secret.go b/mock/docker/secret.go index ca5286c0..add60b1f 100644 --- a/mock/docker/secret.go +++ b/mock/docker/secret.go @@ -2,7 +2,7 @@ // // Use of this source code is governed by the LICENSE file in this repository. -// nolint: dupl // ignore similar code +//nolint:dupl // ignore similar code package docker import ( diff --git a/mock/docker/volume.go b/mock/docker/volume.go index 18bb14e8..952471d6 100644 --- a/mock/docker/volume.go +++ b/mock/docker/volume.go @@ -39,7 +39,7 @@ func (v *VolumeService) VolumeCreate(ctx context.Context, options volume.VolumeC if strings.Contains(options.Name, "notfound") && !strings.Contains(options.Name, "ignorenotfound") { return types.Volume{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) } @@ -48,7 +48,7 @@ func (v *VolumeService) VolumeCreate(ctx context.Context, options volume.VolumeC if strings.Contains(options.Name, "not-found") && !strings.Contains(options.Name, "ignore-not-found") { return types.Volume{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", options.Name)) } @@ -79,14 +79,14 @@ func (v *VolumeService) VolumeInspect(ctx context.Context, volumeID string) (typ // check if the volume is notfound if strings.Contains(volumeID, "notfound") { return types.Volume{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } // check if the volume is not-found if strings.Contains(volumeID, "not-found") { return types.Volume{}, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } @@ -116,14 +116,14 @@ func (v *VolumeService) VolumeInspectWithRaw(ctx context.Context, volumeID strin // check if the volume is notfound if strings.Contains(volumeID, "notfound") { return types.Volume{}, nil, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } // check if the volume is not-found if strings.Contains(volumeID, "not-found") { return types.Volume{}, nil, - // nolint:stylecheck // messsage is capitalized to match Docker messages + //nolint:stylecheck // messsage is capitalized to match Docker messages errdefs.NotFound(fmt.Errorf("Error: No such volume: %s", volumeID)) } diff --git a/router/build.go b/router/build.go index 9035840f..8f0f05c3 100644 --- a/router/build.go +++ b/router/build.go @@ -10,14 +10,13 @@ import ( "github.com/go-vela/worker/api" ) -// nolint: godot // ignore comment ending in period -// // BuildHandlers extends the provided base router group // by adding a collection of endpoints for handling // build related requests. // // GET /api/v1/executors/:executor/build // DELETE /api/v1/executors/:executor/build/cancel +// . func BuildHandlers(base *gin.RouterGroup) { // add a collection of endpoints for handling build related requests // diff --git a/router/executor.go b/router/executor.go index a5c572b5..522fa197 100644 --- a/router/executor.go +++ b/router/executor.go @@ -10,8 +10,6 @@ import ( "github.com/go-vela/worker/router/middleware/executor" ) -// nolint: godot // ignore comment ending in period -// // ExecutorHandlers extends the provided base router group // by adding a collection of endpoints for handling // executor related requests. @@ -22,6 +20,7 @@ import ( // DELETE /api/v1/executors/:executor/build/cancel // GET /api/v1/executors/:executor/pipeline // GET /api/v1/executors/:executor/repo +// . func ExecutorHandlers(base *gin.RouterGroup) { // add a collection of endpoints for handling executors related requests // diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index d20b400d..71553472 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -80,7 +80,7 @@ func TestMiddleware_Logger_Error(t *testing.T) { // setup mock server engine.Use(Logger(logger, time.RFC3339, true)) engine.GET("/foobar", func(c *gin.Context) { - // nolint: errcheck // ignore checking error + //nolint:errcheck // ignore checking error c.Error(fmt.Errorf("test error")) c.Status(http.StatusOK) }) diff --git a/router/middleware/payload.go b/router/middleware/payload.go index 2ef7e5e2..c2241fa9 100644 --- a/router/middleware/payload.go +++ b/router/middleware/payload.go @@ -7,7 +7,7 @@ package middleware import ( "bytes" "encoding/json" - "io/ioutil" + "io" "github.com/gin-gonic/gin" ) @@ -24,7 +24,7 @@ func Payload() gin.HandlerFunc { c.Set("payload", payload) - c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + c.Request.Body = io.NopCloser(bytes.NewBuffer(body)) c.Next() } diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 0327c607..5e437e99 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -10,8 +10,6 @@ import ( "strings" ) -// nolint: godot // ignore comment ending in period -// // Retrieve gets the token from the provided request http.Request // to be parsed and validated. This is called on every request // to enable capturing the user making the request and validating @@ -19,6 +17,7 @@ import ( // authentication to Vela are supported: // // * Bearer token in `Authorization` header +// . func Retrieve(r *http.Request) (string, error) { // get the token from the `Authorization` header token := r.Header.Get("Authorization") diff --git a/router/pipeline.go b/router/pipeline.go index 59b406ee..42868bf2 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -10,13 +10,12 @@ import ( "github.com/go-vela/worker/api" ) -// nolint: godot // ignore comment ending in period -// // PipelineHandlers extends the provided base router group // by adding a collection of endpoints for handling // pipeline related requests. // // GET /api/v1/executors/:executor/pipeline +// . func PipelineHandlers(base *gin.RouterGroup) { // add a collection of endpoints for handling pipeline related requests // diff --git a/router/repo.go b/router/repo.go index ca27b3f6..0f011451 100644 --- a/router/repo.go +++ b/router/repo.go @@ -10,13 +10,12 @@ import ( "github.com/go-vela/worker/api" ) -// nolint: godot // ignore comment ending in period -// // RepoHandlers extends the provided base router group // by adding a collection of endpoints for handling // repo related requests. // // GET /api/v1/executors/:executor/repo +// . func RepoHandlers(base *gin.RouterGroup) { // add a collection of endpoints for handling repo related requests // diff --git a/runtime/context.go b/runtime/context.go index 0579fe60..47487716 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -54,7 +54,7 @@ func FromGinContext(c *gin.Context) Engine { func WithContext(c context.Context, e Engine) context.Context { // set the runtime Engine in the context.Context // - // nolint: revive,staticcheck // ignore using string with context value + //nolint:revive,staticcheck // ignore using string with context value return context.WithValue(c, key, e) } diff --git a/runtime/context_test.go b/runtime/context_test.go index f7e45310..ddac5db8 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -31,7 +31,7 @@ func TestRuntime_FromContext(t *testing.T) { }{ { name: "valid runtime in context", - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, _engine), want: _engine, }, @@ -42,7 +42,7 @@ func TestRuntime_FromContext(t *testing.T) { }, { name: "invalid runtime in context", - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value context: context.WithValue(context.Background(), key, "foo"), want: nil, }, @@ -121,7 +121,7 @@ func TestRuntime_WithContext(t *testing.T) { t.Errorf("unable to create runtime engine: %v", err) } - // nolint: staticcheck,revive // ignore using string with context value + //nolint:staticcheck,revive // ignore using string with context value want := context.WithValue(context.Background(), key, _engine) // run test diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index c286c31f..ba0de3b0 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -10,8 +10,6 @@ import ( "github.com/sirupsen/logrus" ) -// nolint: godot // ignore period at end for comment ending in a list -// // Version represents the supported Docker API version for the mock. // // The Docker API version is pinned to ensure compatibility between the @@ -25,6 +23,7 @@ import ( // // * the Docker version of v20.10 has a maximum API version of v1.41 // * to maintain n-1, the API version is pinned to v1.40 +// . const Version = "v1.40" type config struct { @@ -45,7 +44,7 @@ type client struct { // New returns an Engine implementation that // integrates with a Docker runtime. // -// nolint: revive // ignore returning unexported client +//nolint:revive // ignore returning unexported client func New(opts ...ClientOpt) (*client, error) { // create new Docker client c := new(client) @@ -98,7 +97,7 @@ func New(opts ...ClientOpt) (*client, error) { // // This function is intended for running tests only. // -// nolint: revive // ignore returning unexported client +//nolint:revive // ignore returning unexported client func NewMock(opts ...ClientOpt) (*client, error) { // create new Docker runtime client c, err := New(opts...) diff --git a/runtime/docker/image.go b/runtime/docker/image.go index e53f7be3..8aa45f01 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -8,7 +8,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "strings" @@ -54,7 +53,7 @@ func (c *client) CreateImage(ctx context.Context, ctn *pipeline.Container) error } } else { // discard output from image pull - _, err = io.Copy(ioutil.Discard, reader) + _, err = io.Copy(io.Discard, reader) if err != nil { return err } diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index ab6914c1..e7118de3 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "strings" "time" @@ -267,7 +266,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // peek at container logs from the stream bytes, err := reader.Peek(5) if err != nil { - // nolint: nilerr // ignore nil return + //nolint:nilerr // ignore nil return // skip so we resend API call to capture stream return false, nil } @@ -275,7 +274,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // check if we have container logs from the stream if len(bytes) > 0 { // set the logs to the reader - logs = ioutil.NopCloser(reader) + logs = io.NopCloser(reader) return true, nil } diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index 74369658..cb190171 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -646,7 +646,7 @@ func Test_podTracker_inspectContainerStatuses(t *testing.T) { func() { defer func() { - // nolint: errcheck // repeat close() panics (otherwise it won't) + //nolint:errcheck // repeat close() panics (otherwise it won't) recover() }() diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 5532bafb..aabc2a28 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -57,7 +57,7 @@ type client struct { // New returns an Engine implementation that // integrates with a Kubernetes runtime. // -// nolint: revive // ignore returning unexported client +//nolint:revive // ignore returning unexported client func New(opts ...ClientOpt) (*client, error) { // create new Kubernetes client c := new(client) @@ -137,7 +137,7 @@ func New(opts ...ClientOpt) (*client, error) { // // This function is intended for running tests only. // -// nolint: revive // ignore returning unexported client +//nolint:revive // ignore returning unexported client func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { // create new Kubernetes client c := new(client) diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go index c562d9f1..81076406 100644 --- a/runtime/kubernetes/opts.go +++ b/runtime/kubernetes/opts.go @@ -6,7 +6,7 @@ package kubernetes import ( "fmt" - "io/ioutil" + "os" "github.com/sirupsen/logrus" @@ -91,7 +91,7 @@ func WithPodsTemplate(name string, path string) ClientOpt { if len(name) == 0 { // load the PodsTemplate from the path (must restart Worker to reload the local file) - if data, err := ioutil.ReadFile(path); err == nil { + if data, err := os.ReadFile(path); err == nil { pipelinePodsTemplate := velav1alpha1.PipelinePodsTemplate{} err := yaml.UnmarshalStrict(data, &pipelinePodsTemplate) diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go index a786d193..c22bab7f 100644 --- a/runtime/kubernetes/volume.go +++ b/runtime/kubernetes/volume.go @@ -128,7 +128,8 @@ func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { } // setupVolumeMounts generates the VolumeMounts for a given container. -// nolint:unparam // keep signature similar to Engine interface methods despite unused ctx and err +// +//nolint:unparam // keep signature similar to Engine interface methods despite unused ctx and err func (c *client) setupVolumeMounts(ctx context.Context, ctn *pipeline.Container) ( volumeMounts []v1.VolumeMount, err error, diff --git a/runtime/runtime.go b/runtime/runtime.go index 4ec77e21..d4c25acc 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -11,8 +11,6 @@ import ( "github.com/sirupsen/logrus" ) -// nolint: godot // ignore period at end for comment ending in a list -// // New creates and returns a Vela engine capable of // integrating with the configured runtime. // @@ -20,6 +18,7 @@ import ( // // * docker // * kubernetes +// . func New(s *Setup) (Engine, error) { // validate the setup being provided // From 3777320359e2f3cf3722b4d25f13b5a3624ca755 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 15 Sep 2022 08:54:11 -0600 Subject: [PATCH 321/430] feat(start/server): add minimum TLS version of 1.2 with option to set it differently (#368) --- cmd/vela-worker/flags.go | 6 ++++++ cmd/vela-worker/run.go | 2 ++ cmd/vela-worker/server.go | 30 +++++++++++++++++++++++++++--- cmd/vela-worker/start.go | 5 +++-- cmd/vela-worker/worker.go | 21 +++++++++++---------- 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index cefbacf2..bce7284c 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -85,6 +85,12 @@ func flags() []cli.Flag { Name: "server.cert-key", Usage: "optional TLS certificate key", }, + &cli.StringFlag{ + EnvVars: []string{"WORKER_SERVER_TLS_MIN_VERSION", "VELA_SERVER_TLS_MIN_VERSION", "SERVER_TLS_MIN_VERSION"}, + Name: "server.tls-min-version", + Usage: "optional TLS minimum version requirement", + Value: "1.2", + }, } // Executor Flags diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index a709e27e..c7c1e289 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -130,6 +130,8 @@ func run(c *cli.Context) error { Cert: c.String("server.cert"), Key: c.String("server.cert-key"), }, + // TLS minimum version enforced + TLSMinVersion: c.String("server.tls-min-version"), }, Executors: make(map[int]executor.Engine), } diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index ee79aa95..cecd9210 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -5,6 +5,7 @@ package main import ( + "crypto/tls" "net/http" "os" "strings" @@ -18,7 +19,7 @@ import ( // server is a helper function to listen and serve // traffic for web and API requests for the Worker. -func (w *Worker) server() (http.Handler, bool) { +func (w *Worker) server() (http.Handler, *tls.Config) { // log a message indicating the setup of the server handlers // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Trace @@ -56,10 +57,33 @@ func (w *Worker) server() (http.Handler, bool) { logrus.Fatal("unable to run with TLS: No certificate provided") } - return _server, true + // define TLS config struct for server start up + tlsCfg := new(tls.Config) + + // if a TLS minimum version is supplied, set that in the config + if len(w.Config.TLSMinVersion) > 0 { + var tlsVersion uint16 + + switch w.Config.TLSMinVersion { + case "1.0": + tlsVersion = tls.VersionTLS10 + case "1.1": + tlsVersion = tls.VersionTLS11 + case "1.2": + tlsVersion = tls.VersionTLS12 + case "1.3": + tlsVersion = tls.VersionTLS13 + default: + logrus.Fatal("invalid TLS minimum version supplied") + } + + tlsCfg.MinVersion = tlsVersion + } + + return _server, tlsCfg } // else serve over http // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#Engine.Run - return _server, false + return _server, nil } diff --git a/cmd/vela-worker/start.go b/cmd/vela-worker/start.go index 46193317..6f3b6077 100644 --- a/cmd/vela-worker/start.go +++ b/cmd/vela-worker/start.go @@ -32,11 +32,12 @@ func (w *Worker) Start() error { // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group g, gctx := errgroup.WithContext(ctx) - httpHandler, tls := w.server() + httpHandler, tlsCfg := w.server() server := &http.Server{ Addr: fmt.Sprintf(":%s", w.Config.API.Address.Port()), Handler: httpHandler, + TLSConfig: tlsCfg, ReadHeaderTimeout: 60 * time.Second, } @@ -69,7 +70,7 @@ func (w *Worker) Start() error { g.Go(func() error { var err error logrus.Info("starting worker server") - if tls { + if tlsCfg != nil { if err := server.ListenAndServeTLS(w.Config.Certificate.Cert, w.Config.Certificate.Key); !errors.Is(err, http.ErrServerClosed) { // log a message indicating the start of the server // diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 32c1ce14..1d21e75c 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -46,16 +46,17 @@ type ( // Config represents the worker configuration. Config struct { - Mock bool // Mock should only be true for tests - API *API - Build *Build - CheckIn time.Duration - Executor *executor.Setup - Logger *Logger - Queue *queue.Setup - Runtime *runtime.Setup - Server *Server - Certificate *Certificate + Mock bool // Mock should only be true for tests + API *API + Build *Build + CheckIn time.Duration + Executor *executor.Setup + Logger *Logger + Queue *queue.Setup + Runtime *runtime.Setup + Server *Server + Certificate *Certificate + TLSMinVersion string } // Worker represents all configuration and From 917ddd1eb5ce95ee47e19404266f40f88c8b95f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:10:33 -0500 Subject: [PATCH 322/430] fix(deps): update kubernetes packages to v0.25.0 (#365) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 27 +++++------ go.sum | 138 ++++++++++++--------------------------------------------- 2 files changed, 42 insertions(+), 123 deletions(-) diff --git a/go.mod b/go.mod index d89c7231..5507d81b 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220907140024-f12130a52804 gotest.tools/v3 v3.3.0 - k8s.io/api v0.24.3 - k8s.io/apimachinery v0.24.3 - k8s.io/client-go v0.24.3 + k8s.io/api v0.25.0 + k8s.io/apimachinery v0.25.0 + k8s.io/client-go v0.25.0 sigs.k8s.io/yaml v1.3.0 ) @@ -43,11 +43,11 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/drone/envsubst v1.0.3 // indirect - github.com/emicklei/go-restful v2.9.5+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v1.2.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/swag v0.19.14 // indirect @@ -64,6 +64,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/mux v1.8.0 // indirect github.com/goware/urlx v0.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -99,10 +100,10 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect - golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect @@ -113,9 +114,9 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.60.1 // indirect - k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect - k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect - sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + k8s.io/klog/v2 v2.70.1 // indirect + k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index f9b7fc14..6a6296fb 100644 --- a/go.sum +++ b/go.sum @@ -17,9 +17,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -41,13 +38,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb h1:ZVN4Iat3runWOFLaBCDVU5a9X/XikSRBosye++6gojw= 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= @@ -59,7 +49,6 @@ github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmy github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= @@ -74,8 +63,6 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo= github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -118,10 +105,8 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -132,12 +117,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -156,13 +136,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -196,7 +175,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -204,7 +182,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -225,7 +202,6 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -236,7 +212,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= @@ -246,7 +221,6 @@ github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5A github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -262,8 +236,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -274,10 +246,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -293,13 +263,11 @@ github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1 github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= 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= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -344,11 +312,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -360,31 +326,21 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -463,7 +419,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -472,7 +427,6 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= @@ -483,12 +437,11 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -522,10 +475,8 @@ 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/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= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -549,25 +500,21 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -577,10 +524,7 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= @@ -594,12 +538,10 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= golang.org/x/sync v0.0.0-20220907140024-f12130a52804/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -611,11 +553,8 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -630,7 +569,6 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -643,24 +581,20 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/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-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -714,7 +648,6 @@ 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-20200505023115-26f46d2f7ef8/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= @@ -730,7 +663,6 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -754,8 +686,6 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -801,11 +731,7 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -841,7 +767,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -852,12 +777,10 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -882,30 +805,25 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= -k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= -k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= -k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= -k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= +k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= +k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= +k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= +k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= +k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= -k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= +k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From 2e7eceb3dcba2cc611c96c69106f3138cfe3eb92 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:20:45 -0500 Subject: [PATCH 323/430] fix(deps): update module github.com/docker/go-units to v0.5.0 (#366) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5507d81b..92471f48 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.10+incompatible - github.com/docker/go-units v0.4.0 + github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.14.0 github.com/go-vela/server v0.14.3 diff --git a/go.sum b/go.sum index 6a6296fb..d1fa0194 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJ github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= From 47b889f0931e43678f283fa852f2414a9c5b05ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:41:26 -0500 Subject: [PATCH 324/430] fix(deps): update module github.com/docker/docker to v20.10.18+incompatible (#373) * fix(deps): update module github.com/docker/docker to v20.10.18+incompatible * fix it Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: wass3r --- go.mod | 6 +----- go.sum | 28 ++-------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 92471f48..abab07be 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.10+incompatible + github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.14.0 @@ -36,7 +36,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/containerd/containerd v1.4.13 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -64,7 +63,6 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/gorilla/mux v1.8.0 // indirect github.com/goware/urlx v0.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -108,8 +106,6 @@ require ( golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect - google.golang.org/grpc v1.41.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index d1fa0194..13e58b12 100644 --- a/go.sum +++ b/go.sum @@ -62,7 +62,6 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZp github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo= github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -80,9 +79,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/containerd/containerd v1.4.13 h1:Z0CbagVdn9VN4K6htOCY/jApSw8YKP+RdLZ5dkXF8PM= -github.com/containerd/containerd v1.4.13/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= @@ -96,8 +92,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.10+incompatible h1:GKkP0T7U4ks6X3lmmHKC2QDprnpRJor2Z5a8m62R9ZM= -github.com/docker/docker v20.10.10+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.18+incompatible h1:SN84VYXTBNGn92T/QwIRPlum9zfemfitN7pbsp26WSc= +github.com/docker/docker v20.10.18+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -112,7 +108,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -197,7 +192,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -244,11 +238,8 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -374,7 +365,6 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= @@ -427,7 +417,6 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -509,7 +498,6 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -582,8 +570,6 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -604,7 +590,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -717,7 +702,6 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -732,8 +716,6 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -747,14 +729,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -783,7 +760,6 @@ gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From ae6ec7c32f4cc1ffad9aa4b2f4ce4e69ec42362d Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 16 Sep 2022 13:36:09 -0500 Subject: [PATCH 325/430] chore: change default branch to main (#378) --- .github/CONTRIBUTING.md | 2 +- .github/README.md | 2 +- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8625ad9e..147650c2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -73,7 +73,7 @@ make clean ```bash # push your code up to your fork -git push fork master +git push fork main ``` * Make sure to follow our [PR process](https://go-vela.github.io/docs/community/contributing_guidelines/#development-workflow) when opening a pull request diff --git a/.github/README.md b/.github/README.md index 02e630e7..9c23e1e9 100644 --- a/.github/README.md +++ b/.github/README.md @@ -3,7 +3,7 @@ [![license](https://img.shields.io/crates/l/gl.svg)](../LICENSE) [![GoDoc](https://godoc.org/github.com/go-vela/worker?status.svg)](https://godoc.org/github.com/go-vela/worker) [![Go Report Card](https://goreportcard.com/badge/go-vela/worker)](https://goreportcard.com/report/go-vela/worker) -[![codecov](https://codecov.io/gh/go-vela/worker/branch/master/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) +[![codecov](https://codecov.io/gh/go-vela/worker/branch/main/graph/badge.svg)](https://codecov.io/gh/go-vela/worker) > Vela is in active development and is a pre-release product. > diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 20575b78..5e9521e2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [ main ] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [ main ] schedule: - cron: '38 18 * * 1' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 45350807..21d4803e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,10 @@ # name of the action name: publish -# trigger on push events with branch master +# trigger on push events with branch main on: push: - branches: [ master ] + branches: [ main ] # pipeline to execute jobs: From 557b793c96f2ae417d82dbd4b319110d867b52b4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 16:26:06 -0500 Subject: [PATCH 326/430] fix(deps): update deps (patch) to v0.25.1 (#377) --- go.mod | 6 +++--- go.sum | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index abab07be..216e5605 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220907140024-f12130a52804 gotest.tools/v3 v3.3.0 - k8s.io/api v0.25.0 - k8s.io/apimachinery v0.25.0 - k8s.io/client-go v0.25.0 + k8s.io/api v0.25.1 + k8s.io/apimachinery v0.25.1 + k8s.io/client-go v0.25.1 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 13e58b12..f0205635 100644 --- a/go.sum +++ b/go.sum @@ -324,8 +324,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= +github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -781,12 +781,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= -k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= -k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= +k8s.io/api v0.25.1 h1:yL7du50yc93k17nH/Xe9jujAYrcDkI/i5DL1jPz4E3M= +k8s.io/api v0.25.1/go.mod h1:hh4itDvrWSJsmeUc28rIFNri8MatNAAxJjKcQmhX6TU= +k8s.io/apimachinery v0.25.1 h1:t0XrnmCEHVgJlR2arwO8Awp9ylluDic706WePaYCBTI= +k8s.io/apimachinery v0.25.1/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= +k8s.io/client-go v0.25.1 h1:uFj4AJKtE1/ckcSKz8IhgAuZTdRXZDKev8g387ndD58= +k8s.io/client-go v0.25.1/go.mod h1:rdFWTLV/uj2C74zGbQzOsmXPUtMAjSf7ajil4iJUNKo= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 86f0370dbfd7bef8d1972c08507d32ddf3f135cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:34:26 -0500 Subject: [PATCH 327/430] fix(deps): update deps (patch) to v0.25.2 (#379) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 216e5605..8b8d17c0 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.11.1 golang.org/x/sync v0.0.0-20220907140024-f12130a52804 gotest.tools/v3 v3.3.0 - k8s.io/api v0.25.1 - k8s.io/apimachinery v0.25.1 - k8s.io/client-go v0.25.1 + k8s.io/api v0.25.2 + k8s.io/apimachinery v0.25.2 + k8s.io/client-go v0.25.2 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index f0205635..0264e3ee 100644 --- a/go.sum +++ b/go.sum @@ -781,12 +781,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.1 h1:yL7du50yc93k17nH/Xe9jujAYrcDkI/i5DL1jPz4E3M= -k8s.io/api v0.25.1/go.mod h1:hh4itDvrWSJsmeUc28rIFNri8MatNAAxJjKcQmhX6TU= -k8s.io/apimachinery v0.25.1 h1:t0XrnmCEHVgJlR2arwO8Awp9ylluDic706WePaYCBTI= -k8s.io/apimachinery v0.25.1/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= -k8s.io/client-go v0.25.1 h1:uFj4AJKtE1/ckcSKz8IhgAuZTdRXZDKev8g387ndD58= -k8s.io/client-go v0.25.1/go.mod h1:rdFWTLV/uj2C74zGbQzOsmXPUtMAjSf7ajil4iJUNKo= +k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8= +k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0= +k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= +k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= +k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= +k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 68527e8585297a797a92723fcc4b21757cb3b9c0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:39:42 -0500 Subject: [PATCH 328/430] fix(deps): update golang.org/x/sync digest to 7f9b162 (#380) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8b8d17c0..da46eb9f 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.11.1 - golang.org/x/sync v0.0.0-20220907140024-f12130a52804 + golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 gotest.tools/v3 v3.3.0 k8s.io/api v0.25.2 k8s.io/apimachinery v0.25.2 diff --git a/go.sum b/go.sum index 0264e3ee..c741ec86 100644 --- a/go.sum +++ b/go.sum @@ -526,8 +526,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= -golang.org/x/sync v0.0.0-20220907140024-f12130a52804/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From c20342307c7cf747c9078f0b6e55e555c17bac09 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:48:13 -0500 Subject: [PATCH 329/430] chore: v0.15.0-rc1 prep (#381) --- go.mod | 24 ++++++++++++------------ go.sum | 49 +++++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/go.mod b/go.mod index da46eb9f..455cf1fb 100644 --- a/go.mod +++ b/go.mod @@ -8,15 +8,15 @@ require ( github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.14.0 - github.com/go-vela/server v0.14.3 - github.com/go-vela/types v0.14.0 + github.com/go-vela/sdk-go v0.15.0-rc1 + github.com/go-vela/server v0.15.0-rc1 + github.com/go-vela/types v0.15.0-rc1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.11.1 + github.com/urfave/cli/v2 v2.16.3 golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 gotest.tools/v3 v3.3.0 k8s.io/api v0.25.2 @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.22.0 // indirect + github.com/alicebob/miniredis/v2 v2.23.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -63,7 +63,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/goware/urlx v0.3.1 // indirect + github.com/goware/urlx v0.3.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -91,18 +91,18 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect - go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect + go.starlark.net v0.0.0-20220926145019-14b050677505 // indirect golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect + golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect + golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect + golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index c741ec86..b36e1afb 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo= -github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= +github.com/alicebob/miniredis/v2 v2.23.0 h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw= +github.com/alicebob/miniredis/v2 v2.23.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -142,8 +142,8 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.14.0 h1:JWQnGNsnlEiWh77cTY+YSgvKUGxliE0oWWQYAKysF6s= -github.com/go-vela/sdk-go v0.14.0/go.mod h1:xrl/pF9k6Xzu+fchm7SrJJPdqgVCTLQBdB+L/lyCfjg= -github.com/go-vela/server v0.14.3 h1:IE34fpK7b7tr5a8GldAOCkkMhzQ3QBgZDl428Aa9OjI= -github.com/go-vela/server v0.14.3/go.mod h1:2drMGkMjrOXOe5H5M6lSbXjN4hvTxi1tUwTO9OX8jcM= -github.com/go-vela/types v0.14.0 h1:m75BdRfQm9PC4l/oHSgeplt8mqgau3JmqD3DN+KdePk= -github.com/go-vela/types v0.14.0/go.mod h1:Z/94BulwLbd+bSiPVJEUNdQxB1EP2JCYWaBsv/d65vs= +github.com/go-vela/sdk-go v0.15.0-rc1 h1:FLFRBxlCrPhVVHck1mxDid3V1YHTDmOwFUyON6Jxwpc= +github.com/go-vela/sdk-go v0.15.0-rc1/go.mod h1:0Ix3Y21pqMmsCLSB1315AhLfokk/+ddMxmkOP9Grs/Q= +github.com/go-vela/server v0.15.0-rc1 h1:JrFkGlms4LX1qaJE4M6RDZ2eawgrnCGtH3OEDZ0jWoo= +github.com/go-vela/server v0.15.0-rc1/go.mod h1:cKzkU5txTQVsxVg8TekoqLRI8mBt9vRovTxR5XsQ7Us= +github.com/go-vela/types v0.15.0-rc1 h1:CTXplhQ7mc1yjbWiM6UbE9qPgGE4yBrPBKC0a/rkFDo= +github.com/go-vela/types v0.15.0-rc1/go.mod h1:hQSy2STPChcHk53RFWCEg0gnjHXop+/bVAPkiU9YIqo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -238,8 +238,8 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI= -github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= +github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo= +github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -380,8 +380,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -401,8 +401,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE= -github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/urfave/cli/v2 v2.16.3 h1:gHoFIwpPjoyIMbJp/VFd+/vuD0dAgFK4B6DpEMFJfQk= +github.com/urfave/cli/v2 v2.16.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -417,8 +417,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM= -go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0= +go.starlark.net v0.0.0-20220926145019-14b050677505 h1:W0MibAL5BiEenQR+F/EF/a4HJhgLngHVvm6jbtUW0PM= +go.starlark.net v0.0.0-20220926145019-14b050677505/go.mod h1:qsNirHv+Awo5xHuNyQ/0niov6kDxdBs+bqpVMBCW77k= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -501,8 +501,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -514,8 +514,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= -golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -579,11 +579,12 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 0cd51c862fe15a10ef98223b84991aae76a141a6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 13:40:30 -0500 Subject: [PATCH 330/430] fix(deps): update module github.com/urfave/cli/v2 to v2.17.1 (#383) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 455cf1fb..343ab09f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.16.3 + github.com/urfave/cli/v2 v2.17.1 golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 gotest.tools/v3 v3.3.0 k8s.io/api v0.25.2 diff --git a/go.sum b/go.sum index b36e1afb..9dc3aecc 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.16.3 h1:gHoFIwpPjoyIMbJp/VFd+/vuD0dAgFK4B6DpEMFJfQk= -github.com/urfave/cli/v2 v2.16.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= +github.com/urfave/cli/v2 v2.17.1 h1:UzjDEw2dJQUE3iRaiNQ1VrVFbyAtKGH3VdkMoHA58V0= +github.com/urfave/cli/v2 v2.17.1/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 5e7876ac118504592ba9acdea8707ed3646c4e7e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 14:00:37 -0500 Subject: [PATCH 331/430] fix(deps): update golang.org/x/sync digest to 8fcdb60 (#382) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 343ab09f..80dc3816 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.17.1 - golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 + golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 gotest.tools/v3 v3.3.0 k8s.io/api v0.25.2 k8s.io/apimachinery v0.25.2 diff --git a/go.sum b/go.sum index 9dc3aecc..339d5edf 100644 --- a/go.sum +++ b/go.sum @@ -526,8 +526,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc= -golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From c150290ef0fafa9a672cffbd58d72169226fb7f3 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:53:23 -0500 Subject: [PATCH 332/430] chore: v0.15.0-rc2 (#384) --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 80dc3816..567b1add 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.15.0-rc1 - github.com/go-vela/server v0.15.0-rc1 - github.com/go-vela/types v0.15.0-rc1 + github.com/go-vela/sdk-go v0.15.0-rc2 + github.com/go-vela/server v0.15.0-rc2 + github.com/go-vela/types v0.15.0-rc2 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -97,9 +97,9 @@ require ( github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect - go.starlark.net v0.0.0-20220926145019-14b050677505 // indirect - golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect - golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect + go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect + golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect diff --git a/go.sum b/go.sum index 339d5edf..f44741eb 100644 --- a/go.sum +++ b/go.sum @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.15.0-rc1 h1:FLFRBxlCrPhVVHck1mxDid3V1YHTDmOwFUyON6Jxwpc= -github.com/go-vela/sdk-go v0.15.0-rc1/go.mod h1:0Ix3Y21pqMmsCLSB1315AhLfokk/+ddMxmkOP9Grs/Q= -github.com/go-vela/server v0.15.0-rc1 h1:JrFkGlms4LX1qaJE4M6RDZ2eawgrnCGtH3OEDZ0jWoo= -github.com/go-vela/server v0.15.0-rc1/go.mod h1:cKzkU5txTQVsxVg8TekoqLRI8mBt9vRovTxR5XsQ7Us= -github.com/go-vela/types v0.15.0-rc1 h1:CTXplhQ7mc1yjbWiM6UbE9qPgGE4yBrPBKC0a/rkFDo= -github.com/go-vela/types v0.15.0-rc1/go.mod h1:hQSy2STPChcHk53RFWCEg0gnjHXop+/bVAPkiU9YIqo= +github.com/go-vela/sdk-go v0.15.0-rc2 h1:1V5EC0EO/yVH35zncK8Br4psNJ6eO67nxokOtsYtDKw= +github.com/go-vela/sdk-go v0.15.0-rc2/go.mod h1:J/283rs+rHcs6ae3SOgLUu1wUNaHi4whC3Wi8X49HRs= +github.com/go-vela/server v0.15.0-rc2 h1:J5bc3gDkZAFeHtzZflLnKNp6oxuygWkQ+zQlm9vbb1U= +github.com/go-vela/server v0.15.0-rc2/go.mod h1:AVDcDFdhiotCVQcfvvvve5ylb55eXkkmgVudwdGojho= +github.com/go-vela/types v0.15.0-rc2 h1:k+U3OAFmyfQw4Wg6YKXFBDzUKCtejJweNpOHChtRrgs= +github.com/go-vela/types v0.15.0-rc2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -417,8 +417,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20220926145019-14b050677505 h1:W0MibAL5BiEenQR+F/EF/a4HJhgLngHVvm6jbtUW0PM= -go.starlark.net v0.0.0-20220926145019-14b050677505/go.mod h1:qsNirHv+Awo5xHuNyQ/0niov6kDxdBs+bqpVMBCW77k= +go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d h1:aF+anaRVZu22kdETjLavnIn/cvD+arhmik6vMU3joW4= +go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -429,8 +429,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -501,8 +501,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= +golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From f1cf0ccb633f4c72830bcb9c2e3be9afe3f6a2ca Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:47:38 -0500 Subject: [PATCH 333/430] chore: v0.15.0 release prep (#385) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 567b1add..b3bf47e0 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.15.0-rc2 - github.com/go-vela/server v0.15.0-rc2 - github.com/go-vela/types v0.15.0-rc2 + github.com/go-vela/sdk-go v0.15.0 + github.com/go-vela/server v0.15.0 + github.com/go-vela/types v0.15.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index f44741eb..aa345ff7 100644 --- a/go.sum +++ b/go.sum @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.15.0-rc2 h1:1V5EC0EO/yVH35zncK8Br4psNJ6eO67nxokOtsYtDKw= -github.com/go-vela/sdk-go v0.15.0-rc2/go.mod h1:J/283rs+rHcs6ae3SOgLUu1wUNaHi4whC3Wi8X49HRs= -github.com/go-vela/server v0.15.0-rc2 h1:J5bc3gDkZAFeHtzZflLnKNp6oxuygWkQ+zQlm9vbb1U= -github.com/go-vela/server v0.15.0-rc2/go.mod h1:AVDcDFdhiotCVQcfvvvve5ylb55eXkkmgVudwdGojho= -github.com/go-vela/types v0.15.0-rc2 h1:k+U3OAFmyfQw4Wg6YKXFBDzUKCtejJweNpOHChtRrgs= -github.com/go-vela/types v0.15.0-rc2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.15.0 h1:a7CqkM47mnuCC0aMJsm67YubbSHM9mokNFei1cDsndg= +github.com/go-vela/sdk-go v0.15.0/go.mod h1:RxmxVIzayX3OfFcuCdKc8Xcus3R0Iys7FxW9Y1Uzk+8= +github.com/go-vela/server v0.15.0 h1:QsSUDQ9qjtebE3yY1jOidlSIxu8Eq4AbFo+g3JMvL4M= +github.com/go-vela/server v0.15.0/go.mod h1:uJMDUJwLgXCAqirf+uz6q3/Icd0H93ZuB0fYXJN7oaw= +github.com/go-vela/types v0.15.0 h1:dlNWfcypxMHIDJU9doBbNRHidwZWq9dhYfbfMR29do8= +github.com/go-vela/types v0.15.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From 857872f55ac386a0f6a210f8af3399241b07b4d2 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 7 Oct 2022 09:48:28 -0500 Subject: [PATCH 334/430] fix(actions): make sure to use latest Go version (#386) --- .github/workflows/build.yml | 1 + .github/workflows/prerelease.yml | 1 + .github/workflows/publish.yml | 1 + .github/workflows/reviewdog.yml | 9 +++++++++ .github/workflows/spec.yml | 1 + .github/workflows/test.yml | 1 + .github/workflows/validate.yml | 1 + 7 files changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75a74bdf..985f50f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: build run: | diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3b939d52..adb370ed 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -25,6 +25,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: setup run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 21d4803e..5d2b56f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: build env: diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 159de15a..9574e121 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -13,6 +13,14 @@ jobs: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + check-latest: true + - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 with: @@ -34,6 +42,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index e57fa650..049f6fc3 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -21,6 +21,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: tags run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63823c60..b71bbd08 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: test run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 9c1cc5d1..1d46947a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,6 +21,7 @@ jobs: # use version from go.mod file go-version-file: 'go.mod' cache: true + check-latest: true - name: validate run: | From af09a7e970d0c979407f72a9f51856a1b35add4e Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Fri, 7 Oct 2022 11:06:25 -0500 Subject: [PATCH 335/430] chore: update deps for v0.15.1 (#387) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b3bf47e0..616fefca 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.15.0 - github.com/go-vela/server v0.15.0 - github.com/go-vela/types v0.15.0 + github.com/go-vela/sdk-go v0.15.1 + github.com/go-vela/server v0.15.1 + github.com/go-vela/types v0.15.1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index aa345ff7..f77c5f48 100644 --- a/go.sum +++ b/go.sum @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.15.0 h1:a7CqkM47mnuCC0aMJsm67YubbSHM9mokNFei1cDsndg= -github.com/go-vela/sdk-go v0.15.0/go.mod h1:RxmxVIzayX3OfFcuCdKc8Xcus3R0Iys7FxW9Y1Uzk+8= -github.com/go-vela/server v0.15.0 h1:QsSUDQ9qjtebE3yY1jOidlSIxu8Eq4AbFo+g3JMvL4M= -github.com/go-vela/server v0.15.0/go.mod h1:uJMDUJwLgXCAqirf+uz6q3/Icd0H93ZuB0fYXJN7oaw= -github.com/go-vela/types v0.15.0 h1:dlNWfcypxMHIDJU9doBbNRHidwZWq9dhYfbfMR29do8= -github.com/go-vela/types v0.15.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.15.1 h1:DEH5DzamH3InTXeXE2iiKiiQhu/NILWna+zb+ceXEFA= +github.com/go-vela/sdk-go v0.15.1/go.mod h1:QjYqC1bbrDshUVaScUwtNgj3P/uqctdUHfD2agm6OCU= +github.com/go-vela/server v0.15.1 h1:7J9QfFXNVREhX4mILCWyqZE3o29a2oThEN2WeQ/wWF4= +github.com/go-vela/server v0.15.1/go.mod h1:k3p4ZhDKYKVO3rbkCAow3N/01f2Iel9KDR2yTaH90UI= +github.com/go-vela/types v0.15.1 h1:nQxfxoqxavuTYtvFJW4wK9UkkADN2VG6Z4ubvJ8PT1s= +github.com/go-vela/types v0.15.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From ec228903300394acac581a632e878df33b88c5d6 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 21 Oct 2022 18:35:50 -0500 Subject: [PATCH 336/430] wip: queue public key for opening signed items --- cmd/vela-worker/exec.go | 4 ++++ cmd/vela-worker/flags.go | 1 - cmd/vela-worker/run.go | 11 ++++++----- docker-compose.yml | 2 ++ go.mod | 2 ++ go.sum | 2 -- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 0e05264c..bc11347d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,6 +6,7 @@ package main import ( "context" + "fmt" "time" "github.com/go-vela/worker/executor" @@ -28,10 +29,13 @@ func (w *Worker) exec(index int) error { // capture an item from the queue item, err := w.Queue.Pop(context.Background()) if err != nil { + fmt.Println("error popping item: " + err.Error()) + return err } if item == nil { + fmt.Println("popped nil item") return nil } diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index bce7284c..03eb8791 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -19,7 +19,6 @@ import ( // for the Worker. func flags() []cli.Flag { f := []cli.Flag{ - &cli.StringFlag{ EnvVars: []string{"WORKER_ADDR", "VELA_WORKER_ADDR", "VELA_WORKER"}, Name: "worker.addr", diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index c7c1e289..b41f45c2 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -114,11 +114,12 @@ func run(c *cli.Context) error { }, // queue configuration Queue: &queue.Setup{ - Driver: c.String("queue.driver"), - Address: c.String("queue.addr"), - Cluster: c.Bool("queue.cluster"), - Routes: c.StringSlice("queue.routes"), - Timeout: c.Duration("queue.pop.timeout"), + Driver: c.String("queue.driver"), + Address: c.String("queue.addr"), + Cluster: c.Bool("queue.cluster"), + Routes: c.StringSlice("queue.routes"), + Timeout: c.Duration("queue.pop.timeout"), + EncodedSigningPublicKey: c.String("queue.signing.public-key"), }, // server configuration Server: &Server{ diff --git a/docker-compose.yml b/docker-compose.yml index 876a9ff4..31dab459 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,7 @@ services: VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' WORKER_CHECK_IN: 5m + VELA_SIGNING_PUBLIC_KEY: 'FVMNLuknxHlsCh23dLO6HCg6oQxmsOjf6aapAeSZS4Y=' restart: always ports: - "8081:8080" @@ -73,6 +74,7 @@ services: VELA_ACCESS_TOKEN_DURATION: 60m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' + VELA_SIGNING_PRIVATE_KEY: 'Y9B5lVd5X/qWu931995HitA/u4oGRjxcfXyIO91tex4VUw0u6SfEeWwKHbd0s7ocKDqhDGaw6N/ppqkB5JlLhg==' env_file: - .env restart: always diff --git a/go.mod b/go.mod index 616fefca..42e0fed7 100644 --- a/go.mod +++ b/go.mod @@ -116,3 +116,5 @@ require ( sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) + +replace github.com/go-vela/server => /Users/Z0031T3/dev/external/go-vela/server diff --git a/go.sum b/go.sum index f77c5f48..793eb10f 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,6 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/sdk-go v0.15.1 h1:DEH5DzamH3InTXeXE2iiKiiQhu/NILWna+zb+ceXEFA= github.com/go-vela/sdk-go v0.15.1/go.mod h1:QjYqC1bbrDshUVaScUwtNgj3P/uqctdUHfD2agm6OCU= -github.com/go-vela/server v0.15.1 h1:7J9QfFXNVREhX4mILCWyqZE3o29a2oThEN2WeQ/wWF4= -github.com/go-vela/server v0.15.1/go.mod h1:k3p4ZhDKYKVO3rbkCAow3N/01f2Iel9KDR2yTaH90UI= github.com/go-vela/types v0.15.1 h1:nQxfxoqxavuTYtvFJW4wK9UkkADN2VG6Z4ubvJ8PT1s= github.com/go-vela/types v0.15.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= From a706e89da2d19954095be567035da4a8014e71a5 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 21 Oct 2022 18:42:43 -0500 Subject: [PATCH 337/430] revert: changes for testing --- cmd/vela-worker/exec.go | 4 ---- cmd/vela-worker/flags.go | 1 + go.mod | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index bc11347d..0e05264c 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,7 +6,6 @@ package main import ( "context" - "fmt" "time" "github.com/go-vela/worker/executor" @@ -29,13 +28,10 @@ func (w *Worker) exec(index int) error { // capture an item from the queue item, err := w.Queue.Pop(context.Background()) if err != nil { - fmt.Println("error popping item: " + err.Error()) - return err } if item == nil { - fmt.Println("popped nil item") return nil } diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index 03eb8791..bce7284c 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -19,6 +19,7 @@ import ( // for the Worker. func flags() []cli.Flag { f := []cli.Flag{ + &cli.StringFlag{ EnvVars: []string{"WORKER_ADDR", "VELA_WORKER_ADDR", "VELA_WORKER"}, Name: "worker.addr", diff --git a/go.mod b/go.mod index 42e0fed7..616fefca 100644 --- a/go.mod +++ b/go.mod @@ -116,5 +116,3 @@ require ( sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) - -replace github.com/go-vela/server => /Users/Z0031T3/dev/external/go-vela/server From fa7841069c7452e52a77b9359d37be512236ef8b Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 21 Oct 2022 18:43:11 -0500 Subject: [PATCH 338/430] fix: tidy --- go.sum | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.sum b/go.sum index 793eb10f..f77c5f48 100644 --- a/go.sum +++ b/go.sum @@ -155,6 +155,8 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/sdk-go v0.15.1 h1:DEH5DzamH3InTXeXE2iiKiiQhu/NILWna+zb+ceXEFA= github.com/go-vela/sdk-go v0.15.1/go.mod h1:QjYqC1bbrDshUVaScUwtNgj3P/uqctdUHfD2agm6OCU= +github.com/go-vela/server v0.15.1 h1:7J9QfFXNVREhX4mILCWyqZE3o29a2oThEN2WeQ/wWF4= +github.com/go-vela/server v0.15.1/go.mod h1:k3p4ZhDKYKVO3rbkCAow3N/01f2Iel9KDR2yTaH90UI= github.com/go-vela/types v0.15.1 h1:nQxfxoqxavuTYtvFJW4wK9UkkADN2VG6Z4ubvJ8PT1s= github.com/go-vela/types v0.15.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= From 6f8236e400d002d4df7060b54f6cf83eb7ae5360 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 26 Oct 2022 06:58:57 -0500 Subject: [PATCH 339/430] refactor: move kubernetes runtime mock code to separate file (#389) --- codecov.yml | 8 +++ runtime/kubernetes/kubernetes.go | 76 ---------------------------- runtime/kubernetes/mock.go | 87 ++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 76 deletions(-) create mode 100644 runtime/kubernetes/mock.go diff --git a/codecov.yml b/codecov.yml index e6503ede..2e7fff30 100644 --- a/codecov.yml +++ b/codecov.yml @@ -32,6 +32,14 @@ coverage: # disable the changes status report changes: off +# This section provides the configuration that tells +# codecov to ignore files matching these files or patterns. +# +# https://docs.codecov.io/docs/codecovyml-reference#section-ignore +ignore: + # this is only for tests, so reporting coverage is misleading. + - runtime/kubernetes/mock.go + # This section provides the configuration for the # parsers codecov uses for the coverage report. # diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index aabc2a28..d9cbdfcd 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -6,17 +6,13 @@ package kubernetes import ( "github.com/sirupsen/logrus" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" velaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned" - fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" ) type config struct { @@ -131,75 +127,3 @@ func New(opts ...ClientOpt) (*client, error) { return c, nil } - -// NewMock returns an Engine implementation that -// integrates with a Kubernetes runtime. -// -// This function is intended for running tests only. -// -//nolint:revive // ignore returning unexported client -func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { - // create new Kubernetes client - c := new(client) - - // create new fields - c.config = new(config) - c.Pod = new(v1.Pod) - - c.containersLookup = map[string]int{} - for i, ctn := range _pod.Spec.Containers { - c.containersLookup[ctn.Name] = i - } - - // create new logger for the client - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger - logger := logrus.StandardLogger() - - // create new logger for the client - // - // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry - c.Logger = logrus.NewEntry(logger) - - // set the Kubernetes namespace in the runtime client - c.config.Namespace = "test" - - // set the Kubernetes pod in the runtime client - c.Pod = _pod.DeepCopy() - c.Pod.SetResourceVersion("0") - - // apply all provided configuration options - for _, opt := range opts { - err := opt(c) - if err != nil { - return nil, err - } - } - - // set the Kubernetes fake client in the runtime client - // - // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset - c.Kubernetes = fake.NewSimpleClientset(c.Pod) - - // set the VelaKubernetes fake client in the runtime client - c.VelaKubernetes = fakeVelaK8sClient.NewSimpleClientset( - &velav1alpha1.PipelinePodsTemplate{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: c.config.Namespace, - Name: "mock-pipeline-pods-template", - }, - }, - ) - - // set the PodTracker (normally populated in SetupBuild) - tracker, err := mockPodTracker(c.Logger, c.Kubernetes, c.Pod) - if err != nil { - return c, err - } - - c.PodTracker = tracker - - // The test is responsible for calling c.PodTracker.Start() if needed - - return c, nil -} diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go new file mode 100644 index 00000000..602dde07 --- /dev/null +++ b/runtime/kubernetes/mock.go @@ -0,0 +1,87 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package kubernetes + +import ( + "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/fake" + + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" + fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" +) + +// NewMock returns an Engine implementation that +// integrates with a Kubernetes runtime. +// +// This function is intended for running tests only. +// +//nolint:revive // ignore returning unexported client +func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { + // create new Kubernetes client + c := new(client) + + // create new fields + c.config = new(config) + c.Pod = new(v1.Pod) + + c.containersLookup = map[string]int{} + for i, ctn := range _pod.Spec.Containers { + c.containersLookup[ctn.Name] = i + } + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#StandardLogger + logger := logrus.StandardLogger() + + // create new logger for the client + // + // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#NewEntry + c.Logger = logrus.NewEntry(logger) + + // set the Kubernetes namespace in the runtime client + c.config.Namespace = "test" + + // set the Kubernetes pod in the runtime client + c.Pod = _pod.DeepCopy() + c.Pod.SetResourceVersion("0") + + // apply all provided configuration options + for _, opt := range opts { + err := opt(c) + if err != nil { + return nil, err + } + } + + // set the Kubernetes fake client in the runtime client + // + // https://pkg.go.dev/k8s.io/client-go/kubernetes/fake?tab=doc#NewSimpleClientset + c.Kubernetes = fake.NewSimpleClientset(c.Pod) + + // set the VelaKubernetes fake client in the runtime client + c.VelaKubernetes = fakeVelaK8sClient.NewSimpleClientset( + &velav1alpha1.PipelinePodsTemplate{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: c.config.Namespace, + Name: "mock-pipeline-pods-template", + }, + }, + ) + + // set the PodTracker (normally populated in SetupBuild) + tracker, err := mockPodTracker(c.Logger, c.Kubernetes, c.Pod) + if err != nil { + return c, err + } + + c.PodTracker = tracker + + // The test is responsible for calling c.PodTracker.Start() if needed + + return c, nil +} From f915c54d5181371df82f1007e4c35661a708c10b Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 9 Nov 2022 09:50:39 -0600 Subject: [PATCH 340/430] Merge pull request from GHSA-2w78-ffv6-p46w --- runtime/flags.go | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/flags.go b/runtime/flags.go index 2e01350b..cbf87de3 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -53,7 +53,6 @@ var Flags = []cli.Flag{ FilePath: "/vela/runtime/privileged_images", Name: "runtime.privileged-images", Usage: "list of images allowed to run in privileged mode for the runtime", - Value: cli.NewStringSlice("target/vela-docker"), }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_RUNTIME_VOLUMES", "RUNTIME_VOLUMES"}, From 818233735ff151bf7af4c55ec1b630622b1c687b Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Wed, 9 Nov 2022 09:55:16 -0600 Subject: [PATCH 341/430] feat!: gate privileged images behind trusted repos (#391) --- cmd/vela-worker/exec.go | 28 +- cmd/vela-worker/run.go | 7 +- docker-compose.yml | 1 + executor/flags.go | 7 + executor/linux/build.go | 70 +++ executor/linux/build_test.go | 523 ++++++++++++++++++ executor/linux/linux.go | 26 +- executor/linux/opts.go | 24 + executor/linux/opts_test.go | 95 ++++ .../testdata/build/services/name_init.yml | 17 + .../linux/testdata/build/stages/name_init.yml | 13 + .../linux/testdata/build/steps/name_init.yml | 11 + executor/setup.go | 6 + 13 files changed, 801 insertions(+), 27 deletions(-) create mode 100644 executor/linux/testdata/build/services/name_init.yml create mode 100644 executor/linux/testdata/build/stages/name_init.yml create mode 100644 executor/linux/testdata/build/steps/name_init.yml diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 0e05264c..45f2f039 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -70,19 +70,21 @@ func (w *Worker) exec(index int) error { // // https://godoc.org/github.com/go-vela/worker/executor#New _executor, err := executor.New(&executor.Setup{ - Logger: logger, - Mock: w.Config.Mock, - Driver: w.Config.Executor.Driver, - LogMethod: w.Config.Executor.LogMethod, - MaxLogSize: w.Config.Executor.MaxLogSize, - Client: w.VelaClient, - Hostname: w.Config.API.Address.Hostname(), - Runtime: w.Runtime, - Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), - Repo: item.Repo, - User: item.User, - Version: v.Semantic(), + Logger: logger, + Mock: w.Config.Mock, + Driver: w.Config.Executor.Driver, + LogMethod: w.Config.Executor.LogMethod, + MaxLogSize: w.Config.Executor.MaxLogSize, + EnforceTrustedRepos: w.Config.Executor.EnforceTrustedRepos, + PrivilegedImages: w.Config.Runtime.PrivilegedImages, + Client: w.VelaClient, + Hostname: w.Config.API.Address.Hostname(), + Runtime: w.Runtime, + Build: item.Build, + Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), + Repo: item.Repo, + User: item.User, + Version: v.Semantic(), }) // add the executor to the worker diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index c7c1e289..2fadcddc 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -93,9 +93,10 @@ func run(c *cli.Context) error { CheckIn: c.Duration("checkIn"), // executor configuration Executor: &executor.Setup{ - Driver: c.String("executor.driver"), - LogMethod: c.String("executor.log_method"), - MaxLogSize: c.Uint("executor.max_log_size"), + Driver: c.String("executor.driver"), + LogMethod: c.String("executor.log_method"), + MaxLogSize: c.Uint("executor.max_log_size"), + EnforceTrustedRepos: c.Bool("executor.enforce-trusted-repos"), }, // logger configuration Logger: &Logger{ diff --git a/docker-compose.yml b/docker-compose.yml index 876a9ff4..efeb0110 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,7 @@ services: VELA_LOG_LEVEL: trace VELA_RUNTIME_DRIVER: docker VELA_RUNTIME_PRIVILEGED_IMAGES: 'target/vela-docker' + VELA_EXECUTOR_ENFORCE_TRUSTED_REPOS: 'true' VELA_SERVER_ADDR: 'http://server:8080' VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' diff --git a/executor/flags.go b/executor/flags.go index df9d7743..95c96cfc 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -37,4 +37,11 @@ var Flags = []cli.Flag{ Name: "executor.max_log_size", Usage: "maximum log size (in bytes)", }, + &cli.BoolFlag{ + EnvVars: []string{"VELA_EXECUTOR_ENFORCE_TRUSTED_REPOS", "EXECUTOR_ENFORCE_TRUSTED_REPOS"}, + FilePath: "/vela/executor/enforce_trusted_repos", + Name: "executor.enforce-trusted-repos", + Usage: "enforce trusted repo restrictions for privileged images", + Value: true, + }, } diff --git a/executor/linux/build.go b/executor/linux/build.go index 8f01fe5d..8fa38f24 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -14,7 +14,9 @@ import ( "golang.org/x/sync/errgroup" "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" "github.com/go-vela/worker/internal/build" + "github.com/go-vela/worker/internal/image" "github.com/go-vela/worker/internal/step" ) @@ -42,6 +44,74 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to upload build state: %w", c.err) } + // before setting up the build, enforce repo.trusted is set for pipelines containing privileged images + // this configuration is set as an executor flag + if c.enforceTrustedRepos { + // check if pipeline steps contain privileged images + // assume no privileged images are in use + containsPrivilegedImages := false + + // group steps services and stages together + containers := c.pipeline.Steps + + containers = append(containers, c.pipeline.Services...) + for _, stage := range c.pipeline.Stages { + containers = append(containers, stage.Steps...) + } + + for _, container := range containers { + // TODO: remove hardcoded reference + if container.Image == "#init" { + continue + } + + for _, pattern := range c.privilegedImages { + privileged, err := image.IsPrivilegedImage(container.Image, pattern) + if err != nil { + return fmt.Errorf("could not verify if image %s is privileged", container.Image) + } + + if privileged { + containsPrivilegedImages = true + } + } + } + + // check if this build should be denied + if (containsPrivilegedImages) && !(c.repo != nil && c.repo.GetTrusted()) { + // deny the build, clean build/steps, and return error + // populate the build error + e := "build denied, repo must be trusted in order to run privileged images" + c.build.SetError(e) + // set the build status to error + c.build.SetStatus(constants.StatusError) + + steps := c.pipeline.Steps + for _, stage := range c.pipeline.Stages { + steps = append(containers, stage.Steps...) + } + + // update all preconfigured steps to the correct status + for _, s := range steps { + // extract step + step := library.StepFromBuildContainer(c.build, s) + // status to use for preconfigured steps that are not ran + status := constants.StatusKilled + // set step status + step.SetStatus(status) + // send API call to update the step + //nolint:contextcheck // ignore passing context + _, _, err := c.Vela.Step.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), step) + if err != nil { + // only log any step update errors to allow the return err to run + c.Logger.Errorf("unable to update step %s to status %s: %s", s.Name, status, err.Error()) + } + } + + return fmt.Errorf("build containing privileged images %s/%d denied, repo is not trusted", c.repo.GetFullName(), c.build.GetNumber()) + } + } + // setup the runtime build c.err = c.Runtime.SetupBuild(ctx, c.pipeline) if c.err != nil { diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 5422a951..6b7b2d9d 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -130,6 +130,529 @@ func TestLinux_CreateBuild(t *testing.T) { } } +func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { + // setup types + compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + + _build := testBuild() + // test repo is not trusted by default + _untrustedRepo := testRepo() + _user := testUser() + _metadata := testMetadata() + // to be matched with the image used by testdata/build/steps/basic.yml + _privilegedImagesStepsPipeline := []string{"alpine"} + // to be matched with the image used by testdata/build/services/basic.yml + _privilegedImagesServicesPipeline := []string{"postgres"} + // to be matched with the image used by testdata/build/stages/basic.yml + _privilegedImagesStagesPipeline := []string{"alpine"} + + // create trusted repo + _trustedRepo := testRepo() + _trustedRepo.SetTrusted(true) + + gin.SetMode(gin.TestMode) + + s := httptest.NewServer(server.FakeHandler()) + + _client, err := vela.NewClient(s.URL, "", nil) + if err != nil { + t.Errorf("unable to create Vela API client: %v", err) + } + + _runtime, err := docker.NewMock() + if err != nil { + t.Errorf("unable to create runtime engine: %v", err) + } + + tests := []struct { + name string + failure bool + build *library.Build + repo *library.Repo + pipeline string + privilegedImages []string + enforceTrustedRepos bool + }{ + { + name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + + { + name: "enforce trusted repos enabled: privileged services pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/basic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo and init step name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and init step name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo and init step name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and init step name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/name_init.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo and init step name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and init step name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo and init step name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and init step name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and init step name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/name_init.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos enabled: privileged services pipeline with trusted repo and init service name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo and init service name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo and init service name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and init service name", + failure: true, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with trusted repo and init service name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo and init service name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo and init service name", + failure: false, + build: _build, + repo: _trustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and init service name", + failure: false, + build: _build, + repo: _untrustedRepo, + pipeline: "testdata/build/services/name_init.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + } + + // run test + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _pipeline, _, err := compiler. + Duplicate(). + WithBuild(_build). + WithRepo(test.repo). + WithMetadata(_metadata). + WithUser(_user). + Compile(test.pipeline) + if err != nil { + t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + } + + _engine, err := New( + WithBuild(test.build), + WithPipeline(_pipeline), + WithRepo(test.repo), + WithRuntime(_runtime), + WithUser(_user), + WithVelaClient(_client), + WithPrivilegedImages(test.privilegedImages), + WithEnforceTrustedRepos(test.enforceTrustedRepos), + ) + if err != nil { + t.Errorf("unable to create executor engine: %v", err) + } + + err = _engine.CreateBuild(context.Background()) + + if test.failure { + if err == nil { + t.Errorf("CreateBuild should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + }) + } +} + func TestLinux_PlanBuild(t *testing.T) { // setup types compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) diff --git a/executor/linux/linux.go b/executor/linux/linux.go index d8650cdc..a2346731 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -31,17 +31,19 @@ type ( secret *secretSvc // private fields - init *pipeline.Container - logMethod string - maxLogSize uint - build *library.Build - pipeline *pipeline.Build - repo *library.Repo - secrets sync.Map - services sync.Map - serviceLogs sync.Map - steps sync.Map - stepLogs sync.Map + init *pipeline.Container + logMethod string + maxLogSize uint + privilegedImages []string + enforceTrustedRepos bool + build *library.Build + pipeline *pipeline.Build + repo *library.Repo + secrets sync.Map + services sync.Map + serviceLogs sync.Map + steps sync.Map + stepLogs sync.Map streamRequests chan message.StreamRequest @@ -70,6 +72,8 @@ func Equal(a, b *client) bool { reflect.DeepEqual(a.init, b.init) && a.logMethod == b.logMethod && a.maxLogSize == b.maxLogSize && + reflect.DeepEqual(a.privilegedImages, b.privilegedImages) && + a.enforceTrustedRepos == b.enforceTrustedRepos && reflect.DeepEqual(a.build, b.build) && reflect.DeepEqual(a.pipeline, b.pipeline) && reflect.DeepEqual(a.repo, b.repo) && diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 4095a055..a75d0a42 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -64,6 +64,30 @@ func WithMaxLogSize(size uint) Opt { } } +// WithPrivilegedImages sets the privileged images in the executor client for Linux. +func WithPrivilegedImages(images []string) Opt { + return func(c *client) error { + c.Logger.Trace("configuring privileged images in linux executor client") + + // set the privileged images in the client + c.privilegedImages = images + + return nil + } +} + +// WithEnforceTrustedRepos configures trusted repo restrictions in the executor client for Linux. +func WithEnforceTrustedRepos(enforce bool) Opt { + return func(c *client) error { + c.Logger.Trace("configuring trusted repo restrictions in linux executor client") + + // set trusted repo restrictions in the client + c.enforceTrustedRepos = enforce + + return nil + } +} + // WithHostname sets the hostname in the executor client for Linux. func WithHostname(hostname string) Opt { return func(c *client) error { diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index ac49f04b..06135dd0 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -161,6 +161,101 @@ func TestLinux_Opt_WithMaxLogSize(t *testing.T) { } } +func TestLinux_Opt_WithPrivilegedImages(t *testing.T) { + // setup tests + tests := []struct { + name string + failure bool + privilegedImages []string + }{ + { + name: "empty privileged images", + failure: false, + privilegedImages: []string{}, + }, + { + name: "with privileged image", + failure: false, + privilegedImages: []string{"target/vela-docker"}, + }, + { + name: "with privileged images", + failure: false, + privilegedImages: []string{"alpine", "target/vela-docker"}, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithPrivilegedImages(test.privilegedImages), + ) + + if test.failure { + if err == nil { + t.Errorf("WithPrivilegedImages should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("WithPrivilegedImages returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.privilegedImages, test.privilegedImages) { + t.Errorf("WithPrivilegedImages is %v, want %v", _engine.privilegedImages, test.privilegedImages) + } + }) + } +} + +func TestLinux_Opt_WithEnforceTrustedRepos(t *testing.T) { + // setup tests + tests := []struct { + name string + failure bool + enforceTrustedRepos bool + }{ + { + name: "enforce trusted repos enabled", + failure: false, + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled", + failure: false, + enforceTrustedRepos: false, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithEnforceTrustedRepos(test.enforceTrustedRepos), + ) + + if test.failure { + if err == nil { + t.Errorf("WithEnforceTrustedRepos should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("WithEnforceTrustedRepos returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.enforceTrustedRepos, test.enforceTrustedRepos) { + t.Errorf("WithEnforceTrustedRepos is %v, want %v", _engine.enforceTrustedRepos, test.enforceTrustedRepos) + } + }) + } +} + func TestLinux_Opt_WithHostname(t *testing.T) { // setup tests tests := []struct { diff --git a/executor/linux/testdata/build/services/name_init.yml b/executor/linux/testdata/build/services/name_init.yml new file mode 100644 index 00000000..231fcde3 --- /dev/null +++ b/executor/linux/testdata/build/services/name_init.yml @@ -0,0 +1,17 @@ +--- +version: "1" +services: + - name: init + environment: + FOO: bar + image: postgres:latest + pull: true + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/name_init.yml b/executor/linux/testdata/build/stages/name_init.yml new file mode 100644 index 00000000..99624eca --- /dev/null +++ b/executor/linux/testdata/build/stages/name_init.yml @@ -0,0 +1,13 @@ +--- +version: "1" +stages: + test: + steps: + - name: init + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/linux/testdata/build/steps/name_init.yml b/executor/linux/testdata/build/steps/name_init.yml new file mode 100644 index 00000000..1121055c --- /dev/null +++ b/executor/linux/testdata/build/steps/name_init.yml @@ -0,0 +1,11 @@ +--- +version: "1" +steps: + - name: init + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true + \ No newline at end of file diff --git a/executor/setup.go b/executor/setup.go index 3044aa37..2b07f7ae 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -40,6 +40,10 @@ type Setup struct { LogMethod string // specifies the maximum log size MaxLogSize uint + // specifies a list of privileged images to use + PrivilegedImages []string + // configuration for enforcing that only trusted repos may run privileged images + EnforceTrustedRepos bool // specifies the executor hostname Hostname string // specifies the executor version @@ -81,6 +85,8 @@ func (s *Setup) Linux() (Engine, error) { linux.WithBuild(s.Build), linux.WithLogMethod(s.LogMethod), linux.WithMaxLogSize(s.MaxLogSize), + linux.WithPrivilegedImages(s.PrivilegedImages), + linux.WithEnforceTrustedRepos(s.EnforceTrustedRepos), linux.WithHostname(s.Hostname), linux.WithPipeline(s.Pipeline), linux.WithRepo(s.Repo), From 655401641791a35363400fc5b97946e40abdaba0 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 9 Nov 2022 10:32:43 -0600 Subject: [PATCH 342/430] chore(release): v0.16.0 prep (#399) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 616fefca..d92b4a90 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.18+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.15.1 - github.com/go-vela/server v0.15.1 - github.com/go-vela/types v0.15.1 + github.com/go-vela/sdk-go v0.16.0 + github.com/go-vela/server v0.16.0 + github.com/go-vela/types v0.16.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index f77c5f48..ad83da32 100644 --- a/go.sum +++ b/go.sum @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.15.1 h1:DEH5DzamH3InTXeXE2iiKiiQhu/NILWna+zb+ceXEFA= -github.com/go-vela/sdk-go v0.15.1/go.mod h1:QjYqC1bbrDshUVaScUwtNgj3P/uqctdUHfD2agm6OCU= -github.com/go-vela/server v0.15.1 h1:7J9QfFXNVREhX4mILCWyqZE3o29a2oThEN2WeQ/wWF4= -github.com/go-vela/server v0.15.1/go.mod h1:k3p4ZhDKYKVO3rbkCAow3N/01f2Iel9KDR2yTaH90UI= -github.com/go-vela/types v0.15.1 h1:nQxfxoqxavuTYtvFJW4wK9UkkADN2VG6Z4ubvJ8PT1s= -github.com/go-vela/types v0.15.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.16.0 h1:Xpj/2ke1pooA1+V5KrUh9cZaBXLh3D4wNV3ccDldOWU= +github.com/go-vela/sdk-go v0.16.0/go.mod h1:GeNNcITCXnj0aVnK5Ut63H7zr8QYefBFxd08pD4C0lw= +github.com/go-vela/server v0.16.0 h1:wTyY8Bid8jJcqh7zCs6i6aRB/7rbXoiTeJZaDHOTUV0= +github.com/go-vela/server v0.16.0/go.mod h1:hbJR7X1qLQbmVsaH6qIfWJDoluZagWJMFLZSarwdUng= +github.com/go-vela/types v0.16.0 h1:YsgbnnOS7FPFA0dPRZCLH2ryCdya14qSi3MgJab6ixo= +github.com/go-vela/types v0.16.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From b8dea7c2a39ae0af43673e8f857f99fdfadfbad0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 13:27:10 -0600 Subject: [PATCH 343/430] fix(deps): update module gotest.tools/v3 to v3.4.0 (#388) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d92b4a90..e0b18a11 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.17.1 golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 - gotest.tools/v3 v3.3.0 + gotest.tools/v3 v3.4.0 k8s.io/api v0.25.2 k8s.io/apimachinery v0.25.2 k8s.io/client-go v0.25.2 diff --git a/go.sum b/go.sum index ad83da32..2da682ca 100644 --- a/go.sum +++ b/go.sum @@ -773,8 +773,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 9e27f39d353d2bc7aaba1f88dc09ea1c1f68beb9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 13:35:43 -0600 Subject: [PATCH 344/430] fix(deps): update deps (patch) (#392) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 32 ++++++++++++++--------------- go.sum | 63 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 49 insertions(+), 46 deletions(-) diff --git a/go.mod b/go.mod index e0b18a11..9e0ba43c 100644 --- a/go.mod +++ b/go.mod @@ -5,23 +5,23 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.18+incompatible + github.com/docker/docker v20.10.21+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.16.0 - github.com/go-vela/server v0.16.0 - github.com/go-vela/types v0.16.0 + github.com/go-vela/server v0.16.1 + github.com/go-vela/types v0.16.1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.17.1 + github.com/urfave/cli/v2 v2.23.5 golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 gotest.tools/v3 v3.4.0 - k8s.io/api v0.25.2 - k8s.io/apimachinery v0.25.2 - k8s.io/client-go v0.25.2 + k8s.io/api v0.25.3 + k8s.io/apimachinery v0.25.3 + k8s.io/client-go v0.25.3 sigs.k8s.io/yaml v1.3.0 ) @@ -32,7 +32,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.23.0 // indirect + github.com/alicebob/miniredis/v2 v2.23.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -86,7 +86,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -96,14 +96,14 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect - go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d // indirect + github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect + go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect + golang.org/x/net v0.1.0 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect - golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/term v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect diff --git a/go.sum b/go.sum index 2da682ca..7023032a 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.23.0 h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw= -github.com/alicebob/miniredis/v2 v2.23.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= +github.com/alicebob/miniredis/v2 v2.23.1 h1:jR6wZggBxwWygeXcdNyguCOCIjPsZyNUNlAkTx2fu0U= +github.com/alicebob/miniredis/v2 v2.23.1/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -92,8 +92,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.18+incompatible h1:SN84VYXTBNGn92T/QwIRPlum9zfemfitN7pbsp26WSc= -github.com/docker/docker v20.10.18+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= +github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -155,10 +155,10 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/sdk-go v0.16.0 h1:Xpj/2ke1pooA1+V5KrUh9cZaBXLh3D4wNV3ccDldOWU= github.com/go-vela/sdk-go v0.16.0/go.mod h1:GeNNcITCXnj0aVnK5Ut63H7zr8QYefBFxd08pD4C0lw= -github.com/go-vela/server v0.16.0 h1:wTyY8Bid8jJcqh7zCs6i6aRB/7rbXoiTeJZaDHOTUV0= -github.com/go-vela/server v0.16.0/go.mod h1:hbJR7X1qLQbmVsaH6qIfWJDoluZagWJMFLZSarwdUng= -github.com/go-vela/types v0.16.0 h1:YsgbnnOS7FPFA0dPRZCLH2ryCdya14qSi3MgJab6ixo= -github.com/go-vela/types v0.16.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/server v0.16.1 h1:1ihfbBha098noeM9dbBNSVqj8PLaNy+Sw9VBtc7tabY= +github.com/go-vela/server v0.16.1/go.mod h1:vqSBrSJWw/OpynddskXDS5GggmlYpisQXODEWsGXk6k= +github.com/go-vela/types v0.16.1 h1:PGtOQ0AQLAFJ23wi6ns5JF1y68v4VjA/NbZs5HYZmhY= +github.com/go-vela/types v0.16.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -345,13 +345,14 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -396,29 +397,29 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P 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/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.17.1 h1:UzjDEw2dJQUE3iRaiNQ1VrVFbyAtKGH3VdkMoHA58V0= -github.com/urfave/cli/v2 v2.17.1/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= +github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= +github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= 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/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= -github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= +github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= 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= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d h1:aF+anaRVZu22kdETjLavnIn/cvD+arhmik6vMU3joW4= -go.starlark.net v0.0.0-20220928063852-5fccb4daaf6d/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= +go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 h1:5/KzhcSqd4UgY51l17r7C5g/JiE6DRw1Vq7VJfQHuMc= +go.starlark.net v0.0.0-20221028183056-acb66ad56dd2/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -501,8 +502,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= -golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -579,12 +580,13 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -592,8 +594,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -782,12 +785,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8= -k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0= -k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= -k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= -k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= -k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= +k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ= +k8s.io/api v0.25.3/go.mod h1:o42gKscFrEVjHdQnyRenACrMtbuJsVdP+WVjqejfzmI= +k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc= +k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= +k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= +k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 1c8c9b096dc8d54a590a35bf557f313c24404c2c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 13:45:47 -0600 Subject: [PATCH 345/430] chore(deps): update postgres docker tag to v15 (#393) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index efeb0110..544e898c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -123,7 +123,7 @@ services: # https://www.postgresql.org/ postgres: container_name: postgres - image: postgres:14-alpine + image: postgres:15-alpine networks: - vela environment: From 89fbc1c575b8d75035342839e279b1ca2da14ed4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 13:54:28 -0600 Subject: [PATCH 346/430] fix(deps): update module golang.org/x/sync to v0.1.0 (#394) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9e0ba43c..36cd9dfd 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.23.5 - golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 + golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.25.3 k8s.io/apimachinery v0.25.3 diff --git a/go.sum b/go.sum index 7023032a..99bfbdbe 100644 --- a/go.sum +++ b/go.sum @@ -527,8 +527,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 222b0e67c2fa7036be8d0eb54ee6f9d1beabbf7e Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 9 Nov 2022 14:01:08 -0600 Subject: [PATCH 347/430] chore(release): v0.16.1 prep (#400) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 36cd9dfd..f4316e54 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/docker/docker v20.10.21+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.16.0 + github.com/go-vela/sdk-go v0.16.1 github.com/go-vela/server v0.16.1 github.com/go-vela/types v0.16.1 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 99bfbdbe..41bbe5dc 100644 --- a/go.sum +++ b/go.sum @@ -153,8 +153,8 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.16.0 h1:Xpj/2ke1pooA1+V5KrUh9cZaBXLh3D4wNV3ccDldOWU= -github.com/go-vela/sdk-go v0.16.0/go.mod h1:GeNNcITCXnj0aVnK5Ut63H7zr8QYefBFxd08pD4C0lw= +github.com/go-vela/sdk-go v0.16.1 h1:TrexXFMRQVs5UQXL9NV0Urv+sRu7RElKyVo8qK/yGLY= +github.com/go-vela/sdk-go v0.16.1/go.mod h1:fm8xpL9t1pBLdB9cQDHn8jyuQX8IapYzexD/cbQwKoc= github.com/go-vela/server v0.16.1 h1:1ihfbBha098noeM9dbBNSVqj8PLaNy+Sw9VBtc7tabY= github.com/go-vela/server v0.16.1/go.mod h1:vqSBrSJWw/OpynddskXDS5GggmlYpisQXODEWsGXk6k= github.com/go-vela/types v0.16.1 h1:PGtOQ0AQLAFJ23wi6ns5JF1y68v4VjA/NbZs5HYZmhY= From cac9b1f67585b76df00ca594d72a74df3bd7b32c Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 15 Nov 2022 11:27:21 -0700 Subject: [PATCH 348/430] chore(release): 0.16.2 prep (#402) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index f4316e54..fad53ff4 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.21+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.16.1 - github.com/go-vela/server v0.16.1 - github.com/go-vela/types v0.16.1 + github.com/go-vela/sdk-go v0.16.2 + github.com/go-vela/server v0.16.2 + github.com/go-vela/types v0.16.2 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 41bbe5dc..13158bb2 100644 --- a/go.sum +++ b/go.sum @@ -153,12 +153,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.16.1 h1:TrexXFMRQVs5UQXL9NV0Urv+sRu7RElKyVo8qK/yGLY= -github.com/go-vela/sdk-go v0.16.1/go.mod h1:fm8xpL9t1pBLdB9cQDHn8jyuQX8IapYzexD/cbQwKoc= -github.com/go-vela/server v0.16.1 h1:1ihfbBha098noeM9dbBNSVqj8PLaNy+Sw9VBtc7tabY= -github.com/go-vela/server v0.16.1/go.mod h1:vqSBrSJWw/OpynddskXDS5GggmlYpisQXODEWsGXk6k= -github.com/go-vela/types v0.16.1 h1:PGtOQ0AQLAFJ23wi6ns5JF1y68v4VjA/NbZs5HYZmhY= -github.com/go-vela/types v0.16.1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.16.2 h1:M9+u89mGomJc2uwUPVGWp9UnUIFm0IhIIsFEfxROhZQ= +github.com/go-vela/sdk-go v0.16.2/go.mod h1:BuTkw+MYWbAKJ6+ZtQ/nNmwIcjn/tysCPks4X+csBGE= +github.com/go-vela/server v0.16.2 h1:qovjGN9ZQazjV0JTXzP6o5UPSs1D+wyUMpbG4G6aXZI= +github.com/go-vela/server v0.16.2/go.mod h1:bf9dpkzhL2T6G6fxIwjmMjzoD+e5Xfmg3DcckP6lqHc= +github.com/go-vela/types v0.16.2 h1:c2Kkj7OKv4sjPrsOBbnPSQqfsNpOFM2La7LfP+81EF0= +github.com/go-vela/types v0.16.2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From 748e81f580c518012d56f202424e4eb7f86668b5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 9 Dec 2022 11:15:26 -0600 Subject: [PATCH 349/430] refactor(k8s): move test logic to MockKubernetesRuntime interface (#395) --- runtime/kubernetes/build_test.go | 2 +- runtime/kubernetes/container_test.go | 5 +---- runtime/kubernetes/mock.go | 31 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 50f304ea..d8722c7b 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -431,7 +431,7 @@ func TestKubernetes_StreamBuild(t *testing.T) { cancel() } else if test.doReady { // simulate AssembleBuild - close(_engine.PodTracker.Ready) + _engine.MarkPodTrackerReady() } }() diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index cb190171..9383491f 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -517,11 +517,8 @@ func TestKubernetes_WaitContainer(t *testing.T) { } go func() { - oldPod := test.oldPod.DeepCopy() - oldPod.SetResourceVersion("older") - // simulate a re-sync/PodUpdate event - _engine.PodTracker.HandlePodUpdate(oldPod, _engine.Pod) + _engine.SimulateResync(test.oldPod) }() err = _engine.WaitContainer(context.Background(), test.container) diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go index 602dde07..b409a157 100644 --- a/runtime/kubernetes/mock.go +++ b/runtime/kubernetes/mock.go @@ -85,3 +85,34 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { return c, nil } + +// MockKubernetesRuntime makes it possible to use the client mocks in other packages. +// +// This interface is intended for running tests only. +type MockKubernetesRuntime interface { + MarkPodTrackerReady() + SimulateResync(*v1.Pod) +} + +// MarkPodTrackerReady signals that PodTracker has been setup with ContainerTrackers. +// +// This function is intended for running tests only. +func (c *client) MarkPodTrackerReady() { + close(c.PodTracker.Ready) +} + +// SimulateResync simulates an resync where the PodTracker refreshes its cache. +// This resync is from oldPod to runtime.Pod. If nil, oldPod defaults to runtime.Pod. +// +// This function is intended for running tests only. +func (c *client) SimulateResync(oldPod *v1.Pod) { + if oldPod == nil { + oldPod = c.Pod + } + + oldPod = oldPod.DeepCopy() + oldPod.SetResourceVersion("older") + + // simulate a re-sync/PodUpdate event + c.PodTracker.HandlePodUpdate(oldPod, c.Pod) +} From 318a7b01968a8beeb68c8e7844483a88a6bb5f3c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 9 Dec 2022 11:20:16 -0600 Subject: [PATCH 350/430] refactor(executor tests): cleanup test names and errors (#396) --- executor/linux/build_test.go | 150 ++++++++++++++++----------------- executor/linux/linux_test.go | 2 +- executor/linux/opts_test.go | 2 +- executor/linux/secret_test.go | 78 ++++++++--------- executor/linux/service_test.go | 68 +++++++-------- executor/linux/stage_test.go | 54 ++++++------ executor/linux/step_test.go | 78 ++++++++--------- 7 files changed, 216 insertions(+), 216 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 6b7b2d9d..42d465b3 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -46,7 +46,7 @@ func TestLinux_CreateBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } tests := []struct { @@ -56,31 +56,31 @@ func TestLinux_CreateBuild(t *testing.T) { pipeline string }{ { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, build: _build, pipeline: "testdata/build/secrets/basic.yml", }, { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, build: _build, pipeline: "testdata/build/services/basic.yml", }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, build: _build, pipeline: "testdata/build/steps/basic.yml", }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, build: _build, pipeline: "testdata/build/stages/basic.yml", }, { - name: "steps pipeline with empty build", + name: "docker-steps pipeline with empty build", failure: true, build: new(library.Build), pipeline: "testdata/build/steps/basic.yml", @@ -98,7 +98,7 @@ func TestLinux_CreateBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -110,21 +110,21 @@ func TestLinux_CreateBuild(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.CreateBuild(context.Background()) if test.failure { if err == nil { - t.Errorf("CreateBuild should have returned err") + t.Errorf("%s CreateBuild should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("CreateBuild returned err: %v", err) + t.Errorf("%s CreateBuild returned err: %v", test.name, err) } }) } @@ -673,7 +673,7 @@ func TestLinux_PlanBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } tests := []struct { @@ -682,22 +682,22 @@ func TestLinux_PlanBuild(t *testing.T) { pipeline string }{ { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, @@ -714,7 +714,7 @@ func TestLinux_PlanBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -726,27 +726,27 @@ func TestLinux_PlanBuild(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // run create to init steps to be created properly err = _engine.CreateBuild(context.Background()) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("%s unable to create build: %v", test.name, err) } err = _engine.PlanBuild(context.Background()) if test.failure { if err == nil { - t.Errorf("PlanBuild should have returned err") + t.Errorf("%s PlanBuild should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("PlanBuild returned err: %v", err) + t.Errorf("%s PlanBuild returned err: %v", test.name, err) } }) } @@ -772,7 +772,7 @@ func TestLinux_AssembleBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -784,62 +784,62 @@ func TestLinux_AssembleBuild(t *testing.T) { pipeline string }{ { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, { - name: "secrets pipeline with image not found", + name: "docker-secrets pipeline with image not found", failure: true, pipeline: "testdata/build/secrets/img_notfound.yml", }, { - name: "secrets pipeline with ignoring image not found", + name: "docker-secrets pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/secrets/img_ignorenotfound.yml", }, { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, { - name: "services pipeline with image not found", + name: "docker-services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, { - name: "services pipeline with ignoring image not found", + name: "docker-services pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, { - name: "steps pipeline with image not found", + name: "docker-steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, { - name: "steps pipeline with ignoring image not found", + name: "docker-steps pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, { - name: "stages pipeline with image not found", + name: "docker-stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, { - name: "stages pipeline with ignoring image not found", + name: "docker-stages pipeline with ignoring image not found", failure: true, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, @@ -856,7 +856,7 @@ func TestLinux_AssembleBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -869,7 +869,7 @@ func TestLinux_AssembleBuild(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // run create to init steps to be created properly @@ -882,14 +882,14 @@ func TestLinux_AssembleBuild(t *testing.T) { if test.failure { if err == nil { - t.Errorf("AssembleBuild should have returned err") + t.Errorf("%s AssembleBuild should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("AssembleBuild returned err: %v", err) + t.Errorf("%s AssembleBuild returned err: %v", test.name, err) } }) } @@ -915,7 +915,7 @@ func TestLinux_ExecBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -927,32 +927,32 @@ func TestLinux_ExecBuild(t *testing.T) { pipeline string }{ { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, { - name: "services pipeline with image not found", + name: "docker-services pipeline with image not found", failure: true, pipeline: "testdata/build/services/img_notfound.yml", }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, { - name: "steps pipeline with image not found", + name: "docker-steps pipeline with image not found", failure: true, pipeline: "testdata/build/steps/img_notfound.yml", }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, { - name: "stages pipeline with image not found", + name: "docker-stages pipeline with image not found", failure: true, pipeline: "testdata/build/stages/img_notfound.yml", }, @@ -969,7 +969,7 @@ func TestLinux_ExecBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -982,7 +982,7 @@ func TestLinux_ExecBuild(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // run create to init steps to be created properly @@ -1007,7 +1007,7 @@ func TestLinux_ExecBuild(t *testing.T) { // in a privileged fashion. err = _runtime.CreateVolume(context.Background(), _pipeline) if err != nil { - t.Errorf("unable to create runtime volume: %v", err) + t.Errorf("unable to create docker runtime volume: %v", err) } // TODO: hack - remove this @@ -1029,14 +1029,14 @@ func TestLinux_ExecBuild(t *testing.T) { if test.failure { if err == nil { - t.Errorf("ExecBuild for %s should have returned err", test.pipeline) + t.Errorf("%s ExecBuild for %s should have returned err", test.name, test.pipeline) } return // continue to next test } if err != nil { - t.Errorf("ExecBuild for %s returned err: %v", test.pipeline, err) + t.Errorf("%s ExecBuild for %s returned err: %v", test.name, test.pipeline, err) } }) } @@ -1062,7 +1062,7 @@ func TestLinux_StreamBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } type planFuncType = func(context.Context, *pipeline.Container) error @@ -1082,7 +1082,7 @@ func TestLinux_StreamBuild(t *testing.T) { planFunc func(*client) planFuncType }{ { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", messageKey: "service", @@ -1105,7 +1105,7 @@ func TestLinux_StreamBuild(t *testing.T) { }, }, { - name: "basic services pipeline with StreamService failure", + name: "docker-basic services pipeline with StreamService failure", failure: false, pipeline: "testdata/build/services/basic.yml", messageKey: "service", @@ -1129,7 +1129,7 @@ func TestLinux_StreamBuild(t *testing.T) { }, }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1150,7 +1150,7 @@ func TestLinux_StreamBuild(t *testing.T) { }, }, { - name: "basic steps pipeline with StreamStep failure", + name: "docker-basic steps pipeline with StreamStep failure", failure: false, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1172,7 +1172,7 @@ func TestLinux_StreamBuild(t *testing.T) { }, }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", messageKey: "step", @@ -1193,7 +1193,7 @@ func TestLinux_StreamBuild(t *testing.T) { }, }, { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", messageKey: "secret", @@ -1230,7 +1230,7 @@ func TestLinux_StreamBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -1243,13 +1243,13 @@ func TestLinux_StreamBuild(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // run create to init steps to be created properly err = _engine.CreateBuild(buildCtx) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("%s unable to create build: %v", test.name, err) } // simulate ExecBuild() which runs concurrently with StreamBuild() @@ -1276,14 +1276,14 @@ func TestLinux_StreamBuild(t *testing.T) { if test.failure { if err == nil { - t.Errorf("StreamBuild for %s should have returned err", test.pipeline) + t.Errorf("%s StreamBuild for %s should have returned err", test.name, test.pipeline) } return // continue to next test } if err != nil { - t.Errorf("StreamBuild for %s returned err: %v", test.pipeline, err) + t.Errorf("%s StreamBuild for %s returned err: %v", test.name, test.pipeline, err) } }) } @@ -1309,7 +1309,7 @@ func TestLinux_DestroyBuild(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } tests := []struct { @@ -1318,42 +1318,42 @@ func TestLinux_DestroyBuild(t *testing.T) { pipeline string }{ { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, { - name: "secrets pipeline with name not found", + name: "docker-secrets pipeline with name not found", failure: false, pipeline: "testdata/build/secrets/name_notfound.yml", }, { - name: "basic services pipeline", + name: "docker-basic services pipeline", failure: false, pipeline: "testdata/build/services/basic.yml", }, { - name: "services pipeline with name not found", + name: "docker-services pipeline with name not found", failure: false, pipeline: "testdata/build/services/name_notfound.yml", }, { - name: "basic steps pipeline", + name: "docker-basic steps pipeline", failure: false, pipeline: "testdata/build/steps/basic.yml", }, { - name: "steps pipeline with name not found", + name: "docker-steps pipeline with name not found", failure: false, pipeline: "testdata/build/steps/name_notfound.yml", }, { - name: "basic stages pipeline", + name: "docker-basic stages pipeline", failure: false, pipeline: "testdata/build/stages/basic.yml", }, { - name: "stages pipeline with name not found", + name: "docker-stages pipeline with name not found", failure: false, pipeline: "testdata/build/stages/name_notfound.yml", }, @@ -1370,7 +1370,7 @@ func TestLinux_DestroyBuild(t *testing.T) { WithUser(_user). Compile(test.pipeline) if err != nil { - t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) + t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } _engine, err := New( @@ -1382,27 +1382,27 @@ func TestLinux_DestroyBuild(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // run create to init steps to be created properly err = _engine.CreateBuild(context.Background()) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("%s unable to create build: %v", test.name, err) } err = _engine.DestroyBuild(context.Background()) if test.failure { if err == nil { - t.Errorf("DestroyBuild should have returned err") + t.Errorf("%s DestroyBuild should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("DestroyBuild returned err: %v", err) + t.Errorf("%s DestroyBuild returned err: %v", test.name, err) } }) } diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 46abe49b..1daf2c58 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -239,7 +239,7 @@ func testUser() *library.User { } } -// testUser is a test helper function to create a metadata +// testMetadata is a test helper function to create a metadata // type with all fields set to a fake value. func testMetadata() *types.Metadata { return &types.Metadata{ diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 06135dd0..f01c6b87 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -441,7 +441,7 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { // setup types _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index ac9bfd06..a9cb94ca 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -47,7 +47,7 @@ func TestLinux_Secret_create(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -57,7 +57,7 @@ func TestLinux_Secret_create(t *testing.T) { container *pipeline.Container }{ { - name: "good image tag", + name: "docker-good image tag", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -70,7 +70,7 @@ func TestLinux_Secret_create(t *testing.T) { }, }, { - name: "notfound image tag", + name: "docker-notfound image tag", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -96,21 +96,21 @@ func TestLinux_Secret_create(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.secret.create(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("create should have returned err") + t.Errorf("%s create should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("create returned err: %v", err) + t.Errorf("%s create returned err: %v", test.name, err) } }) } @@ -134,7 +134,7 @@ func TestLinux_Secret_delete(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } _step := new(library.Step) @@ -150,7 +150,7 @@ func TestLinux_Secret_delete(t *testing.T) { step *library.Step }{ { - name: "running container-empty step", + name: "docker-running container-empty step", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -164,7 +164,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), }, { - name: "running container-pending step", + name: "docker-running container-pending step", failure: false, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", @@ -178,7 +178,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: _step, }, { - name: "inspecting container failure due to invalid container id", + name: "docker-inspecting container failure due to invalid container id", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_notfound", @@ -192,7 +192,7 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), }, { - name: "removing container failure", + name: "docker-removing container failure", failure: true, container: &pipeline.Container{ ID: "secret_github_octocat_1_ignorenotfound", @@ -219,7 +219,7 @@ func TestLinux_Secret_delete(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } _ = _engine.CreateBuild(context.Background()) @@ -230,14 +230,14 @@ func TestLinux_Secret_delete(t *testing.T) { if test.failure { if err == nil { - t.Errorf("destroy should have returned err") + t.Errorf("%s destroy should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("destroy returned err: %v", err) + t.Errorf("%s destroy returned err: %v", test.name, err) } }) } @@ -263,7 +263,7 @@ func TestLinux_Secret_exec(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -276,12 +276,12 @@ func TestLinux_Secret_exec(t *testing.T) { pipeline string }{ { - name: "basic secrets pipeline", + name: "docker-basic secrets pipeline", failure: false, pipeline: "testdata/build/secrets/basic.yml", }, { - name: "pipeline with secret name not found", + name: "docker-pipeline with secret name not found", failure: true, pipeline: "testdata/build/secrets/name_notfound.yml", }, @@ -313,7 +313,7 @@ func TestLinux_Secret_exec(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } _engine.build.SetStatus(constants.StatusSuccess) @@ -325,14 +325,14 @@ func TestLinux_Secret_exec(t *testing.T) { if test.failure { if err == nil { - t.Errorf("exec should have returned err") + t.Errorf("%s exec should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("exec returned err: %v", err) + t.Errorf("%s exec returned err: %v", test.name, err) } }) } @@ -355,7 +355,7 @@ func TestLinux_Secret_pull(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -365,7 +365,7 @@ func TestLinux_Secret_pull(t *testing.T) { secret *pipeline.Secret }{ { - name: "success with org secret", + name: "docker-success with org secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -377,7 +377,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with invalid org secret", + name: "docker-failure with invalid org secret", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -389,7 +389,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with org secret key not found", + name: "docker-failure with org secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -401,7 +401,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "success with repo secret", + name: "docker-success with repo secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -413,7 +413,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with invalid repo secret", + name: "docker-failure with invalid repo secret", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -425,7 +425,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with repo secret key not found", + name: "docker-failure with repo secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -437,7 +437,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "success with shared secret", + name: "docker-success with shared secret", failure: false, secret: &pipeline.Secret{ Name: "foo", @@ -449,7 +449,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with shared secret key not found", + name: "docker-failure with shared secret key not found", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -461,7 +461,7 @@ func TestLinux_Secret_pull(t *testing.T) { }, }, { - name: "failure with invalid type", + name: "docker-failure with invalid type", failure: true, secret: &pipeline.Secret{ Name: "foo", @@ -486,21 +486,21 @@ func TestLinux_Secret_pull(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } _, err = _engine.secret.pull(test.secret) if test.failure { if err == nil { - t.Errorf("pull should have returned err") + t.Errorf("%s pull should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("pull returned err: %v", err) + t.Errorf("%s pull returned err: %v", test.name, err) } }) } @@ -524,7 +524,7 @@ func TestLinux_Secret_stream(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -535,7 +535,7 @@ func TestLinux_Secret_stream(t *testing.T) { container *pipeline.Container }{ { - name: "container step succeeds", + name: "docker-container step succeeds", failure: false, logs: new(library.Log), container: &pipeline.Container{ @@ -549,7 +549,7 @@ func TestLinux_Secret_stream(t *testing.T) { }, }, { - name: "container step fails because of invalid container id", + name: "docker-container step fails because of invalid container id", failure: true, logs: new(library.Log), container: &pipeline.Container{ @@ -576,7 +576,7 @@ func TestLinux_Secret_stream(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } // add init container info to client @@ -586,14 +586,14 @@ func TestLinux_Secret_stream(t *testing.T) { if test.failure { if err == nil { - t.Errorf("stream should have returned err") + t.Errorf("%s stream should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("stream returned err: %v", err) + t.Errorf("%s stream returned err: %v", test.name, err) } }) } diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index c95a488c..6b2fbd6b 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -39,7 +39,7 @@ func TestLinux_CreateService(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -49,7 +49,7 @@ func TestLinux_CreateService(t *testing.T) { container *pipeline.Container }{ { - name: "basic service container", + name: "docker-basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -64,7 +64,7 @@ func TestLinux_CreateService(t *testing.T) { }, }, { - name: "service container with image not found", + name: "docker-service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -79,7 +79,7 @@ func TestLinux_CreateService(t *testing.T) { }, }, { - name: "empty service container", + name: "docker-empty service container", failure: true, container: new(pipeline.Container), }, @@ -97,21 +97,21 @@ func TestLinux_CreateService(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.CreateService(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("CreateService should have returned err") + t.Errorf("%s CreateService should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("CreateService returned err: %v", err) + t.Errorf("%s CreateService returned err: %v", test.name, err) } }) } @@ -134,7 +134,7 @@ func TestLinux_PlanService(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -144,7 +144,7 @@ func TestLinux_PlanService(t *testing.T) { container *pipeline.Container }{ { - name: "basic service container", + name: "docker-basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -159,7 +159,7 @@ func TestLinux_PlanService(t *testing.T) { }, }, { - name: "service container with nil environment", + name: "docker-service container with nil environment", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -174,7 +174,7 @@ func TestLinux_PlanService(t *testing.T) { }, }, { - name: "empty service container", + name: "docker-empty service container", failure: true, container: new(pipeline.Container), }, @@ -192,21 +192,21 @@ func TestLinux_PlanService(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.PlanService(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("PlanService should have returned err") + t.Errorf("%s PlanService should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("PlanService returned err: %v", err) + t.Errorf("%s PlanService returned err: %v", test.name, err) } }) } @@ -229,7 +229,7 @@ func TestLinux_ExecService(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -242,7 +242,7 @@ func TestLinux_ExecService(t *testing.T) { container *pipeline.Container }{ { - name: "basic service container", + name: "docker-basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -257,7 +257,7 @@ func TestLinux_ExecService(t *testing.T) { }, }, { - name: "service container with image not found", + name: "docker-service container with image not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -272,7 +272,7 @@ func TestLinux_ExecService(t *testing.T) { }, }, { - name: "empty service container", + name: "docker-empty service container", failure: true, container: new(pipeline.Container), }, @@ -291,7 +291,7 @@ func TestLinux_ExecService(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } if !test.container.Empty() { @@ -303,14 +303,14 @@ func TestLinux_ExecService(t *testing.T) { if test.failure { if err == nil { - t.Errorf("ExecService should have returned err") + t.Errorf("%s ExecService should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("ExecService returned err: %v", err) + t.Errorf("%s ExecService returned err: %v", test.name, err) } }) } @@ -333,7 +333,7 @@ func TestLinux_StreamService(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -343,7 +343,7 @@ func TestLinux_StreamService(t *testing.T) { container *pipeline.Container }{ { - name: "basic service container", + name: "docker-basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -358,7 +358,7 @@ func TestLinux_StreamService(t *testing.T) { }, }, { - name: "service container with name not found", + name: "docker-service container with name not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_notfound", @@ -373,7 +373,7 @@ func TestLinux_StreamService(t *testing.T) { }, }, { - name: "empty service container", + name: "docker-empty service container", failure: true, container: new(pipeline.Container), }, @@ -391,7 +391,7 @@ func TestLinux_StreamService(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } if !test.container.Empty() { @@ -403,14 +403,14 @@ func TestLinux_StreamService(t *testing.T) { if test.failure { if err == nil { - t.Errorf("StreamService should have returned err") + t.Errorf("%s StreamService should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("StreamService returned err: %v", err) + t.Errorf("%s StreamService returned err: %v", test.name, err) } }) } @@ -433,7 +433,7 @@ func TestLinux_DestroyService(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -443,7 +443,7 @@ func TestLinux_DestroyService(t *testing.T) { container *pipeline.Container }{ { - name: "basic service container", + name: "docker-basic service container", failure: false, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", @@ -458,7 +458,7 @@ func TestLinux_DestroyService(t *testing.T) { }, }, { - name: "service container with ignoring name not found", + name: "docker-service container with ignoring name not found", failure: true, container: &pipeline.Container{ ID: "service_github_octocat_1_ignorenotfound", @@ -486,21 +486,21 @@ func TestLinux_DestroyService(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.DestroyService(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("DestroyService should have returned err") + t.Errorf("%s DestroyService should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("DestroyService returned err: %v", err) + t.Errorf("%s DestroyService returned err: %v", test.name, err) } }) } diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 2beeba80..c1d05fbe 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -58,7 +58,7 @@ func TestLinux_CreateStage(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -68,7 +68,7 @@ func TestLinux_CreateStage(t *testing.T) { stage *pipeline.Stage }{ { - name: "basic stage", + name: "docker-basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -86,7 +86,7 @@ func TestLinux_CreateStage(t *testing.T) { }, }, { - name: "stage with step container with image not found", + name: "docker-stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -104,7 +104,7 @@ func TestLinux_CreateStage(t *testing.T) { }, }, { - name: "empty stage", + name: "docker-empty stage", failure: true, stage: new(pipeline.Stage), }, @@ -122,14 +122,14 @@ func TestLinux_CreateStage(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } if len(test.stage.Name) > 0 { // run create to init steps to be created properly err = _engine.CreateBuild(context.Background()) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("unable to create %s build: %v", test.name, err) } } @@ -137,14 +137,14 @@ func TestLinux_CreateStage(t *testing.T) { if test.failure { if err == nil { - t.Errorf("CreateStage should have returned err") + t.Errorf("%s CreateStage should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("CreateStage returned err: %v", err) + t.Errorf("%s CreateStage returned err: %v", test.name, err) } }) } @@ -167,7 +167,7 @@ func TestLinux_PlanStage(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } testMap := new(sync.Map) @@ -192,7 +192,7 @@ func TestLinux_PlanStage(t *testing.T) { stageMap *sync.Map }{ { - name: "basic stage", + name: "docker-basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -211,7 +211,7 @@ func TestLinux_PlanStage(t *testing.T) { stageMap: new(sync.Map), }, { - name: "basic stage with nil stage map", + name: "docker-basic stage with nil stage map", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -231,7 +231,7 @@ func TestLinux_PlanStage(t *testing.T) { stageMap: testMap, }, { - name: "basic stage with error stage map", + name: "docker-basic stage with error stage map", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -264,21 +264,21 @@ func TestLinux_PlanStage(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.PlanStage(context.Background(), test.stage, test.stageMap) if test.failure { if err == nil { - t.Errorf("PlanStage should have returned err") + t.Errorf("%s PlanStage should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("PlanStage returned err: %v", err) + t.Errorf("%s PlanStage returned err: %v", test.name, err) } }) } @@ -301,7 +301,7 @@ func TestLinux_ExecStage(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -314,7 +314,7 @@ func TestLinux_ExecStage(t *testing.T) { stage *pipeline.Stage }{ { - name: "basic stage", + name: "docker-basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -332,7 +332,7 @@ func TestLinux_ExecStage(t *testing.T) { }, }, { - name: "stage with step container with image not found", + name: "docker-stage with step container with image not found", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -350,7 +350,7 @@ func TestLinux_ExecStage(t *testing.T) { }, }, { - name: "stage with step container with bad number", + name: "docker-stage with step container with bad number", failure: true, stage: &pipeline.Stage{ Name: "echo", @@ -385,21 +385,21 @@ func TestLinux_ExecStage(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.ExecStage(context.Background(), test.stage, stageMap) if test.failure { if err == nil { - t.Errorf("ExecStage should have returned err") + t.Errorf("%s ExecStage should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("ExecStage returned err: %v", err) + t.Errorf("%s ExecStage returned err: %v", test.name, err) } }) } @@ -422,7 +422,7 @@ func TestLinux_DestroyStage(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -432,7 +432,7 @@ func TestLinux_DestroyStage(t *testing.T) { stage *pipeline.Stage }{ { - name: "basic stage", + name: "docker-basic stage", failure: false, stage: &pipeline.Stage{ Name: "echo", @@ -463,21 +463,21 @@ func TestLinux_DestroyStage(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.DestroyStage(context.Background(), test.stage) if test.failure { if err == nil { - t.Errorf("DestroyStage should have returned err") + t.Errorf("%s DestroyStage should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("DestroyStage returned err: %v", err) + t.Errorf("%s DestroyStage returned err: %v", test.name, err) } }) } diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 7c283acc..b0f4a400 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -41,7 +41,7 @@ func TestLinux_CreateStep(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -51,7 +51,7 @@ func TestLinux_CreateStep(t *testing.T) { container *pipeline.Container }{ { - name: "init step container", + name: "docker-init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -64,7 +64,7 @@ func TestLinux_CreateStep(t *testing.T) { }, }, { - name: "basic step container", + name: "docker-basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -77,7 +77,7 @@ func TestLinux_CreateStep(t *testing.T) { }, }, { - name: "step container with image not found", + name: "docker-step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -90,7 +90,7 @@ func TestLinux_CreateStep(t *testing.T) { }, }, { - name: "empty step container", + name: "docker-empty step container", failure: true, container: new(pipeline.Container), }, @@ -108,21 +108,21 @@ func TestLinux_CreateStep(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.CreateStep(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("CreateStep should have returned err") + t.Errorf("%s CreateStep should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("CreateStep returned err: %v", err) + t.Errorf("%s CreateStep returned err: %v", test.name, err) } }) } @@ -145,7 +145,7 @@ func TestLinux_PlanStep(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -155,7 +155,7 @@ func TestLinux_PlanStep(t *testing.T) { container *pipeline.Container }{ { - name: "basic step container", + name: "docker-basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -168,7 +168,7 @@ func TestLinux_PlanStep(t *testing.T) { }, }, { - name: "step container with nil environment", + name: "docker-step container with nil environment", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -181,7 +181,7 @@ func TestLinux_PlanStep(t *testing.T) { }, }, { - name: "empty step container", + name: "docker-empty step container", failure: true, container: new(pipeline.Container), }, @@ -199,21 +199,21 @@ func TestLinux_PlanStep(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.PlanStep(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("PlanStep should have returned err") + t.Errorf("%s PlanStep should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("PlanStep returned err: %v", err) + t.Errorf("%s PlanStep returned err: %v", test.name, err) } }) } @@ -236,7 +236,7 @@ func TestLinux_ExecStep(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) @@ -249,7 +249,7 @@ func TestLinux_ExecStep(t *testing.T) { container *pipeline.Container }{ { - name: "init step container", + name: "docker-init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -262,7 +262,7 @@ func TestLinux_ExecStep(t *testing.T) { }, }, { - name: "basic step container", + name: "docker-basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -275,7 +275,7 @@ func TestLinux_ExecStep(t *testing.T) { }, }, { - name: "detached step container", + name: "docker-detached step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -289,7 +289,7 @@ func TestLinux_ExecStep(t *testing.T) { }, }, { - name: "step container with image not found", + name: "docker-step container with image not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -302,7 +302,7 @@ func TestLinux_ExecStep(t *testing.T) { }, }, { - name: "empty step container", + name: "docker-empty step container", failure: true, container: new(pipeline.Container), }, @@ -321,7 +321,7 @@ func TestLinux_ExecStep(t *testing.T) { withStreamRequests(streamRequests), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } if !test.container.Empty() { @@ -333,14 +333,14 @@ func TestLinux_ExecStep(t *testing.T) { if test.failure { if err == nil { - t.Errorf("ExecStep should have returned err") + t.Errorf("%s ExecStep should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("ExecStep returned err: %v", err) + t.Errorf("%s ExecStep returned err: %v", test.name, err) } }) } @@ -368,7 +368,7 @@ func TestLinux_StreamStep(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -379,7 +379,7 @@ func TestLinux_StreamStep(t *testing.T) { container *pipeline.Container }{ { - name: "init step container", + name: "docker-init step container", failure: false, logs: _logs, container: &pipeline.Container{ @@ -393,7 +393,7 @@ func TestLinux_StreamStep(t *testing.T) { }, }, { - name: "basic step container", + name: "docker-basic step container", failure: false, logs: _logs, container: &pipeline.Container{ @@ -407,7 +407,7 @@ func TestLinux_StreamStep(t *testing.T) { }, }, { - name: "step container with name not found", + name: "docker-step container with name not found", failure: true, logs: _logs, container: &pipeline.Container{ @@ -421,7 +421,7 @@ func TestLinux_StreamStep(t *testing.T) { }, }, { - name: "empty step container", + name: "docker-empty step container", failure: true, logs: _logs, container: new(pipeline.Container), @@ -441,7 +441,7 @@ func TestLinux_StreamStep(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } if !test.container.Empty() { @@ -453,14 +453,14 @@ func TestLinux_StreamStep(t *testing.T) { if test.failure { if err == nil { - t.Errorf("StreamStep should have returned err") + t.Errorf("%s StreamStep should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("StreamStep returned err: %v", err) + t.Errorf("%s StreamStep returned err: %v", test.name, err) } }) } @@ -483,7 +483,7 @@ func TestLinux_DestroyStep(t *testing.T) { _runtime, err := docker.NewMock() if err != nil { - t.Errorf("unable to create runtime engine: %v", err) + t.Errorf("unable to create docker runtime engine: %v", err) } // setup tests @@ -493,7 +493,7 @@ func TestLinux_DestroyStep(t *testing.T) { container *pipeline.Container }{ { - name: "init step container", + name: "docker-init step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -506,7 +506,7 @@ func TestLinux_DestroyStep(t *testing.T) { }, }, { - name: "basic step container", + name: "docker-basic step container", failure: false, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -519,7 +519,7 @@ func TestLinux_DestroyStep(t *testing.T) { }, }, { - name: "step container with ignoring name not found", + name: "docker-step container with ignoring name not found", failure: true, container: &pipeline.Container{ ID: "step_github_octocat_1_ignorenotfound", @@ -545,21 +545,21 @@ func TestLinux_DestroyStep(t *testing.T) { WithVelaClient(_client), ) if err != nil { - t.Errorf("unable to create executor engine: %v", err) + t.Errorf("unable to create %s executor engine: %v", test.name, err) } err = _engine.DestroyStep(context.Background(), test.container) if test.failure { if err == nil { - t.Errorf("DestroyStep should have returned err") + t.Errorf("%s DestroyStep should have returned err", test.name) } return // continue to next test } if err != nil { - t.Errorf("DestroyStep returned err: %v", err) + t.Errorf("%s DestroyStep returned err: %v", test.name, err) } }) } From a3c194aa09babaff6d040598d5c570503e740088 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 9 Dec 2022 11:51:03 -0600 Subject: [PATCH 351/430] fix: Allow log streaming to take longer than build execution (#390) --- cmd/vela-worker/exec.go | 12 +++ cmd/vela-worker/run.go | 1 + executor/flags.go | 8 ++ executor/linux/build.go | 12 ++- executor/linux/build_test.go | 1 + executor/linux/linux.go | 2 + executor/linux/opts.go | 13 +++ executor/linux/opts_test.go | 41 ++++++++ executor/setup.go | 5 + executor/setup_test.go | 2 + internal/context/context.go | 49 ++++++++++ internal/context/context_test.go | 156 +++++++++++++++++++++++++++++++ internal/context/doc.go | 10 ++ 13 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 internal/context/context.go create mode 100644 internal/context/context_test.go create mode 100644 internal/context/doc.go diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 45f2f039..10411047 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,6 +6,7 @@ package main import ( "context" + "sync" "time" "github.com/go-vela/worker/executor" @@ -75,6 +76,7 @@ func (w *Worker) exec(index int) error { Driver: w.Config.Executor.Driver, LogMethod: w.Config.Executor.LogMethod, MaxLogSize: w.Config.Executor.MaxLogSize, + LogStreamingTimeout: w.Config.Executor.LogStreamingTimeout, EnforceTrustedRepos: w.Config.Executor.EnforceTrustedRepos, PrivilegedImages: w.Config.Runtime.PrivilegedImages, Client: w.VelaClient, @@ -108,7 +110,13 @@ func (w *Worker) exec(index int) error { timeoutCtx, timeout := context.WithTimeout(buildCtx, t) defer timeout() + // This WaitGroup delays calling DestroyBuild until the StreamBuild goroutine finishes. + var wg sync.WaitGroup + defer func() { + // if exec() exits before starting StreamBuild, this returns immediately. + wg.Wait() + logger.Info("destroying build") // destroy the build with the executor (pass a background @@ -137,8 +145,12 @@ func (w *Worker) exec(index int) error { return nil } + // add StreamBuild goroutine to WaitGroup + wg.Add(1) + // log/event streaming uses buildCtx so that it is not subject to the timeout. go func() { + defer wg.Done() logger.Info("streaming build logs") // execute the build with the executor err = _executor.StreamBuild(buildCtx) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 2fadcddc..482911e0 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -96,6 +96,7 @@ func run(c *cli.Context) error { Driver: c.String("executor.driver"), LogMethod: c.String("executor.log_method"), MaxLogSize: c.Uint("executor.max_log_size"), + LogStreamingTimeout: c.Duration("executor.log_streaming_timeout"), EnforceTrustedRepos: c.Bool("executor.enforce-trusted-repos"), }, // logger configuration diff --git a/executor/flags.go b/executor/flags.go index 95c96cfc..63de3dc6 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -5,6 +5,8 @@ package executor import ( + "time" + "github.com/go-vela/types/constants" "github.com/urfave/cli/v2" @@ -37,6 +39,12 @@ var Flags = []cli.Flag{ Name: "executor.max_log_size", Usage: "maximum log size (in bytes)", }, + &cli.DurationFlag{ + EnvVars: []string{"WORKER_LOG_STREAMING_TIMEOUT", "VELA_LOG_STREAMING_TIMEOUT", "LOG_STREAMING_TIMEOUT"}, + Name: "executor.log_streaming_timeout", + Usage: "maximum amount of time to wait for log streaming after build completes", + Value: 5 * time.Minute, + }, &cli.BoolFlag{ EnvVars: []string{"VELA_EXECUTOR_ENFORCE_TRUSTED_REPOS", "EXECUTOR_ENFORCE_TRUSTED_REPOS"}, FilePath: "/vela/executor/enforce_trusted_repos", diff --git a/executor/linux/build.go b/executor/linux/build.go index 8fa38f24..f57656a9 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -16,6 +16,7 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/worker/internal/build" + context2 "github.com/go-vela/worker/internal/context" "github.com/go-vela/worker/internal/image" "github.com/go-vela/worker/internal/step" ) @@ -566,10 +567,15 @@ func (c *client) ExecBuild(ctx context.Context) error { // StreamBuild receives a StreamRequest and then // runs StreamService or StreamStep in a goroutine. func (c *client) StreamBuild(ctx context.Context) error { + // cancel streaming after a timeout once the build has finished + delayedCtx, cancelStreaming := context2. + WithDelayedCancelPropagation(ctx, c.logStreamingTimeout, "streaming", c.Logger) + defer cancelStreaming() + // create an error group with the parent context // // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#WithContext - streams, streamCtx := errgroup.WithContext(ctx) + streams, streamCtx := errgroup.WithContext(delayedCtx) defer func() { c.Logger.Trace("waiting for stream functions to return") @@ -579,6 +585,8 @@ func (c *client) StreamBuild(ctx context.Context) error { c.Logger.Errorf("error in a stream request, %v", err) } + cancelStreaming() + c.Logger.Info("all stream functions have returned") }() @@ -607,7 +615,7 @@ func (c *client) StreamBuild(ctx context.Context) error { return nil }) - case <-ctx.Done(): + case <-delayedCtx.Done(): c.Logger.Debug("streaming context canceled") // build done or canceled return nil diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 42d465b3..97a99136 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1238,6 +1238,7 @@ func TestLinux_StreamBuild(t *testing.T) { WithPipeline(_pipeline), WithRepo(_repo), WithRuntime(_runtime), + WithLogStreamingTimeout(1*time.Second), WithUser(_user), WithVelaClient(_client), withStreamRequests(streamRequests), diff --git a/executor/linux/linux.go b/executor/linux/linux.go index a2346731..4a78d2fb 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -7,6 +7,7 @@ package linux import ( "reflect" "sync" + "time" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" @@ -34,6 +35,7 @@ type ( init *pipeline.Container logMethod string maxLogSize uint + logStreamingTimeout time.Duration privilegedImages []string enforceTrustedRepos bool build *library.Build diff --git a/executor/linux/opts.go b/executor/linux/opts.go index a75d0a42..1b143152 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -6,6 +6,7 @@ package linux import ( "fmt" + "time" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" @@ -64,6 +65,18 @@ func WithMaxLogSize(size uint) Opt { } } +// WithLogStreamingTimeout sets the log streaming timeout in the executor client for Linux. +func WithLogStreamingTimeout(timeout time.Duration) Opt { + return func(c *client) error { + c.Logger.Trace("configuring log streaming timeout in linux executor client") + + // set the maximum log size in the client + c.logStreamingTimeout = timeout + + return nil + } +} + // WithPrivilegedImages sets the privileged images in the executor client for Linux. func WithPrivilegedImages(images []string) Opt { return func(c *client) error { diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index f01c6b87..f4fe9efa 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -8,6 +8,7 @@ import ( "net/http/httptest" "reflect" "testing" + "time" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" @@ -161,6 +162,46 @@ func TestLinux_Opt_WithMaxLogSize(t *testing.T) { } } +func TestLinux_Opt_WithLogStreamingTimeout(t *testing.T) { + // setup tests + tests := []struct { + name string + failure bool + logStreamingTimeout time.Duration + }{ + { + name: "defined", + failure: false, + logStreamingTimeout: 1 * time.Second, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _engine, err := New( + WithLogStreamingTimeout(test.logStreamingTimeout), + ) + + if test.failure { + if err == nil { + t.Errorf("WithLogStreamingTimeout should have returned err") + } + + return // continue to next test + } + + if err != nil { + t.Errorf("WithLogStreamingTimeout returned err: %v", err) + } + + if !reflect.DeepEqual(_engine.logStreamingTimeout, test.logStreamingTimeout) { + t.Errorf("WithLogStreamingTimeout is %v, want %v", _engine.logStreamingTimeout, test.logStreamingTimeout) + } + }) + } +} + func TestLinux_Opt_WithPrivilegedImages(t *testing.T) { // setup tests tests := []struct { diff --git a/executor/setup.go b/executor/setup.go index 2b07f7ae..333a83d6 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -7,6 +7,7 @@ package executor import ( "fmt" "strings" + "time" "github.com/go-vela/sdk-go/vela" @@ -40,6 +41,9 @@ type Setup struct { LogMethod string // specifies the maximum log size MaxLogSize uint + // specifies how long to wait after the build finishes + // for log streaming to complete + LogStreamingTimeout time.Duration // specifies a list of privileged images to use PrivilegedImages []string // configuration for enforcing that only trusted repos may run privileged images @@ -85,6 +89,7 @@ func (s *Setup) Linux() (Engine, error) { linux.WithBuild(s.Build), linux.WithLogMethod(s.LogMethod), linux.WithMaxLogSize(s.MaxLogSize), + linux.WithLogStreamingTimeout(s.LogStreamingTimeout), linux.WithPrivilegedImages(s.PrivilegedImages), linux.WithEnforceTrustedRepos(s.EnforceTrustedRepos), linux.WithHostname(s.Hostname), diff --git a/executor/setup_test.go b/executor/setup_test.go index 069993d1..615b9ccd 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -7,6 +7,7 @@ package executor import ( "net/http/httptest" "testing" + "time" "github.com/gin-gonic/gin" "github.com/google/go-cmp/cmp" @@ -79,6 +80,7 @@ func TestExecutor_Setup_Linux(t *testing.T) { linux.WithBuild(_build), linux.WithLogMethod("byte-chunks"), linux.WithMaxLogSize(2097152), + linux.WithLogStreamingTimeout(1*time.Second), linux.WithHostname("localhost"), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), diff --git a/internal/context/context.go b/internal/context/context.go new file mode 100644 index 00000000..04cea667 --- /dev/null +++ b/internal/context/context.go @@ -0,0 +1,49 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package context + +import ( + "context" + "time" + + "github.com/sirupsen/logrus" +) + +func WithDelayedCancelPropagation(parent context.Context, timeout time.Duration, name string, logger *logrus.Entry) (context.Context, context.CancelFunc) { + ctx, cancel := context.WithCancel(context.Background()) + + go func() { + var timer *time.Timer + + // start the timer once the parent context is canceled + select { + case <-parent.Done(): + logger.Tracef("parent context is done, starting %s timer for %s", name, timeout) + timer = time.NewTimer(timeout) + + break + case <-ctx.Done(): + logger.Tracef("%s finished before the parent context", name) + + return + } + + // wait for the timer to elapse or the context to naturally finish. + select { + case <-timer.C: + logger.Tracef("%s timed out, propagating cancel to %s context", name, name) + cancel() + + return + case <-ctx.Done(): + logger.Tracef("%s finished, stopping timeout timer", name) + timer.Stop() + + return + } + }() + + return ctx, cancel +} diff --git a/internal/context/context_test.go b/internal/context/context_test.go new file mode 100644 index 00000000..140fa5fb --- /dev/null +++ b/internal/context/context_test.go @@ -0,0 +1,156 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package context + +import ( + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/sirupsen/logrus" + logrusTest "github.com/sirupsen/logrus/hooks/test" +) + +// shortDuration copied from +// https://github.com/golang/go/blob/go1.19.1/src/context/context_test.go#L45 +const shortDuration = 1 * time.Millisecond // a reasonable duration to block in a test + +// quiescent returns an arbitrary duration by which the program should have +// completed any remaining work and reached a steady (idle) state. +// +// copied from https://github.com/golang/go/blob/go1.19.1/src/context/context_test.go#L49-L59 +func quiescent(t *testing.T) time.Duration { + deadline, ok := t.Deadline() + if !ok { + return 5 * time.Second + } + + const arbitraryCleanupMargin = 1 * time.Second + + return time.Until(deadline) - arbitraryCleanupMargin +} + +// testCancelPropagated is a helper that tests deadline/timeouts. +// +// based on testDeadline from +// https://github.com/golang/go/blob/go1.19.1/src/context/context_test.go#L272-L285 +func testCancelPropagated(c context.Context, name string, t *testing.T) { + t.Helper() + d := quiescent(t) + + timer := time.NewTimer(d) + defer timer.Stop() + + select { + case <-timer.C: + t.Fatalf("%s: context not timed out after %v", name, d) + case <-c.Done(): + } + //if e := c.Err(); e != context.DeadlineExceeded { // original line + if e := c.Err(); !errors.Is(e, context.Canceled) { // delayedCancelPropagation triggers this instead + t.Errorf("%s: c.Err() == %v; want %v", name, e, context.Canceled) + } +} + +func TestWithDelayedCancelPropagation(t *testing.T) { + parentLogger := logrus.New() + parentLogger.SetLevel(logrus.TraceLevel) + + loggerHook := logrusTest.NewLocal(parentLogger) + + nameArg := "streaming" + + tests := []struct { + name string + cancelParent string // before, after, never + timeout time.Duration + cancelCtxAfter time.Duration + lastLogMessage string + }{ + { + name: "cancel parent before call-child finishes before timeout", + cancelParent: "before", + timeout: shortDuration * 5, + cancelCtxAfter: shortDuration, + lastLogMessage: nameArg + " finished, stopping timeout timer", + }, + { + name: "cancel parent before call-child exceeds timeout", + cancelParent: "before", + timeout: shortDuration, + cancelCtxAfter: shortDuration * 5, + lastLogMessage: nameArg + " timed out, propagating cancel to " + nameArg + " context", + }, + { + name: "child finished before timeout and before parent cancel", + cancelParent: "never", + timeout: shortDuration * 5, + cancelCtxAfter: shortDuration, + lastLogMessage: nameArg + " finished before the parent context", + }, + { + name: "cancel parent after call-child finishes before timeout", + cancelParent: "after", + timeout: shortDuration * 5, + cancelCtxAfter: shortDuration, + lastLogMessage: nameArg + " finished, stopping timeout timer", + }, + { + name: "cancel parent after call-child exceeds timeout", + cancelParent: "after", + timeout: shortDuration, + cancelCtxAfter: shortDuration * 5, + lastLogMessage: nameArg + " timed out, propagating cancel to " + nameArg + " context", + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + defer loggerHook.Reset() + + logger := parentLogger.WithFields(logrus.Fields{"test": test.name}) + + parentCtx, parentCtxCancel := context.WithCancel(context.Background()) + defer parentCtxCancel() // handles test.CancelParent == "never" case + + if test.cancelParent == "before" { + parentCtxCancel() + } + + ctx, cancel := WithDelayedCancelPropagation(parentCtx, test.timeout, nameArg, logger) + defer cancel() + + // test based on test for context.WithCancel + if got, want := fmt.Sprint(ctx), "context.Background.WithCancel"; got != want { + t.Errorf("ctx.String() = %q want %q", got, want) + } + + if d := ctx.Done(); d == nil { + t.Errorf("ctx.Done() == %v want non-nil", d) + } + if e := ctx.Err(); e != nil { + t.Errorf("ctx.Err() == %v want nil", e) + } + + if test.cancelParent == "after" { + parentCtxCancel() + } + + go func() { + time.Sleep(test.cancelCtxAfter) + cancel() + }() + + testCancelPropagated(ctx, "WithDelayedCancelPropagation", t) + + time.Sleep(shortDuration) + lastLogEntry := loggerHook.LastEntry() + if lastLogEntry.Message != test.lastLogMessage { + t.Errorf("unexpected last log entry: want = %s ; got = %s", test.lastLogMessage, lastLogEntry.Message) + } + }) + } +} diff --git a/internal/context/doc.go b/internal/context/doc.go new file mode 100644 index 00000000..c7c2f795 --- /dev/null +++ b/internal/context/doc.go @@ -0,0 +1,10 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +// Package context provides context utilities. +// +// Usage: +// +// import "github.com/go-vela/worker/internal/context" +package context From e04fd335222308ba76c65d3f911e46b0a0461230 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:40:06 -0600 Subject: [PATCH 352/430] fix(deps): update module github.com/urfave/cli/v2 to v2.23.6 (#401) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fad53ff4..65937348 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.23.5 + github.com/urfave/cli/v2 v2.23.6 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.25.3 diff --git a/go.sum b/go.sum index 13158bb2..87cf1163 100644 --- a/go.sum +++ b/go.sum @@ -402,8 +402,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= -github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.23.6 h1:iWmtKD+prGo1nKUtLO0Wg4z9esfBM4rAV4QRLQiEmJ4= +github.com/urfave/cli/v2 v2.23.6/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 685da4a038043708c8a29580b33863eac46de1e3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 14:27:11 -0600 Subject: [PATCH 353/430] fix(deps): update module github.com/masterminds/semver/v3 to v3.2.0 (#404) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 65937348..f96d13d4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/go-vela/worker go 1.19 require ( - github.com/Masterminds/semver/v3 v3.1.1 + github.com/Masterminds/semver/v3 v3.2.0 github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.21+incompatible github.com/docker/go-units v0.5.0 diff --git a/go.sum b/go.sum index 87cf1163..c7dd69b4 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= From 97f11280048ec95711963c310406b43b88eab4ab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 14:32:26 -0600 Subject: [PATCH 354/430] chore(deps): update elgohr/publish-docker-github-action action to v5 (#406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/prerelease.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index adb370ed..fe0bf035 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -40,7 +40,7 @@ jobs: make build-static-ci - name: publish - uses: elgohr/Publish-Docker-Github-Action@v4 + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: target/vela-worker cache: true @@ -49,7 +49,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: publish-alpine - uses: elgohr/Publish-Docker-Github-Action@v4 + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: target/vela-worker cache: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5d2b56f2..469e2d70 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: make build-static-ci - name: publish - uses: elgohr/Publish-Docker-Github-Action@v4 + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: target/vela-worker cache: true @@ -42,7 +42,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: publish-alpine - uses: elgohr/Publish-Docker-Github-Action@v4 + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: target/vela-worker cache: true From f8ed8e91ddcb508c200f6b9e942dd1f32e684cda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 14:36:14 -0600 Subject: [PATCH 355/430] fix(deps): update kubernetes packages to v0.26.0 (#407) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 24 ++++++++++++------------ go.sum | 56 ++++++++++++++++++++++++++------------------------------ 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/go.mod b/go.mod index f96d13d4..8bd2a18a 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.23.6 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 - k8s.io/api v0.25.3 - k8s.io/apimachinery v0.25.3 - k8s.io/client-go v0.25.3 + k8s.io/api v0.26.0 + k8s.io/apimachinery v0.26.0 + k8s.io/client-go v0.26.0 sigs.k8s.io/yaml v1.3.0 ) @@ -42,13 +42,13 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/drone/envsubst v1.0.3 // indirect - github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.19.14 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect @@ -99,20 +99,20 @@ require ( github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.1.0 // indirect + golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.70.1 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index c7dd69b4..4cd33f2e 100644 --- a/go.sum +++ b/go.sum @@ -102,8 +102,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= -github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -131,15 +131,14 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -325,8 +324,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= +github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -381,7 +380,6 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= @@ -480,7 +478,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -503,8 +500,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -581,13 +578,13 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -596,8 +593,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -786,19 +783,18 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ= -k8s.io/api v0.25.3/go.mod h1:o42gKscFrEVjHdQnyRenACrMtbuJsVdP+WVjqejfzmI= -k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc= -k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= -k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= -k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= +k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= +k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= +k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8= +k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From ec7ec7c53d4dce7081537674e339b71af6efece1 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:38:12 -0600 Subject: [PATCH 356/430] fix: revert log streaming commit (#409) --- cmd/vela-worker/exec.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 10411047..a8a2b80d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,7 +6,6 @@ package main import ( "context" - "sync" "time" "github.com/go-vela/worker/executor" @@ -110,13 +109,7 @@ func (w *Worker) exec(index int) error { timeoutCtx, timeout := context.WithTimeout(buildCtx, t) defer timeout() - // This WaitGroup delays calling DestroyBuild until the StreamBuild goroutine finishes. - var wg sync.WaitGroup - defer func() { - // if exec() exits before starting StreamBuild, this returns immediately. - wg.Wait() - logger.Info("destroying build") // destroy the build with the executor (pass a background @@ -145,12 +138,8 @@ func (w *Worker) exec(index int) error { return nil } - // add StreamBuild goroutine to WaitGroup - wg.Add(1) - // log/event streaming uses buildCtx so that it is not subject to the timeout. go func() { - defer wg.Done() logger.Info("streaming build logs") // execute the build with the executor err = _executor.StreamBuild(buildCtx) From fcc4f3d0259bde669b32dc6984c3e5a6ac7287c7 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 13 Dec 2022 08:20:27 -0700 Subject: [PATCH 357/430] feat(stage): stages fail independently when continue is set to true (#318) * first draft * changing dependent to continue and ditching print statements * changing continue to independent and linter work * adding new types in go mod * go mod tidy * adding additional stop check in stage loop and more comments Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- docker-compose.yml | 1 + executor/linux/stage.go | 25 +++++++++++++++++++++++++ executor/linux/stage_test.go | 9 ++++++--- go.mod | 4 ++-- go.sum | 8 ++++---- internal/step/skip.go | 9 +++++---- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 544e898c..67cad74c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,6 +74,7 @@ services: VELA_ACCESS_TOKEN_DURATION: 60m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' + VELA_REPO_ALLOWLIST: '*' env_file: - .env restart: always diff --git a/executor/linux/stage.go b/executor/linux/stage.go index ddab1b86..869faf27 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -9,6 +9,7 @@ import ( "fmt" "sync" + "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/step" ) @@ -118,8 +119,26 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) }() logger.Debug("starting execution of stage") + + // stop value determines when a stage's step series should stop executing + stop := false + // execute the steps for the stage for _, _step := range s.Steps { + // first check to see if we need to stop the stage before it even starts. + // this happens when using 'needs' block + if !s.Independent && c.build.GetStatus() == constants.StatusFailure { + stop = true + } + + // set parallel rule that determines whether the step should adhere to entire build + // status check, which is determined by independent rule and stop value. + if !stop && s.Independent { + _step.Ruleset.If.Parallel = true + } else { + _step.Ruleset.If.Parallel = false + } + // check if the step should be skipped // // https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip @@ -140,6 +159,12 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map) if err != nil { return fmt.Errorf("unable to exec step %s: %w", _step.Name, err) } + + // failed steps within the stage should set the stop value to true unless + // the continue rule is set to true. + if _step.ExitCode != 0 && !_step.Ruleset.Continue { + stop = true + } } return nil diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index c1d05fbe..1a995b79 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -317,7 +317,8 @@ func TestLinux_ExecStage(t *testing.T) { name: "docker-basic stage", failure: false, stage: &pipeline.Stage{ - Name: "echo", + Independent: true, + Name: "echo", Steps: pipeline.ContainerSlice{ { ID: "github_octocat_1_echo_echo", @@ -335,7 +336,8 @@ func TestLinux_ExecStage(t *testing.T) { name: "docker-stage with step container with image not found", failure: true, stage: &pipeline.Stage{ - Name: "echo", + Name: "echo", + Independent: true, Steps: pipeline.ContainerSlice{ { ID: "github_octocat_1_echo_echo", @@ -353,7 +355,8 @@ func TestLinux_ExecStage(t *testing.T) { name: "docker-stage with step container with bad number", failure: true, stage: &pipeline.Stage{ - Name: "echo", + Name: "echo", + Independent: true, Steps: pipeline.ContainerSlice{ { ID: "github_octocat_1_echo_echo", diff --git a/go.mod b/go.mod index 8bd2a18a..7a711c22 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.16.2 github.com/go-vela/server v0.16.2 - github.com/go-vela/types v0.16.2 + github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -34,7 +34,7 @@ require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/alicebob/miniredis/v2 v2.23.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 // indirect + github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect diff --git a/go.sum b/go.sum index 4cd33f2e..21d712d3 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3 h1:q+sMKdA6L8LyGVudTkpGoC73h6ak2iWSPFiFo/pFOU8= -github.com/buildkite/yaml v0.0.0-20181016232759-0caa5f0796e3/go.mod h1:5hCug3EZaHXU3FdCA3gJm0YTNi+V+ooA2qNTiVpky4A= +github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 h1:qLN32md48xyTEqw6XEZMyNMre7njm0XXvDrea6NVwOM= +github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -157,8 +157,8 @@ github.com/go-vela/sdk-go v0.16.2 h1:M9+u89mGomJc2uwUPVGWp9UnUIFm0IhIIsFEfxROhZQ github.com/go-vela/sdk-go v0.16.2/go.mod h1:BuTkw+MYWbAKJ6+ZtQ/nNmwIcjn/tysCPks4X+csBGE= github.com/go-vela/server v0.16.2 h1:qovjGN9ZQazjV0JTXzP6o5UPSs1D+wyUMpbG4G6aXZI= github.com/go-vela/server v0.16.2/go.mod h1:bf9dpkzhL2T6G6fxIwjmMjzoD+e5Xfmg3DcckP6lqHc= -github.com/go-vela/types v0.16.2 h1:c2Kkj7OKv4sjPrsOBbnPSQqfsNpOFM2La7LfP+81EF0= -github.com/go-vela/types v0.16.2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d h1:8RZaWRt/VMH69oW1EYSLHHQvf7yD899Ur235lhpAG68= +github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= diff --git a/internal/step/skip.go b/internal/step/skip.go index 2daef324..a341ae0f 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -33,10 +33,11 @@ func Skip(c *pipeline.Container, b *library.Build, r *library.Repo) bool { // // https://pkg.go.dev/github.com/go-vela/types/pipeline#RuleData ruledata := &pipeline.RuleData{ - Branch: b.GetBranch(), - Event: event, - Repo: r.GetFullName(), - Status: b.GetStatus(), + Branch: b.GetBranch(), + Event: event, + Repo: r.GetFullName(), + Status: b.GetStatus(), + Parallel: c.Ruleset.If.Parallel, } // check if the build event is tag From 8a69eb563b3fdbbe4df4c6ff0514c12d92309300 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:44:09 -0600 Subject: [PATCH 358/430] fix: move trusted repos check to handle dynamic images (#405) --- executor/linux/build.go | 153 +++++------ executor/linux/build_test.go | 238 +++++++++++++++++- .../build/services/img_environmentdynamic.yml | 22 ++ .../build/stages/img_environmentdynamic.yml | 17 ++ .../build/steps/img_environmentdynamic.yml | 15 ++ 5 files changed, 370 insertions(+), 75 deletions(-) create mode 100644 executor/linux/testdata/build/services/img_environmentdynamic.yml create mode 100644 executor/linux/testdata/build/stages/img_environmentdynamic.yml create mode 100644 executor/linux/testdata/build/steps/img_environmentdynamic.yml diff --git a/executor/linux/build.go b/executor/linux/build.go index f57656a9..e4193e05 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -14,7 +14,6 @@ import ( "golang.org/x/sync/errgroup" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" "github.com/go-vela/worker/internal/build" context2 "github.com/go-vela/worker/internal/context" "github.com/go-vela/worker/internal/image" @@ -45,74 +44,6 @@ func (c *client) CreateBuild(ctx context.Context) error { return fmt.Errorf("unable to upload build state: %w", c.err) } - // before setting up the build, enforce repo.trusted is set for pipelines containing privileged images - // this configuration is set as an executor flag - if c.enforceTrustedRepos { - // check if pipeline steps contain privileged images - // assume no privileged images are in use - containsPrivilegedImages := false - - // group steps services and stages together - containers := c.pipeline.Steps - - containers = append(containers, c.pipeline.Services...) - for _, stage := range c.pipeline.Stages { - containers = append(containers, stage.Steps...) - } - - for _, container := range containers { - // TODO: remove hardcoded reference - if container.Image == "#init" { - continue - } - - for _, pattern := range c.privilegedImages { - privileged, err := image.IsPrivilegedImage(container.Image, pattern) - if err != nil { - return fmt.Errorf("could not verify if image %s is privileged", container.Image) - } - - if privileged { - containsPrivilegedImages = true - } - } - } - - // check if this build should be denied - if (containsPrivilegedImages) && !(c.repo != nil && c.repo.GetTrusted()) { - // deny the build, clean build/steps, and return error - // populate the build error - e := "build denied, repo must be trusted in order to run privileged images" - c.build.SetError(e) - // set the build status to error - c.build.SetStatus(constants.StatusError) - - steps := c.pipeline.Steps - for _, stage := range c.pipeline.Stages { - steps = append(containers, stage.Steps...) - } - - // update all preconfigured steps to the correct status - for _, s := range steps { - // extract step - step := library.StepFromBuildContainer(c.build, s) - // status to use for preconfigured steps that are not ran - status := constants.StatusKilled - // set step status - step.SetStatus(status) - // send API call to update the step - //nolint:contextcheck // ignore passing context - _, _, err := c.Vela.Step.Update(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), step) - if err != nil { - // only log any step update errors to allow the return err to run - c.Logger.Errorf("unable to update step %s to status %s: %s", s.Name, status, err.Error()) - } - } - - return fmt.Errorf("build containing privileged images %s/%d denied, repo is not trusted", c.repo.GetFullName(), c.build.GetNumber()) - } - } - // setup the runtime build c.err = c.Runtime.SetupBuild(ctx, c.pipeline) if c.err != nil { @@ -262,7 +193,7 @@ func (c *client) PlanBuild(ctx context.Context) error { // AssembleBuild prepares the containers within a build for execution. // -//nolint:funlen // ignore function length due to comments and logging messages +//nolint:gocyclo,funlen // ignore cyclomatic complexity and function length due to comments and logging messages func (c *client) AssembleBuild(ctx context.Context) error { // defer taking a snapshot of the build // @@ -419,6 +350,88 @@ func (c *client) AssembleBuild(ctx context.Context) error { // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData _log.AppendData(image) } + // enforce repo.trusted is set for pipelines containing privileged images + // if not enforced, allow all that exist in the list of runtime privileged images + // this configuration is set as an executor flag + if c.enforceTrustedRepos { + // group steps services stages and secret origins together + containers := c.pipeline.Steps + + containers = append(containers, c.pipeline.Services...) + + for _, stage := range c.pipeline.Stages { + containers = append(containers, stage.Steps...) + } + + for _, secret := range c.pipeline.Secrets { + containers = append(containers, secret.Origin) + } + + // assume no privileged images are in use + containsPrivilegedImages := false + + // verify all pipeline containers + for _, container := range containers { + // TODO: remove hardcoded reference + if container.Image == "#init" { + continue + } + + // skip over non-plugin secrets origins + if container.Empty() { + continue + } + + c.Logger.Infof("verifying privileges for container %s", container.Name) + + // update the init log with image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte(fmt.Sprintf("Verifying privileges for image %s...\n", container.Image))) + + for _, pattern := range c.privilegedImages { + // check if image matches privileged pattern + privileged, err := image.IsPrivilegedImage(container.Image, pattern) + if err != nil { + // wrap the error + c.err = fmt.Errorf("unable to verify privileges for image %s: %w", container.Image, err) + + // update the init log with image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte(fmt.Sprintf("ERROR: %s\n", c.err.Error()))) + + // return error and destroy the build + // ignore checking more images + return c.err + } + + if privileged { + // pipeline contains at least one privileged image + containsPrivilegedImages = privileged + } + } + + // update the init log with image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte(fmt.Sprintf("Privileges verified for image %s\n", container.Image))) + } + + // ensure pipelines containing privileged images are only permitted to run by trusted repos + if (containsPrivilegedImages) && !(c.repo != nil && c.repo.GetTrusted()) { + // update error + c.err = fmt.Errorf("unable to assemble build. pipeline contains privileged images and repo is not trusted") + + // update the init log with image info + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData([]byte(fmt.Sprintf("ERROR: %s\n", c.err.Error()))) + + // return error and destroy the build + return c.err + } + } // inspect the runtime build (eg a kubernetes pod) for the pipeline buildOutput, err := c.Runtime.InspectBuild(ctx, c.pipeline) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 97a99136..ade7766d 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -130,11 +130,16 @@ func TestLinux_CreateBuild(t *testing.T) { } } -func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { +func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { // setup types compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) _build := testBuild() + + // setting mock build for testing dynamic environment tags + _buildWithMessageAlpine := testBuild() + _buildWithMessageAlpine.SetMessage("alpine") + // test repo is not trusted by default _untrustedRepo := testRepo() _user := testUser() @@ -145,7 +150,6 @@ func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { _privilegedImagesServicesPipeline := []string{"postgres"} // to be matched with the image used by testdata/build/stages/basic.yml _privilegedImagesStagesPipeline := []string{"alpine"} - // create trusted repo _trustedRepo := testRepo() _trustedRepo.SetTrusted(true) @@ -245,7 +249,78 @@ func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { privilegedImages: []string{}, // this matches the image from test.pipeline enforceTrustedRepos: false, }, - + { + name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo and dynamic image:tag", + failure: true, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStepsPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/steps/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, { name: "enforce trusted repos enabled: privileged services pipeline with trusted repo", failure: false, @@ -318,6 +393,78 @@ func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { privilegedImages: []string{}, // this matches the image from test.pipeline enforceTrustedRepos: false, }, + { + name: "enforce trusted repos enabled: privileged services pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo and dynamic image:tag", + failure: true, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesServicesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/services/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, { name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo", failure: false, @@ -390,6 +537,78 @@ func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { privilegedImages: []string{}, // this matches the image from test.pipeline enforceTrustedRepos: false, }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo and dynamic image:tag", + failure: true, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: true, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: _privilegedImagesStagesPipeline, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _trustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, + { + name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", + failure: false, + build: _buildWithMessageAlpine, + repo: _untrustedRepo, + pipeline: "testdata/build/stages/img_environmentdynamic.yml", + privilegedImages: []string{}, // this matches the image from test.pipeline + enforceTrustedRepos: false, + }, { name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo and init step name", failure: false, @@ -637,17 +856,26 @@ func TestLinux_CreateBuild_EnforceTrustedRepos(t *testing.T) { } err = _engine.CreateBuild(context.Background()) + if err != nil { + t.Errorf("CreateBuild returned err: %v", err) + } + + // override mock handler PUT build update + // used for dynamic substitute testing + _engine.build.SetMessage(test.build.GetMessage()) + + err = _engine.AssembleBuild(context.Background()) if test.failure { if err == nil { - t.Errorf("CreateBuild should have returned err") + t.Errorf("AssembleBuild should have returned err") } return // continue to next test } if err != nil { - t.Errorf("CreateBuild returned err: %v", err) + t.Errorf("AssembleBuild returned err: %v", err) } }) } diff --git a/executor/linux/testdata/build/services/img_environmentdynamic.yml b/executor/linux/testdata/build/services/img_environmentdynamic.yml new file mode 100644 index 00000000..92cf36cb --- /dev/null +++ b/executor/linux/testdata/build/services/img_environmentdynamic.yml @@ -0,0 +1,22 @@ +--- +version: "1" + +environment: + DYNAMIC_IMAGE: "postgres" + DYNAMIC_TAG: "latest" + +services: + - name: test + environment: + FOO: bar + image: "${DYNAMIC_IMAGE}:${DYNAMIC_TAG}" + pull: on_start + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: alpine:latest + pull: true \ No newline at end of file diff --git a/executor/linux/testdata/build/stages/img_environmentdynamic.yml b/executor/linux/testdata/build/stages/img_environmentdynamic.yml new file mode 100644 index 00000000..6306a5f9 --- /dev/null +++ b/executor/linux/testdata/build/stages/img_environmentdynamic.yml @@ -0,0 +1,17 @@ +--- +version: "1" + +environment: + DYNAMIC_IMAGE: "${VELA_BUILD_MESSAGE}" + DYNAMIC_TAG: "${VELA_BUILD_NUMBER}" + +stages: + test: + steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: "${DYNAMIC_IMAGE}:${DYNAMIC_TAG}" + pull: on_start diff --git a/executor/linux/testdata/build/steps/img_environmentdynamic.yml b/executor/linux/testdata/build/steps/img_environmentdynamic.yml new file mode 100644 index 00000000..3d947ab5 --- /dev/null +++ b/executor/linux/testdata/build/steps/img_environmentdynamic.yml @@ -0,0 +1,15 @@ +--- +version: "1" + +environment: + DYNAMIC_IMAGE: "${VELA_BUILD_MESSAGE}" + DYNAMIC_TAG: "${VELA_BUILD_NUMBER}" + +steps: + - name: test + commands: + - echo ${FOO} + environment: + FOO: bar + image: "${DYNAMIC_IMAGE}:${DYNAMIC_TAG}" + pull: on_start From 97a1841910b5eeade7de7add7eeb739b3c0d7cd9 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 14 Dec 2022 14:36:21 -0600 Subject: [PATCH 359/430] chore: remove code of conduct in favor of global version (#403) Co-authored-by: dave vader <48764154+plyr4@users.noreply.github.com> --- .github/CODE_OF_CONDUCT.md | 74 -------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 11345c24..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to make participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -- The use of sexualized language or imagery and unwelcome sexual attention or - advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or electronic - address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at -[TTS-OpenSource-Office@target.com](mailto:TTS-OpenSource-Office@target.com). All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org From 83fb8ab121305d456b35bc894e369725ffe0a577 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 14 Dec 2022 14:46:59 -0600 Subject: [PATCH 360/430] chore(release): dependency updates for v0.17.0-rc1 (#412) --- go.mod | 20 ++++++++++---------- go.sum | 55 ++++++++++++++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 7a711c22..2165da97 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.21+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.16.2 - github.com/go-vela/server v0.16.2 - github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d + github.com/go-vela/sdk-go v0.17.0-rc1 + github.com/go-vela/server v0.17.0-rc1 + github.com/go-vela/types v0.17.0-rc1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 @@ -27,7 +27,7 @@ require ( require ( github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect @@ -56,7 +56,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect + github.com/golang-jwt/jwt/v4 v4.4.3 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v44 v44.1.0 // indirect @@ -68,7 +68,7 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.1 // indirect - github.com/huandu/xstrings v1.3.2 // indirect + github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -91,16 +91,16 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect - go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 // indirect - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect + go.starlark.net v0.0.0-20221205180719-3fd0dac74452 // indirect + golang.org/x/crypto v0.3.0 // indirect golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect + golang.org/x/oauth2 v0.3.0 // indirect golang.org/x/sys v0.3.0 // indirect golang.org/x/term v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect diff --git a/go.sum b/go.sum index 21d712d3..6e34b7d9 100644 --- a/go.sum +++ b/go.sum @@ -43,11 +43,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= @@ -153,19 +152,19 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.16.2 h1:M9+u89mGomJc2uwUPVGWp9UnUIFm0IhIIsFEfxROhZQ= -github.com/go-vela/sdk-go v0.16.2/go.mod h1:BuTkw+MYWbAKJ6+ZtQ/nNmwIcjn/tysCPks4X+csBGE= -github.com/go-vela/server v0.16.2 h1:qovjGN9ZQazjV0JTXzP6o5UPSs1D+wyUMpbG4G6aXZI= -github.com/go-vela/server v0.16.2/go.mod h1:bf9dpkzhL2T6G6fxIwjmMjzoD+e5Xfmg3DcckP6lqHc= -github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d h1:8RZaWRt/VMH69oW1EYSLHHQvf7yD899Ur235lhpAG68= -github.com/go-vela/types v0.16.3-0.20221209200126-e2772715208d/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.17.0-rc1 h1:V33/5nRoKE3NYAlVaZzahv13JWTHtrgyvrwiDf4lWuI= +github.com/go-vela/sdk-go v0.17.0-rc1/go.mod h1:7fEajiLq+LSpvTZMEzNfQXZbCQjGYqIJxsoqZ/Y07qs= +github.com/go-vela/server v0.17.0-rc1 h1:tF0mI5hjS/9hihDmOgq2rQt+kx7vT2oM9BssvC+t8oI= +github.com/go-vela/server v0.17.0-rc1/go.mod h1:OBAqZdb+ifgllVgRCB53jyXHV/KiBlpguWzUcQgRJ9Q= +github.com/go-vela/types v0.17.0-rc1 h1:OnQByNmqWssqpfe9RNai7d9V1KfMJGfamymnsqFAaC0= +github.com/go-vela/types v0.17.0-rc1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= +github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -254,9 +253,8 @@ github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1 github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= 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= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= @@ -380,8 +378,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= +github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -409,6 +407,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -417,20 +416,20 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 h1:5/KzhcSqd4UgY51l17r7C5g/JiE6DRw1Vq7VJfQHuMc= -go.starlark.net v0.0.0-20221028183056-acb66ad56dd2/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= +go.starlark.net v0.0.0-20221205180719-3fd0dac74452 h1:JZtNuL6LPB+scU5yaQ6hqRlJFRiddZm2FwRt2AQqtHA= +go.starlark.net v0.0.0-20221205180719-3fd0dac74452/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -464,6 +463,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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 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= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -500,6 +500,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -513,8 +515,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= +golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -525,6 +527,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -577,12 +580,16 @@ 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-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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -593,6 +600,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -650,6 +658,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 4946c91e8f8bc456abd6209eccecda6e275b75a5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 16 Dec 2022 09:38:05 -0600 Subject: [PATCH 361/430] fix: improve streaming coordination so it does not hang (#410) --- cmd/vela-worker/exec.go | 39 +++++++---- executor/linux/build.go | 29 ++++++-- executor/linux/build_test.go | 130 +++++++++++++++++++++++++++++------ executor/linux/linux.go | 1 + 4 files changed, 158 insertions(+), 41 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index a8a2b80d..06a60ae8 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,6 +6,7 @@ package main import ( "context" + "sync" "time" "github.com/go-vela/worker/executor" @@ -91,6 +92,27 @@ func (w *Worker) exec(index int) error { // add the executor to the worker w.Executors[index] = _executor + // This WaitGroup delays calling DestroyBuild until the StreamBuild goroutine finishes. + var wg sync.WaitGroup + + // this gets deferred first so that DestroyBuild runs AFTER the + // new contexts (buildCtx and timeoutCtx) have been canceled + defer func() { + // if exec() exits before starting StreamBuild, this returns immediately. + wg.Wait() + + logger.Info("destroying build") + + // destroy the build with the executor (pass a background + // context to guarantee all build resources are destroyed). + err = _executor.DestroyBuild(context.Background()) + if err != nil { + logger.Errorf("unable to destroy build: %v", err) + } + + logger.Info("completed build") + }() + // capture the configured build timeout t := w.Config.Build.Timeout // check if the repository has a custom timeout @@ -109,19 +131,6 @@ func (w *Worker) exec(index int) error { timeoutCtx, timeout := context.WithTimeout(buildCtx, t) defer timeout() - defer func() { - logger.Info("destroying build") - - // destroy the build with the executor (pass a background - // context to guarantee all build resources are destroyed). - err = _executor.DestroyBuild(context.Background()) - if err != nil { - logger.Errorf("unable to destroy build: %v", err) - } - - logger.Info("completed build") - }() - logger.Info("creating build") // create the build with the executor err = _executor.CreateBuild(timeoutCtx) @@ -138,8 +147,12 @@ func (w *Worker) exec(index int) error { return nil } + // add StreamBuild goroutine to WaitGroup + wg.Add(1) + // log/event streaming uses buildCtx so that it is not subject to the timeout. go func() { + defer wg.Done() logger.Info("streaming build logs") // execute the build with the executor err = _executor.StreamBuild(buildCtx) diff --git a/executor/linux/build.go b/executor/linux/build.go index e4193e05..6f77539b 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -471,10 +471,17 @@ func (c *client) AssembleBuild(ctx context.Context) error { // ExecBuild runs a pipeline for a build. func (c *client) ExecBuild(ctx context.Context) error { - // defer an upload of the build - // - // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Upload - defer func() { build.Upload(c.build, c.Vela, c.err, c.Logger, c.repo) }() + defer func() { + // Exec* calls are responsible for sending StreamRequest messages. + // close the channel at the end of ExecBuild to signal that + // nothing else will send more StreamRequest messages. + close(c.streamRequests) + + // defer an upload of the build + // + // https://pkg.go.dev/github.com/go-vela/worker/internal/build#Upload + build.Upload(c.build, c.Vela, c.err, c.Logger, c.repo) + }() // execute the services for the pipeline for _, _service := range c.pipeline.Services { @@ -599,6 +606,10 @@ func (c *client) StreamBuild(ctx context.Context) error { } cancelStreaming() + // wait for context to be done before reporting that everything has returned. + <-delayedCtx.Done() + // there might be one more log message from WithDelayedCancelPropagation + // but there's not a good way to wait for that goroutine to finish. c.Logger.Info("all stream functions have returned") }() @@ -612,7 +623,13 @@ func (c *client) StreamBuild(ctx context.Context) error { for { select { - case req := <-c.streamRequests: + case req, ok := <-c.streamRequests: + if !ok { + // ExecBuild is done requesting streams + c.Logger.Debug("not accepting any more stream requests as channel is closed") + return nil + } + streams.Go(func() error { // update engine logger with step metadata // @@ -629,7 +646,7 @@ func (c *client) StreamBuild(ctx context.Context) error { return nil }) case <-delayedCtx.Done(): - c.Logger.Debug("streaming context canceled") + c.Logger.Debug("not accepting any more stream requests as streaming context is canceled") // build done or canceled return nil } diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index ade7766d..e733f8ec 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1146,9 +1146,6 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } - streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) - defer done() - tests := []struct { name string failure bool @@ -1200,6 +1197,9 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) + defer done() + _engine, err := New( WithBuild(_build), WithPipeline(_pipeline), @@ -1301,13 +1301,16 @@ func TestLinux_StreamBuild(t *testing.T) { } tests := []struct { - name string - failure bool - pipeline string - messageKey string - ctn *pipeline.Container - streamFunc func(*client) message.StreamFunc - planFunc func(*client) planFuncType + name string + failure bool + earlyExecExit bool + earlyBuildDone bool + pipeline string + msgCount int + messageKey string + ctn *pipeline.Container + streamFunc func(*client) message.StreamFunc + planFunc func(*client) planFuncType }{ { name: "docker-basic services pipeline", @@ -1442,6 +1445,72 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "docker-early exit from ExecBuild", + failure: false, + earlyExecExit: true, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "docker-build complete before ExecBuild called", + failure: false, + earlyBuildDone: true, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, + { + name: "docker-early exit from ExecBuild and build complete signaled", + failure: false, + earlyExecExit: true, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step_github_octocat_1_test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { @@ -1483,21 +1552,38 @@ func TestLinux_StreamBuild(t *testing.T) { // simulate ExecBuild() which runs concurrently with StreamBuild() go func() { - // ExecBuild calls PlanService()/PlanStep() before ExecService()/ExecStep() - // (ExecStage() calls PlanStep() before ExecStep()). - _engine.err = test.planFunc(_engine)(buildCtx, test.ctn) - - // ExecService()/ExecStep()/secret.exec() send this message - streamRequests <- message.StreamRequest{ - Key: test.messageKey, - Stream: test.streamFunc(_engine), - Container: test.ctn, + if test.earlyBuildDone { + // imitate build getting canceled or otherwise finishing before ExecBuild gets called. + done() + } + if test.earlyExecExit { + // imitate a failure after ExecBuild starts and before it sends a StreamRequest. + close(streamRequests) + } + if test.earlyBuildDone || test.earlyExecExit { + return } - // simulate exec build duration - time.Sleep(100 * time.Microsecond) + // simulate two messages of the same type + for i := 0; i < 2; i++ { + // ExecBuild calls PlanService()/PlanStep() before ExecService()/ExecStep() + // (ExecStage() calls PlanStep() before ExecStep()). + _engine.err = test.planFunc(_engine)(buildCtx, test.ctn) + + // ExecService()/ExecStep()/secret.exec() send this message + streamRequests <- message.StreamRequest{ + Key: test.messageKey, + Stream: test.streamFunc(_engine), + // in a real pipeline, the second message would be for a different container + Container: test.ctn, + } + + // simulate exec build duration + time.Sleep(100 * time.Microsecond) + } - // signal the end of the build so StreamBuild can terminate + // signal the end of ExecBuild so StreamBuild can finish up + close(streamRequests) done() }() diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 4a78d2fb..c3df35c8 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -107,6 +107,7 @@ func New(opts ...Opt) (*client, error) { c.Logger = logrus.NewEntry(logger) // instantiate streamRequests channel (which may be overridden using withStreamRequests()). + // messages get sent during ExecBuild, then ExecBuild closes this on exit. c.streamRequests = make(chan message.StreamRequest) // apply all provided configuration options From 9ed2e323abb1a91e08be76970b812d425ab91f91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Dec 2022 10:43:18 -0600 Subject: [PATCH 362/430] fix(deps): update deps (patch) (#413) --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 2165da97..87b4cc99 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,18 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.0 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.21+incompatible + github.com/docker/docker v20.10.22+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.17.0-rc1 - github.com/go-vela/server v0.17.0-rc1 - github.com/go-vela/types v0.17.0-rc1 + github.com/go-vela/sdk-go v0.17.0-rc2 + github.com/go-vela/server v0.17.0-rc2 + github.com/go-vela/types v0.17.0-rc2 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.23.6 + github.com/urfave/cli/v2 v2.23.7 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.26.0 diff --git a/go.sum b/go.sum index 6e34b7d9..0538b8ab 100644 --- a/go.sum +++ b/go.sum @@ -92,8 +92,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= -github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.22+incompatible h1:6jX4yB+NtcbldT90k7vBSaWJDB3i+zkVJT9BEK8kQkk= +github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -152,12 +152,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.17.0-rc1 h1:V33/5nRoKE3NYAlVaZzahv13JWTHtrgyvrwiDf4lWuI= -github.com/go-vela/sdk-go v0.17.0-rc1/go.mod h1:7fEajiLq+LSpvTZMEzNfQXZbCQjGYqIJxsoqZ/Y07qs= -github.com/go-vela/server v0.17.0-rc1 h1:tF0mI5hjS/9hihDmOgq2rQt+kx7vT2oM9BssvC+t8oI= -github.com/go-vela/server v0.17.0-rc1/go.mod h1:OBAqZdb+ifgllVgRCB53jyXHV/KiBlpguWzUcQgRJ9Q= -github.com/go-vela/types v0.17.0-rc1 h1:OnQByNmqWssqpfe9RNai7d9V1KfMJGfamymnsqFAaC0= -github.com/go-vela/types v0.17.0-rc1/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.17.0-rc2 h1:VZ4JCMte25ZSgGS/DvoZBi8dR+Od4C6TP4f5CWzPYbA= +github.com/go-vela/sdk-go v0.17.0-rc2/go.mod h1:HrxkXTTG/vawLTKkMgVhLaaTfyYbd2K1gz1jee56ljs= +github.com/go-vela/server v0.17.0-rc2 h1:uUk9v83U+BIcLvSCx4LTpvv1H5WUbtE5zWa+efJysWY= +github.com/go-vela/server v0.17.0-rc2/go.mod h1:TzF+jckLGeuYAD1CPEkWvQImmwcCtjMYoIUpydDZs6o= +github.com/go-vela/types v0.17.0-rc2 h1:Rrh7GzgT2QzTOLedD8T5mT0lvh/FxFhO3Zh5/b9STGQ= +github.com/go-vela/types v0.17.0-rc2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -399,8 +399,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.23.6 h1:iWmtKD+prGo1nKUtLO0Wg4z9esfBM4rAV4QRLQiEmJ4= -github.com/urfave/cli/v2 v2.23.6/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= +github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From acafa94427671ebc0ee33150a37dfc88c6fb4fbe Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Fri, 16 Dec 2022 15:44:38 -0600 Subject: [PATCH 363/430] chore(release): update dependencies for v0.17.0 (#415) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 87b4cc99..f19ed253 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.22+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.17.0-rc2 - github.com/go-vela/server v0.17.0-rc2 - github.com/go-vela/types v0.17.0-rc2 + github.com/go-vela/sdk-go v0.17.0 + github.com/go-vela/server v0.17.0 + github.com/go-vela/types v0.17.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 0538b8ab..cf8834b1 100644 --- a/go.sum +++ b/go.sum @@ -152,12 +152,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.17.0-rc2 h1:VZ4JCMte25ZSgGS/DvoZBi8dR+Od4C6TP4f5CWzPYbA= -github.com/go-vela/sdk-go v0.17.0-rc2/go.mod h1:HrxkXTTG/vawLTKkMgVhLaaTfyYbd2K1gz1jee56ljs= -github.com/go-vela/server v0.17.0-rc2 h1:uUk9v83U+BIcLvSCx4LTpvv1H5WUbtE5zWa+efJysWY= -github.com/go-vela/server v0.17.0-rc2/go.mod h1:TzF+jckLGeuYAD1CPEkWvQImmwcCtjMYoIUpydDZs6o= -github.com/go-vela/types v0.17.0-rc2 h1:Rrh7GzgT2QzTOLedD8T5mT0lvh/FxFhO3Zh5/b9STGQ= -github.com/go-vela/types v0.17.0-rc2/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.17.0 h1:vVck8Xm5/co6zrDntG1mdjenT5N0vgDJ30ImFZTUEjY= +github.com/go-vela/sdk-go v0.17.0/go.mod h1:R7oHeYj1ThBREPzqsvevUEBxp8knmOviFbspvuGqZsU= +github.com/go-vela/server v0.17.0 h1:sEJ4a9mus43Qw4E431OYwN8qvYugoA0ZmaU0sFGgESk= +github.com/go-vela/server v0.17.0/go.mod h1:Z8YT/IFJTQ80a63GINRHCaFBTkkkHAL7mDohw4xLbEE= +github.com/go-vela/types v0.17.0 h1:nvKBbNO8BSiLtYPMScT0XWosGqEWX85UKSkkclb2DVA= +github.com/go-vela/types v0.17.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From 2f95ddd8c4661150f218bb5c6961bbee7916e319 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 23 Jan 2023 08:44:11 -0600 Subject: [PATCH 364/430] refactor(executor tests): Make runtime a test arg (#418) --- executor/linux/build_test.go | 374 +++++++++++++++++++++++---------- executor/linux/opts_test.go | 8 +- executor/linux/secret_test.go | 56 +++-- executor/linux/service_test.go | 50 +++-- executor/linux/stage_test.go | 65 +++--- executor/linux/step_test.go | 56 +++-- 6 files changed, 423 insertions(+), 186 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index e733f8ec..28f168a6 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -16,10 +16,12 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" @@ -44,44 +46,45 @@ func TestLinux_CreateBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - tests := []struct { name string failure bool + runtime string build *library.Build pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-steps pipeline with empty build", failure: true, + runtime: constants.DriverDocker, build: new(library.Build), pipeline: "testdata/build/steps/basic.yml", }, @@ -101,6 +104,16 @@ func TestLinux_CreateBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(test.build), WithPipeline(_pipeline), @@ -163,14 +176,10 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create runtime engine: %v", err) - } - tests := []struct { name string failure bool + runtime string build *library.Build repo *library.Repo pipeline string @@ -178,8 +187,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos bool }{ { - name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -187,8 +197,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with untrusted repo", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -196,8 +207,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -205,8 +217,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -214,8 +227,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -223,8 +237,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -232,8 +247,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -241,8 +257,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/basic.yml", @@ -250,8 +267,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -259,8 +277,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with untrusted repo and dynamic image:tag", failure: true, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -268,8 +287,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -277,8 +297,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -286,8 +307,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -295,8 +317,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -304,8 +327,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -313,8 +337,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/steps/img_environmentdynamic.yml", @@ -322,8 +347,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged services pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: privileged services pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -331,8 +357,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: privileged services pipeline with untrusted repo", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -340,8 +367,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -349,8 +377,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -358,8 +387,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged services pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: privileged services pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -367,8 +397,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: privileged services pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -376,8 +407,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -385,8 +417,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/basic.yml", @@ -394,8 +427,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged services pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged services pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -403,8 +437,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged services pipeline with untrusted repo and dynamic image:tag", failure: true, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -412,8 +447,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -421,8 +457,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -430,8 +467,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged services pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged services pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -439,8 +477,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged services pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -448,8 +487,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -457,8 +497,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/services/img_environmentdynamic.yml", @@ -466,8 +507,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -475,8 +517,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with untrusted repo", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -484,8 +527,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -493,8 +537,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -502,8 +547,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -511,8 +557,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -520,8 +567,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with trusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -529,8 +577,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/basic.yml", @@ -538,8 +587,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -547,8 +597,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with untrusted repo and dynamic image:tag", failure: true, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -556,8 +607,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -565,8 +617,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -574,8 +627,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -583,8 +637,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -592,8 +647,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _trustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -601,8 +657,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and dynamic image:tag", failure: false, + runtime: constants.DriverDocker, build: _buildWithMessageAlpine, repo: _untrustedRepo, pipeline: "testdata/build/stages/img_environmentdynamic.yml", @@ -610,8 +667,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged steps pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -619,8 +677,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged steps pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos enabled: privileged steps pipeline with untrusted repo and init step name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -628,8 +687,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -637,8 +697,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos enabled: non-privileged steps pipeline with untrusted repo and init step name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -646,8 +707,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -655,8 +717,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged steps pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos disabled: privileged steps pipeline with untrusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -664,8 +727,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -673,8 +737,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos disabled: non-privileged steps pipeline with untrusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/steps/name_init.yml", @@ -682,8 +747,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -691,8 +757,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged stages pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos enabled: privileged stages pipeline with untrusted repo and init step name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -700,8 +767,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -709,8 +777,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos enabled: non-privileged stages pipeline with untrusted repo and init step name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -718,8 +787,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -727,8 +797,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged stages pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos disabled: privileged stages pipeline with untrusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -736,8 +807,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and init step name", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with trusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -745,8 +817,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and init step name", + name: "docker-enforce trusted repos disabled: non-privileged stages pipeline with untrusted repo and init step name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/stages/name_init.yml", @@ -754,8 +827,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos enabled: privileged services pipeline with trusted repo and init service name", + name: "docker-enforce trusted repos enabled: privileged services pipeline with trusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -763,8 +837,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: privileged services pipeline with untrusted repo and init service name", + name: "docker-enforce trusted repos enabled: privileged services pipeline with untrusted repo and init service name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -772,8 +847,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with trusted repo and init service name", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with trusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -781,8 +857,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and init service name", + name: "docker-enforce trusted repos enabled: non-privileged services pipeline with untrusted repo and init service name", failure: true, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -790,8 +867,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: true, }, { - name: "enforce trusted repos disabled: privileged services pipeline with trusted repo and init service name", + name: "docker-enforce trusted repos disabled: privileged services pipeline with trusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -799,8 +877,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: privileged services pipeline with untrusted repo and init service name", + name: "docker-enforce trusted repos disabled: privileged services pipeline with untrusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -808,8 +887,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with trusted repo and init service name", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with trusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _trustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -817,8 +897,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { enforceTrustedRepos: false, }, { - name: "enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and init service name", + name: "docker-enforce trusted repos disabled: non-privileged services pipeline with untrusted repo and init service name", failure: false, + runtime: constants.DriverDocker, build: _build, repo: _untrustedRepo, pipeline: "testdata/build/services/name_init.yml", @@ -841,6 +922,16 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(test.build), WithPipeline(_pipeline), @@ -899,34 +990,34 @@ func TestLinux_PlanBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - tests := []struct { name string failure bool + runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, } @@ -945,6 +1036,16 @@ func TestLinux_PlanBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(_build), WithPipeline(_pipeline), @@ -998,77 +1099,85 @@ func TestLinux_AssembleBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() tests := []struct { name string failure bool + runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-secrets pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_notfound.yml", }, { name: "docker-secrets pipeline with ignoring image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_ignorenotfound.yml", }, { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, { name: "docker-services pipeline with ignoring image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, { name: "docker-steps pipeline with ignoring image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, { name: "docker-stages pipeline with ignoring image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, } @@ -1087,6 +1196,16 @@ func TestLinux_AssembleBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(_build), WithPipeline(_pipeline), @@ -1141,44 +1260,46 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - tests := []struct { name string failure bool + runtime string pipeline string }{ { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with image not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, } @@ -1197,6 +1318,16 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() @@ -1288,11 +1419,6 @@ func TestLinux_StreamBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - type planFuncType = func(context.Context, *pipeline.Container) error // planNothing is a planFuncType that does nothing @@ -1303,6 +1429,7 @@ func TestLinux_StreamBuild(t *testing.T) { tests := []struct { name string failure bool + runtime string earlyExecExit bool earlyBuildDone bool pipeline string @@ -1315,6 +1442,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", messageKey: "service", streamFunc: func(c *client) message.StreamFunc { @@ -1338,6 +1466,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic services pipeline with StreamService failure", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", messageKey: "service", streamFunc: func(c *client) message.StreamFunc { @@ -1362,6 +1491,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1383,6 +1513,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic steps pipeline with StreamStep failure", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1405,6 +1536,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1426,6 +1558,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", messageKey: "secret", streamFunc: func(c *client) message.StreamFunc { @@ -1449,6 +1582,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-early exit from ExecBuild", failure: false, earlyExecExit: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1471,6 +1605,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-build complete before ExecBuild called", failure: false, earlyBuildDone: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1493,6 +1628,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-early exit from ExecBuild and build complete signaled", failure: false, earlyExecExit: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", streamFunc: func(c *client) message.StreamFunc { @@ -1530,6 +1666,16 @@ func TestLinux_StreamBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(_build), WithPipeline(_pipeline), @@ -1622,54 +1768,58 @@ func TestLinux_DestroyBuild(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - tests := []struct { name string failure bool + runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-secrets pipeline with name not found", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/name_notfound.yml", }, { name: "docker-basic services pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with name not found", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/services/name_notfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with name not found", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/steps/name_notfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with name not found", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/stages/name_notfound.yml", }, } @@ -1688,6 +1838,16 @@ func TestLinux_DestroyBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(_build), WithPipeline(_pipeline), diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index f4fe9efa..1e4823ab 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -480,7 +480,7 @@ func TestLinux_Opt_WithRepo(t *testing.T) { func TestLinux_Opt_WithRuntime(t *testing.T) { // setup types - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -494,7 +494,7 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { { name: "docker runtime", failure: false, - runtime: _runtime, + runtime: _docker, }, { name: "nil runtime", @@ -522,8 +522,8 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { t.Errorf("WithRuntime returned err: %v", err) } - if !reflect.DeepEqual(_engine.Runtime, _runtime) { - t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, _runtime) + if !reflect.DeepEqual(_engine.Runtime, test.runtime) { + t.Errorf("WithRuntime is %v, want %v", _engine.Runtime, test.runtime) } }) } diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index a9cb94ca..fd7f5811 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -18,6 +18,7 @@ import ( "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/sdk-go/vela" @@ -45,7 +46,7 @@ func TestLinux_Secret_create(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -54,11 +55,13 @@ func TestLinux_Secret_create(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-good image tag", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -72,6 +75,7 @@ func TestLinux_Secret_create(t *testing.T) { { name: "docker-notfound image tag", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -91,7 +95,7 @@ func TestLinux_Secret_create(t *testing.T) { WithBuild(_build), WithPipeline(_steps), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -132,7 +136,7 @@ func TestLinux_Secret_delete(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -146,12 +150,14 @@ func TestLinux_Secret_delete(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container step *library.Step }{ { name: "docker-running container-empty step", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -166,6 +172,7 @@ func TestLinux_Secret_delete(t *testing.T) { { name: "docker-running container-pending step", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_vault", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -180,6 +187,7 @@ func TestLinux_Secret_delete(t *testing.T) { { name: "docker-inspecting container failure due to invalid container id", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_notfound", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -194,6 +202,7 @@ func TestLinux_Secret_delete(t *testing.T) { { name: "docker-removing container failure", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "secret_github_octocat_1_ignorenotfound", Directory: "/vela/src/vcs.company.com/github/octocat", @@ -214,7 +223,7 @@ func TestLinux_Secret_delete(t *testing.T) { WithBuild(_build), WithPipeline(_steps), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -261,11 +270,6 @@ func TestLinux_Secret_exec(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - if err != nil { - t.Errorf("unable to create docker runtime engine: %v", err) - } - streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() @@ -273,16 +277,19 @@ func TestLinux_Secret_exec(t *testing.T) { tests := []struct { name string failure bool + runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-pipeline with secret name not found", failure: true, + runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/name_notfound.yml", }, } @@ -303,6 +310,16 @@ func TestLinux_Secret_exec(t *testing.T) { t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } + var _runtime runtime.Engine + + switch test.runtime { + case constants.DriverDocker: + _runtime, err = docker.NewMock() + if err != nil { + t.Errorf("unable to create docker runtime engine: %v", err) + } + } + _engine, err := New( WithBuild(_build), WithPipeline(p), @@ -353,7 +370,7 @@ func TestLinux_Secret_pull(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -362,11 +379,13 @@ func TestLinux_Secret_pull(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine secret *pipeline.Secret }{ { name: "docker-success with org secret", failure: false, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -379,6 +398,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with invalid org secret", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -391,6 +411,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with org secret key not found", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -403,6 +424,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-success with repo secret", failure: false, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -415,6 +437,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with invalid repo secret", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -427,6 +450,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with repo secret key not found", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -439,6 +463,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-success with shared secret", failure: false, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -451,6 +476,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with shared secret key not found", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -463,6 +489,7 @@ func TestLinux_Secret_pull(t *testing.T) { { name: "docker-failure with invalid type", failure: true, + runtime: _docker, secret: &pipeline.Secret{ Name: "foo", Value: "bar", @@ -481,7 +508,7 @@ func TestLinux_Secret_pull(t *testing.T) { WithBuild(_build), WithPipeline(testSteps()), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -522,7 +549,7 @@ func TestLinux_Secret_stream(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -531,12 +558,14 @@ func TestLinux_Secret_stream(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine logs *library.Log container *pipeline.Container }{ { name: "docker-container step succeeds", failure: false, + runtime: _docker, logs: new(library.Log), container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -551,6 +580,7 @@ func TestLinux_Secret_stream(t *testing.T) { { name: "docker-container step fails because of invalid container id", failure: true, + runtime: _docker, logs: new(library.Log), container: &pipeline.Container{ ID: "secret_github_octocat_1_notfound", @@ -571,7 +601,7 @@ func TestLinux_Secret_stream(t *testing.T) { WithBuild(_build), WithPipeline(_steps), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 6b2fbd6b..144a38bf 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -10,16 +10,13 @@ import ( "testing" "github.com/gin-gonic/gin" - - "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/sdk-go/vela" - + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" ) func TestLinux_CreateService(t *testing.T) { @@ -37,7 +34,7 @@ func TestLinux_CreateService(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -46,11 +43,13 @@ func TestLinux_CreateService(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-basic service container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -66,6 +65,7 @@ func TestLinux_CreateService(t *testing.T) { { name: "docker-service container with image not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -81,6 +81,7 @@ func TestLinux_CreateService(t *testing.T) { { name: "docker-empty service container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -92,7 +93,7 @@ func TestLinux_CreateService(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -132,7 +133,7 @@ func TestLinux_PlanService(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -142,10 +143,12 @@ func TestLinux_PlanService(t *testing.T) { name string failure bool container *pipeline.Container + runtime runtime.Engine }{ { name: "docker-basic service container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -161,6 +164,7 @@ func TestLinux_PlanService(t *testing.T) { { name: "docker-service container with nil environment", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -176,6 +180,7 @@ func TestLinux_PlanService(t *testing.T) { { name: "docker-empty service container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -187,7 +192,7 @@ func TestLinux_PlanService(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -227,7 +232,7 @@ func TestLinux_ExecService(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -239,11 +244,13 @@ func TestLinux_ExecService(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-basic service container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -259,6 +266,7 @@ func TestLinux_ExecService(t *testing.T) { { name: "docker-service container with image not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -274,6 +282,7 @@ func TestLinux_ExecService(t *testing.T) { { name: "docker-empty service container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -285,7 +294,7 @@ func TestLinux_ExecService(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), withStreamRequests(streamRequests), @@ -331,7 +340,7 @@ func TestLinux_StreamService(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -340,11 +349,13 @@ func TestLinux_StreamService(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-basic service container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -360,6 +371,7 @@ func TestLinux_StreamService(t *testing.T) { { name: "docker-service container with name not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_notfound", Detach: true, @@ -375,6 +387,7 @@ func TestLinux_StreamService(t *testing.T) { { name: "docker-empty service container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -386,7 +399,7 @@ func TestLinux_StreamService(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -431,7 +444,7 @@ func TestLinux_DestroyService(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -440,11 +453,13 @@ func TestLinux_DestroyService(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-basic service container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_postgres", Detach: true, @@ -460,6 +475,7 @@ func TestLinux_DestroyService(t *testing.T) { { name: "docker-service container with ignoring name not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "service_github_octocat_1_ignorenotfound", Detach: true, @@ -481,7 +497,7 @@ func TestLinux_DestroyService(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 1a995b79..b2a7147b 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -13,17 +13,14 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/urfave/cli/v2" - + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" - + "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/pipeline" + "github.com/urfave/cli/v2" ) func TestLinux_CreateStage(t *testing.T) { @@ -56,7 +53,7 @@ func TestLinux_CreateStage(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -65,11 +62,13 @@ func TestLinux_CreateStage(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine stage *pipeline.Stage }{ { name: "docker-basic stage", failure: false, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Steps: pipeline.ContainerSlice{ @@ -88,6 +87,7 @@ func TestLinux_CreateStage(t *testing.T) { { name: "docker-stage with step container with image not found", failure: true, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Steps: pipeline.ContainerSlice{ @@ -106,6 +106,7 @@ func TestLinux_CreateStage(t *testing.T) { { name: "docker-empty stage", failure: true, + runtime: _docker, stage: new(pipeline.Stage), }, } @@ -117,7 +118,7 @@ func TestLinux_CreateStage(t *testing.T) { WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -165,35 +166,37 @@ func TestLinux_PlanStage(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } - testMap := new(sync.Map) - testMap.Store("foo", make(chan error, 1)) + dockerTestMap := new(sync.Map) + dockerTestMap.Store("foo", make(chan error, 1)) - tm, _ := testMap.Load("foo") - tm.(chan error) <- nil - close(tm.(chan error)) + dtm, _ := dockerTestMap.Load("foo") + dtm.(chan error) <- nil + close(dtm.(chan error)) - errMap := new(sync.Map) - errMap.Store("foo", make(chan error, 1)) + dockerErrMap := new(sync.Map) + dockerErrMap.Store("foo", make(chan error, 1)) - em, _ := errMap.Load("foo") - em.(chan error) <- errors.New("bar") - close(em.(chan error)) + dem, _ := dockerErrMap.Load("foo") + dem.(chan error) <- errors.New("bar") + close(dem.(chan error)) // setup tests tests := []struct { name string failure bool + runtime runtime.Engine stage *pipeline.Stage stageMap *sync.Map }{ { name: "docker-basic stage", failure: false, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Steps: pipeline.ContainerSlice{ @@ -213,6 +216,7 @@ func TestLinux_PlanStage(t *testing.T) { { name: "docker-basic stage with nil stage map", failure: false, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Needs: []string{"foo"}, @@ -228,11 +232,12 @@ func TestLinux_PlanStage(t *testing.T) { }, }, }, - stageMap: testMap, + stageMap: dockerTestMap, }, { name: "docker-basic stage with error stage map", failure: true, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Needs: []string{"foo"}, @@ -248,7 +253,7 @@ func TestLinux_PlanStage(t *testing.T) { }, }, }, - stageMap: errMap, + stageMap: dockerErrMap, }, } @@ -259,7 +264,7 @@ func TestLinux_PlanStage(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -299,7 +304,7 @@ func TestLinux_ExecStage(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -311,11 +316,13 @@ func TestLinux_ExecStage(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine stage *pipeline.Stage }{ { name: "docker-basic stage", failure: false, + runtime: _docker, stage: &pipeline.Stage{ Independent: true, Name: "echo", @@ -335,6 +342,7 @@ func TestLinux_ExecStage(t *testing.T) { { name: "docker-stage with step container with image not found", failure: true, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Independent: true, @@ -354,6 +362,7 @@ func TestLinux_ExecStage(t *testing.T) { { name: "docker-stage with step container with bad number", failure: true, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Independent: true, @@ -382,7 +391,7 @@ func TestLinux_ExecStage(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), withStreamRequests(streamRequests), @@ -423,7 +432,7 @@ func TestLinux_DestroyStage(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -432,11 +441,13 @@ func TestLinux_DestroyStage(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine stage *pipeline.Stage }{ { name: "docker-basic stage", failure: false, + runtime: _docker, stage: &pipeline.Stage{ Name: "echo", Steps: pipeline.ContainerSlice{ @@ -461,7 +472,7 @@ func TestLinux_DestroyStage(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index b0f4a400..60ad4b6b 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -12,16 +12,13 @@ import ( "testing" "github.com/gin-gonic/gin" - - "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/sdk-go/vela" - + "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" ) func TestLinux_CreateStep(t *testing.T) { @@ -39,7 +36,7 @@ func TestLinux_CreateStep(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -48,11 +45,13 @@ func TestLinux_CreateStep(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-init step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_init", Directory: "/vela/src/github.com/github/octocat", @@ -66,6 +65,7 @@ func TestLinux_CreateStep(t *testing.T) { { name: "docker-basic step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -79,6 +79,7 @@ func TestLinux_CreateStep(t *testing.T) { { name: "docker-step container with image not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -92,6 +93,7 @@ func TestLinux_CreateStep(t *testing.T) { { name: "docker-empty step container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -103,7 +105,7 @@ func TestLinux_CreateStep(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -143,7 +145,7 @@ func TestLinux_PlanStep(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -152,11 +154,13 @@ func TestLinux_PlanStep(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-basic step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -170,6 +174,7 @@ func TestLinux_PlanStep(t *testing.T) { { name: "docker-step container with nil environment", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -183,6 +188,7 @@ func TestLinux_PlanStep(t *testing.T) { { name: "docker-empty step container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -194,7 +200,7 @@ func TestLinux_PlanStep(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -234,7 +240,7 @@ func TestLinux_ExecStep(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -246,11 +252,13 @@ func TestLinux_ExecStep(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-init step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_init", Directory: "/vela/src/github.com/github/octocat", @@ -264,6 +272,7 @@ func TestLinux_ExecStep(t *testing.T) { { name: "docker-basic step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -277,6 +286,7 @@ func TestLinux_ExecStep(t *testing.T) { { name: "docker-detached step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Detach: true, @@ -291,6 +301,7 @@ func TestLinux_ExecStep(t *testing.T) { { name: "docker-step container with image not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -304,6 +315,7 @@ func TestLinux_ExecStep(t *testing.T) { { name: "docker-empty step container", failure: true, + runtime: _docker, container: new(pipeline.Container), }, } @@ -315,7 +327,7 @@ func TestLinux_ExecStep(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), withStreamRequests(streamRequests), @@ -365,8 +377,7 @@ func TestLinux_StreamStep(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() - + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -375,12 +386,14 @@ func TestLinux_StreamStep(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine logs *library.Log container *pipeline.Container }{ { name: "docker-init step container", failure: false, + runtime: _docker, logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_init", @@ -395,6 +408,7 @@ func TestLinux_StreamStep(t *testing.T) { { name: "docker-basic step container", failure: false, + runtime: _docker, logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", @@ -409,6 +423,7 @@ func TestLinux_StreamStep(t *testing.T) { { name: "docker-step container with name not found", failure: true, + runtime: _docker, logs: _logs, container: &pipeline.Container{ ID: "step_github_octocat_1_notfound", @@ -423,6 +438,7 @@ func TestLinux_StreamStep(t *testing.T) { { name: "docker-empty step container", failure: true, + runtime: _docker, logs: _logs, container: new(pipeline.Container), }, @@ -436,7 +452,7 @@ func TestLinux_StreamStep(t *testing.T) { WithPipeline(new(pipeline.Build)), WithMaxLogSize(10), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) @@ -481,7 +497,7 @@ func TestLinux_DestroyStep(t *testing.T) { t.Errorf("unable to create Vela API client: %v", err) } - _runtime, err := docker.NewMock() + _docker, err := docker.NewMock() if err != nil { t.Errorf("unable to create docker runtime engine: %v", err) } @@ -490,11 +506,13 @@ func TestLinux_DestroyStep(t *testing.T) { tests := []struct { name string failure bool + runtime runtime.Engine container *pipeline.Container }{ { name: "docker-init step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_init", Directory: "/vela/src/github.com/github/octocat", @@ -508,6 +526,7 @@ func TestLinux_DestroyStep(t *testing.T) { { name: "docker-basic step container", failure: false, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_echo", Directory: "/vela/src/github.com/github/octocat", @@ -521,6 +540,7 @@ func TestLinux_DestroyStep(t *testing.T) { { name: "docker-step container with ignoring name not found", failure: true, + runtime: _docker, container: &pipeline.Container{ ID: "step_github_octocat_1_ignorenotfound", Directory: "/vela/src/github.com/github/octocat", @@ -540,7 +560,7 @@ func TestLinux_DestroyStep(t *testing.T) { WithBuild(_build), WithPipeline(new(pipeline.Build)), WithRepo(_repo), - WithRuntime(_runtime), + WithRuntime(test.runtime), WithUser(_user), WithVelaClient(_client), ) From 2c52c5dfaf02a50b6c362852d16e23473047035f Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 2 Feb 2023 10:06:21 -0600 Subject: [PATCH 365/430] enhance(executor tests): test StreamBuild logging during build tests (#419) --- executor/linux/build_test.go | 217 +++++++++++++++++++++++++++++++++-- 1 file changed, 206 insertions(+), 11 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 28f168a6..8a8870b2 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -8,24 +8,23 @@ import ( "context" "flag" "net/http/httptest" + "strings" "testing" "time" + "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" - - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime" - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - - "github.com/gin-gonic/gin" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" + "github.com/sirupsen/logrus" + logrusTest "github.com/sirupsen/logrus/hooks/test" + "github.com/urfave/cli/v2" ) func TestLinux_CreateBuild(t *testing.T) { @@ -37,6 +36,9 @@ func TestLinux_CreateBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -49,6 +51,7 @@ func TestLinux_CreateBuild(t *testing.T) { tests := []struct { name string failure bool + logError bool runtime string build *library.Build pipeline string @@ -56,6 +59,7 @@ func TestLinux_CreateBuild(t *testing.T) { { name: "docker-basic secrets pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/secrets/basic.yml", @@ -63,6 +67,7 @@ func TestLinux_CreateBuild(t *testing.T) { { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/services/basic.yml", @@ -70,6 +75,7 @@ func TestLinux_CreateBuild(t *testing.T) { { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/steps/basic.yml", @@ -77,6 +83,7 @@ func TestLinux_CreateBuild(t *testing.T) { { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, build: _build, pipeline: "testdata/build/stages/basic.yml", @@ -84,6 +91,7 @@ func TestLinux_CreateBuild(t *testing.T) { { name: "docker-steps pipeline with empty build", failure: true, + logError: false, runtime: constants.DriverDocker, build: new(library.Build), pipeline: "testdata/build/steps/basic.yml", @@ -93,6 +101,9 @@ func TestLinux_CreateBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -115,6 +126,7 @@ func TestLinux_CreateBuild(t *testing.T) { } _engine, err := New( + WithLogger(logger), WithBuild(test.build), WithPipeline(_pipeline), WithRepo(_repo), @@ -139,6 +151,21 @@ func TestLinux_CreateBuild(t *testing.T) { if err != nil { t.Errorf("%s CreateBuild returned err: %v", test.name, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } @@ -981,6 +1008,9 @@ func TestLinux_PlanBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -993,30 +1023,35 @@ func TestLinux_PlanBuild(t *testing.T) { tests := []struct { name string failure bool + logError bool runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, @@ -1025,6 +1060,9 @@ func TestLinux_PlanBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -1047,6 +1085,7 @@ func TestLinux_PlanBuild(t *testing.T) { } _engine, err := New( + WithLogger(logger), WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), @@ -1077,6 +1116,21 @@ func TestLinux_PlanBuild(t *testing.T) { if err != nil { t.Errorf("%s PlanBuild returned err: %v", test.name, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } @@ -1090,6 +1144,9 @@ func TestLinux_AssembleBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -1105,78 +1162,91 @@ func TestLinux_AssembleBuild(t *testing.T) { tests := []struct { name string failure bool + logError bool runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-secrets pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_notfound.yml", }, { name: "docker-secrets pipeline with ignoring image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_ignorenotfound.yml", }, { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, { name: "docker-services pipeline with ignoring image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, { name: "docker-steps pipeline with ignoring image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, { name: "docker-stages pipeline with ignoring image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, @@ -1185,6 +1255,9 @@ func TestLinux_AssembleBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -1207,6 +1280,7 @@ func TestLinux_AssembleBuild(t *testing.T) { } _engine, err := New( + WithLogger(logger), WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), @@ -1238,6 +1312,21 @@ func TestLinux_AssembleBuild(t *testing.T) { if err != nil { t.Errorf("%s AssembleBuild returned err: %v", test.name, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } @@ -1251,6 +1340,9 @@ func TestLinux_ExecBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -1263,42 +1355,49 @@ func TestLinux_ExecBuild(t *testing.T) { tests := []struct { name string failure bool + logError bool runtime string pipeline string }{ { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with image not found", failure: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, @@ -1307,6 +1406,9 @@ func TestLinux_ExecBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -1332,6 +1434,7 @@ func TestLinux_ExecBuild(t *testing.T) { defer done() _engine, err := New( + WithLogger(logger), WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), @@ -1397,6 +1500,21 @@ func TestLinux_ExecBuild(t *testing.T) { if err != nil { t.Errorf("%s ExecBuild for %s returned err: %v", test.name, test.pipeline, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } @@ -1410,6 +1528,9 @@ func TestLinux_StreamBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -1429,9 +1550,10 @@ func TestLinux_StreamBuild(t *testing.T) { tests := []struct { name string failure bool - runtime string earlyExecExit bool earlyBuildDone bool + logError bool + runtime string pipeline string msgCount int messageKey string @@ -1442,6 +1564,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", messageKey: "service", @@ -1466,6 +1589,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic services pipeline with StreamService failure", failure: false, + logError: true, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", messageKey: "service", @@ -1491,6 +1615,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1513,6 +1638,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic steps pipeline with StreamStep failure", failure: false, + logError: true, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1536,6 +1662,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", messageKey: "step", @@ -1558,6 +1685,7 @@ func TestLinux_StreamBuild(t *testing.T) { { name: "docker-basic secrets pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", messageKey: "secret", @@ -1582,6 +1710,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-early exit from ExecBuild", failure: false, earlyExecExit: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1605,6 +1734,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-build complete before ExecBuild called", failure: false, earlyBuildDone: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1628,6 +1758,7 @@ func TestLinux_StreamBuild(t *testing.T) { name: "docker-early exit from ExecBuild and build complete signaled", failure: false, earlyExecExit: true, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", messageKey: "step", @@ -1655,6 +1786,9 @@ func TestLinux_StreamBuild(t *testing.T) { streamRequests := make(chan message.StreamRequest) + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -1677,6 +1811,7 @@ func TestLinux_StreamBuild(t *testing.T) { } _engine, err := New( + WithLogger(logger), WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), @@ -1746,6 +1881,21 @@ func TestLinux_StreamBuild(t *testing.T) { if err != nil { t.Errorf("%s StreamBuild for %s returned err: %v", test.name, test.pipeline, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } @@ -1759,6 +1909,9 @@ func TestLinux_DestroyBuild(t *testing.T) { _user := testUser() _metadata := testMetadata() + testLogger := logrus.New() + loggerHook := logrusTest.NewLocal(testLogger) + gin.SetMode(gin.TestMode) s := httptest.NewServer(server.FakeHandler()) @@ -1771,54 +1924,63 @@ func TestLinux_DestroyBuild(t *testing.T) { tests := []struct { name string failure bool + logError bool runtime string pipeline string }{ { name: "docker-basic secrets pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, { name: "docker-secrets pipeline with name not found", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/name_notfound.yml", }, { name: "docker-basic services pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, { name: "docker-services pipeline with name not found", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/services/name_notfound.yml", }, { name: "docker-basic steps pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, { name: "docker-steps pipeline with name not found", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/steps/name_notfound.yml", }, { name: "docker-basic stages pipeline", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, { name: "docker-stages pipeline with name not found", failure: false, + logError: false, runtime: constants.DriverDocker, pipeline: "testdata/build/stages/name_notfound.yml", }, @@ -1827,6 +1989,9 @@ func TestLinux_DestroyBuild(t *testing.T) { // run test for _, test := range tests { t.Run(test.name, func(t *testing.T) { + logger := testLogger.WithFields(logrus.Fields{"test": test.name}) + defer loggerHook.Reset() + _pipeline, _, err := compiler. Duplicate(). WithBuild(_build). @@ -1849,6 +2014,7 @@ func TestLinux_DestroyBuild(t *testing.T) { } _engine, err := New( + WithLogger(logger), WithBuild(_build), WithPipeline(_pipeline), WithRepo(_repo), @@ -1879,6 +2045,35 @@ func TestLinux_DestroyBuild(t *testing.T) { if err != nil { t.Errorf("%s DestroyBuild returned err: %v", test.name, err) } + + loggedError := false + for _, logEntry := range loggerHook.AllEntries() { + // Many errors during StreamBuild get logged and ignored. + // So, Make sure there are no errors logged during StreamBuild. + if logEntry.Level == logrus.ErrorLevel { + // Ignore error from not mocking something in the VelaClient + if strings.HasPrefix(logEntry.Message, "unable to upload") || + (strings.HasPrefix(logEntry.Message, "unable to destroy") && + strings.Contains(logEntry.Message, "No such container") && + strings.HasSuffix(logEntry.Message, "_notfound")) { + // unable to upload final step state: Step 0 does not exist + // unable to upload service snapshot: Service 0 does not exist + // unable to destroy secret: Error: No such container: secret_github_octocat_1_notfound + // unable to destroy service: Error: No such container: service_github_octocat_1_notfound + // unable to destroy step: Error: No such container: github_octocat_1_test_notfound + // unable to destroy stage: Error: No such container: github_octocat_1_test_notfound + continue + } + + loggedError = true + if !test.logError { + t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message) + } + } + } + if test.logError && !loggedError { + t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline) + } }) } } From a249322224ce3b6752d36529d540e5ebc570c3af Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 6 Feb 2023 09:21:13 -0600 Subject: [PATCH 366/430] enhance(executor tests): Sanitize pipelines to handle runtime specific differences (#422) --- executor/linux/api_test.go | 4 +++- executor/linux/build_test.go | 20 ++++++++++++++++- executor/linux/driver_test.go | 2 +- executor/linux/linux_test.go | 22 +++++++++--------- executor/linux/opts_test.go | 15 +++++-------- executor/linux/secret_test.go | 42 +++++++++++++++++++---------------- 6 files changed, 63 insertions(+), 42 deletions(-) diff --git a/executor/linux/api_test.go b/executor/linux/api_test.go index 7a1273f7..75f75a84 100644 --- a/executor/linux/api_test.go +++ b/executor/linux/api_test.go @@ -7,6 +7,8 @@ package linux import ( "reflect" "testing" + + "github.com/go-vela/types/constants" ) func TestLinux_GetBuild(t *testing.T) { @@ -64,7 +66,7 @@ func TestLinux_GetBuild(t *testing.T) { func TestLinux_GetPipeline(t *testing.T) { // setup types - _steps := testSteps() + _steps := testSteps(constants.DriverDocker) _engine, err := New( WithPipeline(_steps), diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 8a8870b2..1998265a 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -115,6 +115,9 @@ func TestLinux_CreateBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -1074,6 +1077,9 @@ func TestLinux_PlanBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -1269,6 +1275,9 @@ func TestLinux_AssembleBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -1420,6 +1429,9 @@ func TestLinux_ExecBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -1450,7 +1462,7 @@ func TestLinux_ExecBuild(t *testing.T) { // run create to init steps to be created properly err = _engine.CreateBuild(context.Background()) if err != nil { - t.Errorf("unable to create build: %v", err) + t.Errorf("%s unable to create build: %v", test.name, err) } // TODO: hack - remove this @@ -1800,6 +1812,9 @@ func TestLinux_StreamBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -2003,6 +2018,9 @@ func TestLinux_DestroyBuild(t *testing.T) { t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + _pipeline = _pipeline.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go index 294fe1e2..1efc0804 100644 --- a/executor/linux/driver_test.go +++ b/executor/linux/driver_test.go @@ -37,7 +37,7 @@ func TestLinux_Driver(t *testing.T) { _engine, err := New( WithBuild(testBuild()), WithHostname("localhost"), - WithPipeline(testSteps()), + WithPipeline(testSteps(constants.DriverDocker)), WithRepo(testRepo()), WithRuntime(_runtime), WithUser(testUser()), diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 1daf2c58..2503fc7a 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -9,16 +9,13 @@ import ( "testing" "github.com/gin-gonic/gin" - + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" "github.com/go-vela/types" - - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/docker" ) func TestEqual(t *testing.T) { @@ -40,7 +37,7 @@ func TestEqual(t *testing.T) { _linux, err := New( WithBuild(testBuild()), WithHostname("localhost"), - WithPipeline(testSteps()), + WithPipeline(testSteps(constants.DriverDocker)), WithRepo(testRepo()), WithRuntime(_runtime), WithUser(testUser()), @@ -53,7 +50,7 @@ func TestEqual(t *testing.T) { _alternate, err := New( WithBuild(testBuild()), WithHostname("a.different.host"), - WithPipeline(testSteps()), + WithPipeline(testSteps(constants.DriverDocker)), WithRepo(testRepo()), WithRuntime(_runtime), WithUser(testUser()), @@ -149,7 +146,7 @@ func TestLinux_New(t *testing.T) { _, err := New( WithBuild(test.build), WithHostname("localhost"), - WithPipeline(testSteps()), + WithPipeline(testSteps(constants.DriverDocker)), WithRepo(testRepo()), WithRuntime(_runtime), WithUser(testUser()), @@ -265,8 +262,8 @@ func testMetadata() *types.Metadata { // testSteps is a test helper function to create a steps // pipeline with fake steps. -func testSteps() *pipeline.Build { - return &pipeline.Build{ +func testSteps(runtime string) *pipeline.Build { + steps := &pipeline.Build{ Version: "1", ID: "github_octocat_1", Services: pipeline.ContainerSlice{ @@ -335,4 +332,7 @@ func testSteps() *pipeline.Build { }, }, } + + // apply any runtime-specific cleanups + return steps.Sanitize(runtime) } diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 1e4823ab..2a2af2d5 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -11,17 +11,14 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" - - "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/runtime" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/sdk-go/vela" - + "github.com/go-vela/server/mock/server" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" + "github.com/sirupsen/logrus" ) func TestLinux_Opt_WithBuild(t *testing.T) { @@ -384,7 +381,7 @@ func TestLinux_Opt_WithLogger(t *testing.T) { func TestLinux_Opt_WithPipeline(t *testing.T) { // setup types - _steps := testSteps() + _steps := testSteps(constants.DriverDocker) // setup tests tests := []struct { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index fd7f5811..86c2efb0 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -12,22 +12,17 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/urfave/cli/v2" - + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime" - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" ) func TestLinux_Secret_create(t *testing.T) { @@ -35,7 +30,7 @@ func TestLinux_Secret_create(t *testing.T) { _build := testBuild() _repo := testRepo() _user := testUser() - _steps := testSteps() + _steps := testSteps(constants.DriverDocker) gin.SetMode(gin.TestMode) @@ -125,7 +120,7 @@ func TestLinux_Secret_delete(t *testing.T) { _build := testBuild() _repo := testRepo() _user := testUser() - _steps := testSteps() + _dockerSteps := testSteps(constants.DriverDocker) gin.SetMode(gin.TestMode) @@ -153,6 +148,7 @@ func TestLinux_Secret_delete(t *testing.T) { runtime runtime.Engine container *pipeline.Container step *library.Step + steps *pipeline.Build }{ { name: "docker-running container-empty step", @@ -167,7 +163,8 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 1, Pull: "always", }, - step: new(library.Step), + step: new(library.Step), + steps: _dockerSteps, }, { name: "docker-running container-pending step", @@ -182,7 +179,8 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: _step, + step: _step, + steps: _dockerSteps, }, { name: "docker-inspecting container failure due to invalid container id", @@ -197,7 +195,8 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(library.Step), + steps: _dockerSteps, }, { name: "docker-removing container failure", @@ -212,7 +211,8 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(library.Step), + steps: _dockerSteps, }, } @@ -221,7 +221,7 @@ func TestLinux_Secret_delete(t *testing.T) { t.Run(test.name, func(t *testing.T) { _engine, err := New( WithBuild(_build), - WithPipeline(_steps), + WithPipeline(test.steps), WithRepo(_repo), WithRuntime(test.runtime), WithUser(_user), @@ -231,6 +231,7 @@ func TestLinux_Secret_delete(t *testing.T) { t.Errorf("unable to create %s executor engine: %v", test.name, err) } + // add init container info to client _ = _engine.CreateBuild(context.Background()) _engine.steps.Store(test.container.ID, test.step) @@ -310,6 +311,9 @@ func TestLinux_Secret_exec(t *testing.T) { t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err) } + // Docker uses _ while Kubernetes uses - + p = p.Sanitize(test.runtime) + var _runtime runtime.Engine switch test.runtime { @@ -506,7 +510,7 @@ func TestLinux_Secret_pull(t *testing.T) { t.Run(test.name, func(t *testing.T) { _engine, err := New( WithBuild(_build), - WithPipeline(testSteps()), + WithPipeline(testSteps(constants.DriverDocker)), WithRepo(_repo), WithRuntime(test.runtime), WithUser(_user), @@ -538,7 +542,7 @@ func TestLinux_Secret_stream(t *testing.T) { _build := testBuild() _repo := testRepo() _user := testUser() - _steps := testSteps() + _steps := testSteps(constants.DriverDocker) gin.SetMode(gin.TestMode) From 36bb211434cddecb64cc03c2fe48ee581636be2c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 20 Feb 2023 16:16:07 -0600 Subject: [PATCH 367/430] enhance(executor tests): Add test helpers to generate test Pods (#424) * test: add kubernetes baseline for Create funcs * test: add kubernetes runtime for stages * test: prepare for test specific pod in executor test * test: add testPod helper method * test: add testPodFor(pipeline) helper method * test: mark secret containers terminated in test Pods * test: use pipeline-specific runtime instances * test: Create runtime for each executor build test * test: Adds several new test helpers. --------- Co-authored-by: JordanBrockopp --- executor/linux/build_test.go | 44 +++- executor/linux/linux_test.go | 365 ++++++++++++++++++++++++++++++++++ executor/linux/secret_test.go | 7 + 3 files changed, 415 insertions(+), 1 deletion(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 1998265a..fa0d0e0e 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -12,6 +12,8 @@ import ( "testing" "time" + v1 "k8s.io/api/core/v1" + "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" @@ -22,6 +24,7 @@ import ( "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" "github.com/sirupsen/logrus" logrusTest "github.com/sirupsen/logrus/hooks/test" "github.com/urfave/cli/v2" @@ -121,6 +124,12 @@ func TestLinux_CreateBuild(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { @@ -1083,6 +1092,12 @@ func TestLinux_PlanBuild(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { @@ -1281,6 +1296,12 @@ func TestLinux_AssembleBuild(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { @@ -1432,9 +1453,18 @@ func TestLinux_ExecBuild(t *testing.T) { // Docker uses _ while Kubernetes uses - _pipeline = _pipeline.Sanitize(test.runtime) - var _runtime runtime.Engine + var ( + _runtime runtime.Engine + _pod *v1.Pod + ) switch test.runtime { + case constants.DriverKubernetes: + _pod = testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { @@ -1818,6 +1848,12 @@ func TestLinux_StreamBuild(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { @@ -2024,6 +2060,12 @@ func TestLinux_DestroyBuild(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(_pipeline) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 2503fc7a..5384e749 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -5,9 +5,13 @@ package linux import ( + "math" "net/http/httptest" "testing" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" @@ -336,3 +340,364 @@ func testSteps(runtime string) *pipeline.Build { // apply any runtime-specific cleanups return steps.Sanitize(runtime) } + +// testPod is a test helper function to create a Pod +// type with all fields set to a fake value. +func testPod(useStages bool) *v1.Pod { + // https://github.com/go-vela/worker/blob/main/runtime/kubernetes/kubernetes_test.go#L83 + pod := &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "github-octocat-1", + Namespace: "test", + Labels: map[string]string{ + "pipeline": "github-octocat-1", + }, + }, + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "Pod", + }, + Status: v1.PodStatus{ + Phase: v1.PodRunning, + }, + Spec: v1.PodSpec{}, + } + + if useStages { + pod.Spec.Containers = []v1.Container{ + { + Name: "github-octocat-1-clone-clone", + Image: "target/vela-git:v0.6.0", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "github-octocat-1-echo-echo", + Image: "alpine:latest", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "service-github-octocat-1-postgres", + Image: "postgres:12-alpine", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + } + pod.Status.ContainerStatuses = []v1.ContainerStatus{ + { + Name: "github-octocat-1-clone-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "target/vela-git:v0.6.0", + }, + { + Name: "github-octocat-1-echo-echo", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "alpine:latest", + }, + } + } else { // step + pod.Spec.Containers = []v1.Container{ + { + Name: "step-github-octocat-1-clone", + Image: "target/vela-git:v0.6.0", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "step-github-octocat-1-echo", + Image: "alpine:latest", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + { + Name: "service-github-octocat-1-postgres", + Image: "postgres:12-alpine", + WorkingDir: "/vela/src/github.com/octocat/helloworld", + ImagePullPolicy: v1.PullAlways, + }, + } + pod.Status.ContainerStatuses = []v1.ContainerStatus{ + { + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "target/vela-git:v0.6.0", + }, + { + Name: "step-github-octocat-1-echo", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "alpine:latest", + }, + } + } + + return pod +} + +// testPodFor is a test helper function to create a Pod +// using container names from a test pipeline. +func testPodFor(build *pipeline.Build) *v1.Pod { + var ( + pod *v1.Pod + containers []v1.Container + ) + + workingDir := "/vela/src/github.com/octocat/helloworld" + useStages := len(build.Stages) > 0 + pod = testPod(useStages) + + for _, service := range build.Services { + containers = append(containers, v1.Container{ + Name: service.ID, + Image: service.Image, + WorkingDir: workingDir, + // service.Pull should be one of: Always, Never, IfNotPresent + ImagePullPolicy: v1.PullPolicy(service.Pull), + }) + } + + if useStages { + containers = append(containers, v1.Container{ + Name: "step-github-octocat-1-clone-clone", + Image: "target/vela-git:v0.6.0", + WorkingDir: workingDir, + ImagePullPolicy: v1.PullAlways, + }) + } else { // steps + containers = append(containers, v1.Container{ + Name: "step-github-octocat-1-clone", + Image: "target/vela-git:v0.6.0", + WorkingDir: workingDir, + ImagePullPolicy: v1.PullAlways, + }) + } + + for _, stage := range build.Stages { + for _, step := range stage.Steps { + if step.Name == "init" { + continue + } + + containers = append(containers, v1.Container{ + Name: step.ID, + Image: step.Image, + WorkingDir: workingDir, + // step.Pull should be one of: Always, Never, IfNotPresent + ImagePullPolicy: v1.PullPolicy(step.Pull), + }) + } + } + + for _, step := range build.Steps { + if step.Name == "init" { + continue + } + + containers = append(containers, v1.Container{ + Name: step.ID, + Image: step.Image, + WorkingDir: workingDir, + // step.Pull should be one of: Always, Never, IfNotPresent + ImagePullPolicy: v1.PullPolicy(step.Pull), + }) + } + + for _, secret := range build.Secrets { + if secret.Origin.Empty() { + continue + } + + containers = append(containers, v1.Container{ + Name: secret.Origin.ID, + Image: secret.Origin.Image, + WorkingDir: workingDir, + // secret.Origin.Pull should be one of: Always, Never, IfNotPresent + ImagePullPolicy: v1.PullPolicy(secret.Origin.Pull), + }) + } + + pod.Spec.Containers = containers + pod.Status.ContainerStatuses = testContainerStatuses(build, false, 0, 0) + + return pod +} + +// countBuildSteps counts the steps in the build. +func countBuildSteps(build *pipeline.Build) int { + steps := 0 + + for _, stage := range build.Stages { + for _, step := range stage.Steps { + if step.Name == "init" { + continue + } + + steps++ + } + } + + for _, step := range build.Steps { + if step.Name == "init" { + continue + } + + steps++ + } + + return steps +} + +// testContainerStatuses is a test helper function to create a ContainerStatuses list. +func testContainerStatuses(build *pipeline.Build, servicesRunning bool, stepsRunningCount, stepsCompletedPercent int) []v1.ContainerStatus { + var containerStatuses []v1.ContainerStatus + + useStages := len(build.Stages) > 0 + stepsCompletedCount := 0 + + if stepsCompletedPercent > 0 { + stepsCompletedCount = int(math.Round(float64(stepsCompletedPercent) / 100 * float64(countBuildSteps(build)))) + } + + if servicesRunning { + for _, service := range build.Services { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: service.ID, + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + Image: service.Image, + }) + } + } + + if useStages { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: "step-github-octocat-1-clone-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "target/vela-git:v0.6.0", + }) + } else { // steps + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: "step-github-octocat-1-clone", + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: "target/vela-git:v0.6.0", + }) + } + + steps := 0 + + for _, stage := range build.Stages { + for _, step := range stage.Steps { + if step.Name == "init" { + continue + } + + steps++ + if steps > stepsCompletedCount+stepsRunningCount { + break + } + + if stepsRunningCount > 0 && steps > stepsCompletedCount { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: step.ID, + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + Image: step.Image, + }) + } else if steps <= stepsCompletedCount { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: step.ID, + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: step.Image, + }) + } + } + } + + for _, step := range build.Steps { + if step.Name == "init" { + continue + } + + steps++ + if steps > stepsCompletedCount+stepsRunningCount { + break + } + + if stepsRunningCount > 0 && steps > stepsCompletedCount { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: step.ID, + State: v1.ContainerState{ + Running: &v1.ContainerStateRunning{}, + }, + Image: step.Image, + }) + } else if steps <= stepsCompletedCount { + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: step.ID, + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + Image: step.Image, + }) + } + } + + for _, secret := range build.Secrets { + if secret.Origin.Empty() { + continue + } + + containerStatuses = append(containerStatuses, v1.ContainerStatus{ + Name: secret.Origin.ID, + Image: secret.Origin.Image, + State: v1.ContainerState{ + Terminated: &v1.ContainerStateTerminated{ + Reason: "Completed", + ExitCode: 0, + }, + }, + }) + } + + return containerStatuses +} diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 86c2efb0..9cdbcffb 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -21,6 +21,7 @@ import ( "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" "github.com/google/go-cmp/cmp" "github.com/urfave/cli/v2" ) @@ -317,6 +318,12 @@ func TestLinux_Secret_exec(t *testing.T) { var _runtime runtime.Engine switch test.runtime { + case constants.DriverKubernetes: + _pod := testPodFor(p) + _runtime, err = kubernetes.NewMock(_pod) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } case constants.DriverDocker: _runtime, err = docker.NewMock() if err != nil { From 55aab528426f97e21f66af3e3e11c5389773be30 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 24 Feb 2023 10:41:57 -0600 Subject: [PATCH 368/430] enhance(executor tests): Call k8s SetupMock method after CreateBuild in tests (#425) * enhance: extract kubernetes runtime mock setup In order to run the PodTracker mock setup in executor tests, we need to export something * Call k8s SetupMock in executor Build test * test: Add kubernetes SetupMock to executor StreamBuild test * mark exported k8s Mock functions as test-only functions --- executor/linux/build_test.go | 26 +++++++++++++++++++++++++- executor/linux/secret_test.go | 24 ++++++++++++++++++++++++ runtime/kubernetes/mock.go | 15 ++++++++++++++- runtime/kubernetes/pod_tracker.go | 18 ++++++++++++++---- 4 files changed, 77 insertions(+), 6 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index fa0d0e0e..1ee74edd 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1529,6 +1529,14 @@ func TestLinux_ExecBuild(t *testing.T) { // go-vela/server has logic to set it to an expected state. _engine.build.SetStatus("running") + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime == constants.DriverKubernetes { + err = _runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + err = _engine.ExecBuild(context.Background()) if test.failure { @@ -1882,8 +1890,16 @@ func TestLinux_StreamBuild(t *testing.T) { t.Errorf("%s unable to create build: %v", test.name, err) } - // simulate ExecBuild() which runs concurrently with StreamBuild() + // simulate AssembleBuild()/ExecBuild() which run concurrently with StreamBuild() go func() { + // This Kubernetes setup would normally be called within AssembleBuild() + if test.runtime == constants.DriverKubernetes { + err = _runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + if test.earlyBuildDone { // imitate build getting canceled or otherwise finishing before ExecBuild gets called. done() @@ -2092,6 +2108,14 @@ func TestLinux_DestroyBuild(t *testing.T) { t.Errorf("%s unable to create build: %v", test.name, err) } + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime == constants.DriverKubernetes { + err = _runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + err = _engine.DestroyBuild(context.Background()) if test.failure { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 9cdbcffb..01740c83 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -235,6 +235,14 @@ func TestLinux_Secret_delete(t *testing.T) { // add init container info to client _ = _engine.CreateBuild(context.Background()) + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime.Driver() == constants.DriverKubernetes { + err = _engine.Runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + _engine.steps.Store(test.container.ID, test.step) err = _engine.secret.destroy(context.Background(), test.container) @@ -349,6 +357,14 @@ func TestLinux_Secret_exec(t *testing.T) { // add init container info to client _ = _engine.CreateBuild(context.Background()) + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime == constants.DriverKubernetes { + err = _runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + err = _engine.secret.exec(context.Background(), &p.Secrets) if test.failure { @@ -623,6 +639,14 @@ func TestLinux_Secret_stream(t *testing.T) { // add init container info to client _ = _engine.CreateBuild(context.Background()) + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime.Driver() == constants.DriverKubernetes { + err = _engine.Runtime.(kubernetes.MockKubernetesRuntime).SetupMock() + if err != nil { + t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) + } + } + err = _engine.secret.stream(context.Background(), test.container) if test.failure { diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go index b409a157..077d52eb 100644 --- a/runtime/kubernetes/mock.go +++ b/runtime/kubernetes/mock.go @@ -4,14 +4,17 @@ package kubernetes +// Everything in this file should only be used in test code. +// It is exported for use in tests of other packages. + import ( - "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" + "github.com/sirupsen/logrus" ) // NewMock returns an Engine implementation that @@ -90,10 +93,20 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { // // This interface is intended for running tests only. type MockKubernetesRuntime interface { + SetupMock() error MarkPodTrackerReady() SimulateResync(*v1.Pod) } +// SetupMock allows the Kubernetes runtime to perform additional Mock-related config. +// Many tests should call this right after they call runtime.SetupBuild (or executor.CreateBuild). +// +// This function is intended for running tests only. +func (c *client) SetupMock() error { + // This assumes that c.Pod.ObjectMeta.Namespace and c.Pod.ObjectMeta.Name are filled in. + return c.PodTracker.setupMockFor(c.Pod) +} + // MarkPodTrackerReady signals that PodTracker has been setup with ContainerTrackers. // // This function is intended for running tests only. diff --git a/runtime/kubernetes/pod_tracker.go b/runtime/kubernetes/pod_tracker.go index 221e881f..65e1b2d8 100644 --- a/runtime/kubernetes/pod_tracker.go +++ b/runtime/kubernetes/pod_tracker.go @@ -251,14 +251,24 @@ func mockPodTracker(log *logrus.Entry, clientset kubernetes.Interface, pod *v1.P return nil, err } + err = tracker.setupMockFor(pod) + if err != nil { + return nil, err + } + + return tracker, err +} + +// setupMockFor initializes the podTracker's internal caches with the given pod. +func (p *podTracker) setupMockFor(pod *v1.Pod) error { // init containerTrackers as well - tracker.TrackContainers(pod.Spec.Containers) + p.TrackContainers(pod.Spec.Containers) // pre-populate the podInformer cache - err = tracker.podInformer.Informer().GetIndexer().Add(pod) + err := p.podInformer.Informer().GetIndexer().Add(pod) if err != nil { - return nil, err + return err } - return tracker, err + return nil } From 4b552b524d02169e544d58bf9eb9fe52a96ee1a1 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:32:52 -0600 Subject: [PATCH 369/430] fix(tests): accommodate clone image change in server (#417) --- executor/linux/build_test.go | 28 +++++++++++++++++++++------- executor/linux/secret_test.go | 4 +++- executor/linux/stage_test.go | 4 +++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 1ee74edd..af0ad5d3 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -32,7 +32,9 @@ import ( func TestLinux_CreateBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() @@ -184,7 +186,9 @@ func TestLinux_CreateBuild(t *testing.T) { func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() @@ -1013,7 +1017,9 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) { func TestLinux_PlanBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() @@ -1158,7 +1164,9 @@ func TestLinux_PlanBuild(t *testing.T) { func TestLinux_AssembleBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() @@ -1363,7 +1371,9 @@ func TestLinux_AssembleBuild(t *testing.T) { func TestLinux_ExecBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() @@ -1571,7 +1581,9 @@ func TestLinux_ExecBuild(t *testing.T) { func TestLinux_StreamBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() @@ -1969,7 +1981,9 @@ func TestLinux_StreamBuild(t *testing.T) { func TestLinux_DestroyBuild(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 01740c83..2891d6a7 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -264,7 +264,9 @@ func TestLinux_Secret_delete(t *testing.T) { func TestLinux_Secret_exec(t *testing.T) { // setup types - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _build := testBuild() _repo := testRepo() diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index b2a7147b..c70b94ce 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -31,7 +31,9 @@ func TestLinux_CreateStage(t *testing.T) { _user := testUser() _metadata := testMetadata() - compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil)) + set := flag.NewFlagSet("test", 0) + set.String("clone-image", "target/vela-git:latest", "doc") + compiler, _ := native.New(cli.NewContext(nil, set, nil)) _pipeline, _, err := compiler. Duplicate(). From bf1c91e7a93589e6c8e99b663ce60b94ee3b13f5 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:05:46 -0700 Subject: [PATCH 370/430] feat(build_token): worker changes for build token implementation (#427) --- cmd/vela-worker/client.go | 5 ++--- cmd/vela-worker/exec.go | 14 +++++++++++++- cmd/vela-worker/operate.go | 4 ++-- cmd/vela-worker/register.go | 2 +- go.mod | 6 +++--- go.sum | 12 ++++++------ 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index 677df2dc..1f225856 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -11,7 +11,7 @@ import ( ) // helper function to setup the queue from the CLI arguments. -func setupClient(s *Server) (*vela.Client, error) { +func setupClient(s *Server, token string) (*vela.Client, error) { logrus.Debug("creating vela client from worker configuration") // create a new Vela client from the server configuration @@ -21,11 +21,10 @@ func setupClient(s *Server) (*vela.Client, error) { if err != nil { return nil, err } - // set token for authentication with the server // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#AuthenticationService.SetTokenAuth - vela.Authentication.SetTokenAuth(s.Secret) + vela.Authentication.SetTokenAuth(token) return vela, nil } diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 06a60ae8..f1a9cbc5 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -36,6 +36,18 @@ func (w *Worker) exec(index int) error { return nil } + // GET build token from server to setup execBuildClient + bt, _, err := w.VelaClient.Build.GetBuildToken(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber()) + if err != nil { + logrus.Errorf("Unable to GetBuildToken: %s", err) + return err + } + // set up build client with build token as auth + execBuildClient, err := setupClient(w.Config.Server, bt.GetToken()) + if err != nil { + return err + } + // create logger with extra metadata // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#WithFields @@ -79,7 +91,7 @@ func (w *Worker) exec(index int) error { LogStreamingTimeout: w.Config.Executor.LogStreamingTimeout, EnforceTrustedRepos: w.Config.Executor.EnforceTrustedRepos, PrivilegedImages: w.Config.Runtime.PrivilegedImages, - Client: w.VelaClient, + Client: execBuildClient, Hostname: w.Config.API.Address.Hostname(), Runtime: w.Runtime, Build: item.Build, diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index da223970..bbbe2e7a 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -22,8 +22,8 @@ import ( func (w *Worker) operate(ctx context.Context) error { var err error - // setup the client - w.VelaClient, err = setupClient(w.Config.Server) + // setup the vela client with the server + w.VelaClient, err = setupClient(w.Config.Server, w.Config.Server.Secret) if err != nil { return err } diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index 8c40d9b2..5de52721 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -12,7 +12,7 @@ import ( "github.com/sirupsen/logrus" ) -// checkIn is a helper function to to phone home to the server. +// checkIn is a helper function to phone home to the server. func (w *Worker) checkIn(config *library.Worker) error { // check to see if the worker already exists in the database logrus.Infof("retrieving worker %s from the server", config.GetHostname()) diff --git a/go.mod b/go.mod index f19ed253..014042c5 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.22+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-vela/sdk-go v0.17.0 - github.com/go-vela/server v0.17.0 - github.com/go-vela/types v0.17.0 + github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b + github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 + github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.4.0 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index cf8834b1..5ddbabaf 100644 --- a/go.sum +++ b/go.sum @@ -152,12 +152,12 @@ github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXS github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.17.0 h1:vVck8Xm5/co6zrDntG1mdjenT5N0vgDJ30ImFZTUEjY= -github.com/go-vela/sdk-go v0.17.0/go.mod h1:R7oHeYj1ThBREPzqsvevUEBxp8knmOviFbspvuGqZsU= -github.com/go-vela/server v0.17.0 h1:sEJ4a9mus43Qw4E431OYwN8qvYugoA0ZmaU0sFGgESk= -github.com/go-vela/server v0.17.0/go.mod h1:Z8YT/IFJTQ80a63GINRHCaFBTkkkHAL7mDohw4xLbEE= -github.com/go-vela/types v0.17.0 h1:nvKBbNO8BSiLtYPMScT0XWosGqEWX85UKSkkclb2DVA= -github.com/go-vela/types v0.17.0/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b h1:N/g4kgUFlb36JZBlhuq3ifJE+DTIJTqO21nGXsf+76A= +github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b/go.mod h1:RurQS+lXlmzv4I/QS/qMI1Rqb36tfA+NubekWVRIwXc= +github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 h1:CUXtUYOu8Jz9IYuTMXivu4GXr8BdQXLAYjFYnDnkndE= +github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8/go.mod h1:WJZQJ2nwSSDuB56LskZ3gEoSWI0IwKRtxaFE8GdTLIc= +github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 h1:tdjas7NJLWlU2vmETaU36wjbd+zvWPLtznE4uwtnFlw= +github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From d14c6b4082158c029a756f436af5aa3985c95436 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 27 Feb 2023 09:18:45 -0600 Subject: [PATCH 371/430] enhance(executor tests): Manage k8s mocks for Executor exec tests (#431) --- executor/linux/build_test.go | 33 +++++++++++++++++++++++++++++++++ executor/linux/secret_test.go | 2 ++ runtime/kubernetes/build.go | 2 +- runtime/kubernetes/mock.go | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index af0ad5d3..ce5934d4 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1545,6 +1545,36 @@ func TestLinux_ExecBuild(t *testing.T) { if err != nil { t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) } + + _runtime.(kubernetes.MockKubernetesRuntime).StartPodTracker(context.Background()) + + go func() { + _runtime.(kubernetes.MockKubernetesRuntime).SimulateResync(nil) + + var stepsRunningCount int + + percents := []int{0, 0, 50, 100} + lastIndex := len(percents) - 1 + for index, stepsCompletedPercent := range percents { + if index == 0 || index == lastIndex { + stepsRunningCount = 0 + } else { + stepsRunningCount = 1 + } + + err := _runtime.(kubernetes.MockKubernetesRuntime).SimulateStatusUpdate(_pod, + testContainerStatuses( + _pipeline, true, stepsRunningCount, stepsCompletedPercent, + ), + ) + if err != nil { + t.Errorf("%s - failed to simulate pod update: %s", test.name, err) + } + + // simulate exec build duration + time.Sleep(100 * time.Microsecond) + } + }() } err = _engine.ExecBuild(context.Background()) @@ -1910,6 +1940,9 @@ func TestLinux_StreamBuild(t *testing.T) { if err != nil { t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) } + + // Runtime.StreamBuild calls PodTracker.Start after the PodTracker is marked Ready + _runtime.(kubernetes.MockKubernetesRuntime).MarkPodTrackerReady() } if test.earlyBuildDone { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 2891d6a7..0043872c 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -365,6 +365,8 @@ func TestLinux_Secret_exec(t *testing.T) { if err != nil { t.Errorf("Kubernetes runtime SetupMock returned err: %v", err) } + + go _runtime.(kubernetes.MockKubernetesRuntime).SimulateResync(nil) } err = _engine.secret.exec(context.Background(), &p.Secrets) diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index ad94681f..a72c3b24 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -212,7 +212,7 @@ func (c *client) AssembleBuild(ctx context.Context, b *pipeline.Build) error { } } - // setup containerTeachers now that all containers are defined. + // setup containerTrackers now that all containers are defined. c.PodTracker.TrackContainers(c.Pod.Spec.Containers) // send signal to StreamBuild now that PodTracker is ready to be started. diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go index 077d52eb..6c2ec36f 100644 --- a/runtime/kubernetes/mock.go +++ b/runtime/kubernetes/mock.go @@ -8,6 +8,8 @@ package kubernetes // It is exported for use in tests of other packages. import ( + "context" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" @@ -84,7 +86,8 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { c.PodTracker = tracker - // The test is responsible for calling c.PodTracker.Start() if needed + // The test is responsible for calling c.PodTracker.Start(ctx) if needed. + // In some cases it is more convenient to call c.(MockKubernetesRuntime).StartPodTracker(ctx) return c, nil } @@ -95,7 +98,9 @@ func NewMock(_pod *v1.Pod, opts ...ClientOpt) (*client, error) { type MockKubernetesRuntime interface { SetupMock() error MarkPodTrackerReady() + StartPodTracker(context.Context) SimulateResync(*v1.Pod) + SimulateStatusUpdate(*v1.Pod, []v1.ContainerStatus) error } // SetupMock allows the Kubernetes runtime to perform additional Mock-related config. @@ -114,6 +119,13 @@ func (c *client) MarkPodTrackerReady() { close(c.PodTracker.Ready) } +// StartPodTracker tells the podTracker it can start populating the cache. +// +// This function is intended for running tests only. +func (c *client) StartPodTracker(ctx context.Context) { + c.PodTracker.Start(ctx) +} + // SimulateResync simulates an resync where the PodTracker refreshes its cache. // This resync is from oldPod to runtime.Pod. If nil, oldPod defaults to runtime.Pod. // @@ -129,3 +141,22 @@ func (c *client) SimulateResync(oldPod *v1.Pod) { // simulate a re-sync/PodUpdate event c.PodTracker.HandlePodUpdate(oldPod, c.Pod) } + +// SimulateUpdate simulates an update event from the k8s API. +// +// This function is intended for running tests only. +func (c *client) SimulateStatusUpdate(pod *v1.Pod, containerStatuses []v1.ContainerStatus) error { + // We have to have a full copy here because the k8s client Mock + // replaces the pod it is storing, it does not just update the status. + updatedPod := pod.DeepCopy() + updatedPod.Status.ContainerStatuses = containerStatuses + + _, err := c.Kubernetes.CoreV1().Pods(pod.GetNamespace()). + UpdateStatus( + context.Background(), + updatedPod, + metav1.UpdateOptions{}, + ) + + return err +} From 48dc69afca1687f15c952377d9b53f11c191ab41 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 27 Feb 2023 12:07:53 -0600 Subject: [PATCH 372/430] enhance(executor tests): Manage k8s mocks for Executor AssembleBuild test (#432) * test: Fix kubernetes tests for executor AssembleBuild Adds some new WaitForPod* test helpers. * sort imports in runtime/kubernetes/kubernetes.go * test: add pause to simulate step execution * AssembleBuild test does not need to mark steps running --- executor/linux/build_test.go | 27 ++++++++++++++++++-- runtime/kubernetes/kubernetes.go | 2 +- runtime/kubernetes/mock.go | 44 ++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index ce5934d4..c1297a4a 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -1305,8 +1305,7 @@ func TestLinux_AssembleBuild(t *testing.T) { switch test.runtime { case constants.DriverKubernetes: - _pod := testPodFor(_pipeline) - _runtime, err = kubernetes.NewMock(_pod) + _runtime, err = kubernetes.NewMock(&v1.Pod{}) // do not use _pod here! AssembleBuild will load it. if err != nil { t.Errorf("unable to create kubernetes runtime engine: %v", err) } @@ -1337,6 +1336,30 @@ func TestLinux_AssembleBuild(t *testing.T) { t.Errorf("unable to create build: %v", err) } + // Kubernetes runtime needs to set up the Mock after CreateBuild is called + if test.runtime == constants.DriverKubernetes { + go func() { + _mockRuntime := _runtime.(kubernetes.MockKubernetesRuntime) + // This handles waiting until runtime.AssembleBuild has prepared the PodTracker. + _mockRuntime.WaitForPodTrackerReady() + // Normally, runtime.StreamBuild (which runs in a goroutine) calls PodTracker.Start. + _mockRuntime.StartPodTracker(context.Background()) + + _pod := testPodFor(_pipeline) + + // Now wait until the pod is created at the end of runtime.AssembleBuild. + _mockRuntime.WaitForPodCreate(_pod.GetNamespace(), _pod.GetName()) + + // Mark services running and secrets as completed, but no steps have started. + err := _mockRuntime.SimulateStatusUpdate(_pod, + testContainerStatuses(_pipeline, true, 0, 0), + ) + if err != nil { + t.Errorf("%s - failed to simulate pod update: %s", test.name, err) + } + }() + } + err = _engine.AssembleBuild(context.Background()) if test.failure { diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index d9cbdfcd..35dd9846 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -5,7 +5,6 @@ package kubernetes import ( - "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -13,6 +12,7 @@ import ( velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" velaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned" + "github.com/sirupsen/logrus" ) type config struct { diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go index 6c2ec36f..99666bcc 100644 --- a/runtime/kubernetes/mock.go +++ b/runtime/kubernetes/mock.go @@ -13,6 +13,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" + "k8s.io/client-go/tools/cache" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" @@ -99,6 +100,8 @@ type MockKubernetesRuntime interface { SetupMock() error MarkPodTrackerReady() StartPodTracker(context.Context) + WaitForPodTrackerReady() + WaitForPodCreate(string, string) SimulateResync(*v1.Pod) SimulateStatusUpdate(*v1.Pod, []v1.ContainerStatus) error } @@ -126,6 +129,47 @@ func (c *client) StartPodTracker(ctx context.Context) { c.PodTracker.Start(ctx) } +// WaitForPodTrackerReady waits for PodTracker.Ready to be closed (which happens in AssembleBuild). +// +// This function is intended for running tests only. +func (c *client) WaitForPodTrackerReady() { + <-c.PodTracker.Ready +} + +// WaitForPodCreate waits for PodTracker.Ready to be closed (which happens in AssembleBuild). +// +// This function is intended for running tests only. +func (c *client) WaitForPodCreate(namespace, name string) { + created := make(chan struct{}) + + c.PodTracker.podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + select { + case <-created: + // not interested in any other create events. + return + default: + break + } + + var ( + pod *v1.Pod + ok bool + ) + + if pod, ok = obj.(*v1.Pod); !ok { + return + } + + if pod.GetNamespace() == namespace && pod.GetName() == name { + close(created) + } + }, + }) + + <-created +} + // SimulateResync simulates an resync where the PodTracker refreshes its cache. // This resync is from oldPod to runtime.Pod. If nil, oldPod defaults to runtime.Pod. // From 0c56c301d8aceebd1f3a2bdfd1f7e6d36a0f6311 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 08:23:38 -0600 Subject: [PATCH 373/430] fix(deps): update deps (patch) (#414) --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 014042c5..077e2675 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.0 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.22+incompatible + github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.8.1 github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.23.7 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 - k8s.io/api v0.26.0 - k8s.io/apimachinery v0.26.0 - k8s.io/client-go v0.26.0 + k8s.io/api v0.26.1 + k8s.io/apimachinery v0.26.1 + k8s.io/client-go v0.26.1 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 5ddbabaf..eb60a91f 100644 --- a/go.sum +++ b/go.sum @@ -92,8 +92,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.22+incompatible h1:6jX4yB+NtcbldT90k7vBSaWJDB3i+zkVJT9BEK8kQkk= -github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.23+incompatible h1:1ZQUUYAdh+oylOT85aA2ZcfRp22jmLhoaEcVEfK8dyA= +github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -792,12 +792,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= -k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= -k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8= -k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= +k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= +k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= +k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= +k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= +k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= From 87056628caee7cdeef4088ea33c876716cb837c7 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 28 Feb 2023 09:52:36 -0600 Subject: [PATCH 374/430] Update spec.yml (#416) Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> Co-authored-by: Kelly Merrick --- .github/workflows/spec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 049f6fc3..0f7ccefb 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -29,8 +29,8 @@ jobs: - name: create spec run: | - make spec-install - make spec + sudo make spec-install + sudo make spec - name: upload spec uses: skx/github-action-publish-binaries@master From b38d1141c55b08c6caac2f86926c35dcb05d3f5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:16:51 -0600 Subject: [PATCH 375/430] fix(deps): update module github.com/gin-gonic/gin to v1.9.0 (#426) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 31 +++++++++++++--------- go.sum | 83 +++++++++++++++++++++++++++++++--------------------------- 2 files changed, 63 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 077e2675..cebcbfbe 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 - github.com/gin-gonic/gin v1.8.1 + github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 @@ -35,7 +35,9 @@ require ( github.com/alicebob/miniredis/v2 v2.23.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 // indirect + github.com/bytedance/sonic v1.8.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -50,11 +52,11 @@ require ( github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.19.14 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.11.2 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect - github.com/goccy/go-json v0.9.7 // indirect + github.com/goccy/go-json v0.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.3 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -72,9 +74,10 @@ require ( github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect @@ -84,7 +87,7 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect @@ -94,16 +97,18 @@ require ( github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.9 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect go.starlark.net v0.0.0-20221205180719-3fd0dac74452 // indirect - golang.org/x/crypto v0.3.0 // indirect - golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.3.0 // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect diff --git a/go.sum b/go.sum index eb60a91f..057bb6d7 100644 --- a/go.sum +++ b/go.sum @@ -68,10 +68,16 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 h1:qLN32md48xyTEqw6XEZMyNMre7njm0XXvDrea6NVwOM= github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -117,8 +123,8 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -141,14 +147,13 @@ github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXym github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -158,8 +163,8 @@ github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 h1:CUXtUYOu8Jz9I github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8/go.mod h1:WJZQJ2nwSSDuB56LskZ3gEoSWI0IwKRtxaFE8GdTLIc= github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 h1:tdjas7NJLWlU2vmETaU36wjbd+zvWPLtznE4uwtnFlw= github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -275,15 +280,15 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -295,8 +300,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -328,9 +333,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -365,9 +369,7 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -388,6 +390,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -395,10 +399,13 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= @@ -418,6 +425,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.starlark.net v0.0.0-20221205180719-3fd0dac74452 h1:JZtNuL6LPB+scU5yaQ6hqRlJFRiddZm2FwRt2AQqtHA= go.starlark.net v0.0.0-20221205180719-3fd0dac74452/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -425,11 +434,11 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -502,8 +511,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= -golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -576,22 +585,21 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -601,8 +609,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -763,7 +771,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -779,7 +786,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= @@ -805,6 +811,7 @@ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhkl k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= From 66737945be4de5681b8ece99009965befc0a45a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:37:39 -0600 Subject: [PATCH 376/430] fix(deps): update module github.com/joho/godotenv to v1.5.1 (#423) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cebcbfbe..031580b6 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 github.com/google/go-cmp v0.5.9 - github.com/joho/godotenv v1.4.0 + github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index 057bb6d7..f44bda27 100644 --- a/go.sum +++ b/go.sum @@ -264,8 +264,8 @@ 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/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= From 4e9c1b7afece2b7cd204b9f90b8074a2db48b906 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:46:01 -0600 Subject: [PATCH 377/430] fix(deps): update module github.com/urfave/cli/v2 to v2.24.4 (#420) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 031580b6..83bc6693 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.23.7 + github.com/urfave/cli/v2 v2.24.4 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.26.1 diff --git a/go.sum b/go.sum index f44bda27..9f4a5a12 100644 --- a/go.sum +++ b/go.sum @@ -406,8 +406,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= -github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= +github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 607ed9fd717809b09fa07448d991c05884a9acc4 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 28 Feb 2023 11:48:42 -0600 Subject: [PATCH 378/430] chore: upgrade to docker v23 and add new mocked funcs (#433) --- go.mod | 2 +- go.sum | 4 ++-- mock/docker/container.go | 4 ++-- mock/docker/system.go | 2 +- mock/docker/volume.go | 9 +++++++++ 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 83bc6693..c9b46f24 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.0 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.23+incompatible + github.com/docker/docker v23.0.1+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b diff --git a/go.sum b/go.sum index 9f4a5a12..9de30a67 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.23+incompatible h1:1ZQUUYAdh+oylOT85aA2ZcfRp22jmLhoaEcVEfK8dyA= -github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= +github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= diff --git a/mock/docker/container.go b/mock/docker/container.go index a39cf3f3..99a79246 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -357,7 +357,7 @@ func (c *ContainerService) ContainerResize(ctx context.Context, ctn string, opti // a mocked call to restart a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerRestart -func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, timeout *time.Duration) error { +func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, options container.StopOptions) error { return nil } @@ -403,7 +403,7 @@ func (c *ContainerService) ContainerStats(ctx context.Context, ctn string, strea // a mocked call to stop a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStop -func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, timeout *time.Duration) error { +func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, options container.StopOptions) error { // verify a container was provided if len(ctn) == 0 { return errors.New("no container provided") diff --git a/mock/docker/system.go b/mock/docker/system.go index 850f10fb..1c2ce41d 100644 --- a/mock/docker/system.go +++ b/mock/docker/system.go @@ -22,7 +22,7 @@ type SystemService struct{} // from the Docker daemon. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.DiskUsage -func (s *SystemService) DiskUsage(ctx context.Context) (types.DiskUsage, error) { +func (s *SystemService) DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error) { return types.DiskUsage{}, nil } diff --git a/mock/docker/volume.go b/mock/docker/volume.go index 952471d6..28273022 100644 --- a/mock/docker/volume.go +++ b/mock/docker/volume.go @@ -14,6 +14,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" "github.com/docker/docker/errdefs" @@ -174,6 +175,14 @@ func (v *VolumeService) VolumesPrune(ctx context.Context, pruneFilter filters.Ar return types.VolumesPruneReport{}, nil } +// VolumeUpdate is a helper function to simulate +// a mocked call to update a Docker volume. +// +// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeUpdate +func (v *VolumeService) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error { + return nil +} + // WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES // // This line serves as a quick and efficient way to ensure that our From 1e90bf14adf37d1ed8f33ce1e94bd8d33f6a1bd0 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 28 Feb 2023 12:00:37 -0600 Subject: [PATCH 379/430] Revert "chore: upgrade to docker v23 and add new mocked funcs (#433)" (#435) This reverts commit 3a4c3a2de192a90b55923087e301a07983cbf4bb. --- go.mod | 2 +- go.sum | 4 ++-- mock/docker/container.go | 4 ++-- mock/docker/system.go | 2 +- mock/docker/volume.go | 9 --------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index c9b46f24..83bc6693 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.0 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v23.0.1+incompatible + github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b diff --git a/go.sum b/go.sum index 9de30a67..9f4a5a12 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= -github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.23+incompatible h1:1ZQUUYAdh+oylOT85aA2ZcfRp22jmLhoaEcVEfK8dyA= +github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= diff --git a/mock/docker/container.go b/mock/docker/container.go index 99a79246..a39cf3f3 100644 --- a/mock/docker/container.go +++ b/mock/docker/container.go @@ -357,7 +357,7 @@ func (c *ContainerService) ContainerResize(ctx context.Context, ctn string, opti // a mocked call to restart a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerRestart -func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, options container.StopOptions) error { +func (c *ContainerService) ContainerRestart(ctx context.Context, ctn string, timeout *time.Duration) error { return nil } @@ -403,7 +403,7 @@ func (c *ContainerService) ContainerStats(ctx context.Context, ctn string, strea // a mocked call to stop a Docker container. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.ContainerStop -func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, options container.StopOptions) error { +func (c *ContainerService) ContainerStop(ctx context.Context, ctn string, timeout *time.Duration) error { // verify a container was provided if len(ctn) == 0 { return errors.New("no container provided") diff --git a/mock/docker/system.go b/mock/docker/system.go index 1c2ce41d..850f10fb 100644 --- a/mock/docker/system.go +++ b/mock/docker/system.go @@ -22,7 +22,7 @@ type SystemService struct{} // from the Docker daemon. // // https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.DiskUsage -func (s *SystemService) DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error) { +func (s *SystemService) DiskUsage(ctx context.Context) (types.DiskUsage, error) { return types.DiskUsage{}, nil } diff --git a/mock/docker/volume.go b/mock/docker/volume.go index 28273022..952471d6 100644 --- a/mock/docker/volume.go +++ b/mock/docker/volume.go @@ -14,7 +14,6 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" "github.com/docker/docker/errdefs" @@ -175,14 +174,6 @@ func (v *VolumeService) VolumesPrune(ctx context.Context, pruneFilter filters.Ar return types.VolumesPruneReport{}, nil } -// VolumeUpdate is a helper function to simulate -// a mocked call to update a Docker volume. -// -// https://pkg.go.dev/github.com/docker/docker/client?tab=doc#Client.VolumeUpdate -func (v *VolumeService) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error { - return nil -} - // WARNING: DO NOT REMOVE THIS UNDER ANY CIRCUMSTANCES // // This line serves as a quick and efficient way to ensure that our From 907d5b6ec476b31797d2f70b5da0e2b2d953fd6a Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 28 Feb 2023 12:29:03 -0700 Subject: [PATCH 380/430] chore(release): v0.18.0-rc1 prep (#436) * chore(release): v0.18.0-rc1 prep * tidy up --- go.mod | 28 ++++++++++++------------- go.sum | 66 +++++++++++++++++++++++++++------------------------------- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/go.mod b/go.mod index 83bc6693..99f22cdb 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b - github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 - github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 + github.com/go-vela/sdk-go v0.18.0-rc1 + github.com/go-vela/server v0.18.0-rc1 + github.com/go-vela/types v0.18.0-rc1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 @@ -32,13 +32,13 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.23.1 // indirect + github.com/alicebob/miniredis/v2 v2.30.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 // indirect github.com/bytedance/sonic v1.8.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -55,13 +55,12 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/goccy/go-json v0.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.4.3 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-github/v44 v44.1.0 // indirect + github.com/google/go-github/v50 v50.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -69,7 +68,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -92,20 +91,21 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect + github.com/redis/go-redis/v9 v9.0.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/afero v1.9.3 // indirect + github.com/spf13/afero v1.9.4 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.9 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect - go.starlark.net v0.0.0-20221205180719-3fd0dac74452 // indirect + go.starlark.net v0.0.0-20230228032650-dded03209ead // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.5.0 // indirect + golang.org/x/crypto v0.6.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.3.0 // indirect + golang.org/x/oauth2 v0.5.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/go.sum b/go.sum index 9f4a5a12..7467571c 100644 --- a/go.sum +++ b/go.sum @@ -60,12 +60,14 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.23.1 h1:jR6wZggBxwWygeXcdNyguCOCIjPsZyNUNlAkTx2fu0U= -github.com/alicebob/miniredis/v2 v2.23.1/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= +github.com/alicebob/miniredis/v2 v2.30.0 h1:uA3uhDbCxfO9+DI/DuGeAMr9qI+noVWwGPNTFuKID5M= +github.com/alicebob/miniredis/v2 v2.30.0/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ= +github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8= github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 h1:qLN32md48xyTEqw6XEZMyNMre7njm0XXvDrea6NVwOM= github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= @@ -73,8 +75,9 @@ github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= @@ -85,8 +88,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -117,8 +120,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -154,22 +155,20 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b h1:N/g4kgUFlb36JZBlhuq3ifJE+DTIJTqO21nGXsf+76A= -github.com/go-vela/sdk-go v0.17.1-0.20230224164256-73b956037d5b/go.mod h1:RurQS+lXlmzv4I/QS/qMI1Rqb36tfA+NubekWVRIwXc= -github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8 h1:CUXtUYOu8Jz9IYuTMXivu4GXr8BdQXLAYjFYnDnkndE= -github.com/go-vela/server v0.17.1-0.20230224163114-c4283eb079e8/go.mod h1:WJZQJ2nwSSDuB56LskZ3gEoSWI0IwKRtxaFE8GdTLIc= -github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425 h1:tdjas7NJLWlU2vmETaU36wjbd+zvWPLtznE4uwtnFlw= -github.com/go-vela/types v0.17.1-0.20230223155025-1c8a34f71425/go.mod h1:6KoRkvXMw9DkAcLdtI7PxPqMlT2Bl0DiigQamLGGjwo= +github.com/go-vela/sdk-go v0.18.0-rc1 h1:YSNY4l5qUqE+9cLzIJ2Dfy1rZVzml8LsVa1k/TvdehI= +github.com/go-vela/sdk-go v0.18.0-rc1/go.mod h1:JRBduEcdVY1I0duwaIGPFK3QPBFxe7REI9mjnvnM8mg= +github.com/go-vela/server v0.18.0-rc1 h1:UiRWd0E/e73uBnPx/ZduahuOcc8hEj1SBwFwIsfoANU= +github.com/go-vela/server v0.18.0-rc1/go.mod h1:X6AhNghg1oEuz3aSsB8aAgBi2x52pSSKh3MAZCJqVqo= +github.com/go-vela/types v0.18.0-rc1 h1:q93g+A/GOP56vmMi8AH1BKtgmqZy3gj5PD66Wqx8ej4= +github.com/go-vela/types v0.18.0-rc1/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= -github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -214,8 +213,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= -github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= +github.com/google/go-github/v50 v50.1.0 h1:hMUpkZjklC5GJ+c3GquSqOP/T4BNsB7XohaPhtMOzRk= +github.com/google/go-github/v50 v50.1.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -247,15 +246,14 @@ github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLc github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= 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= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= @@ -299,7 +297,6 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -325,8 +322,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -368,6 +363,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE= +github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -380,8 +377,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.4 h1:Sd43wM1IWz/s1aVXdOBkjJvuP8UdyqioeE4AmM0QsBs= +github.com/spf13/afero v1.9.4/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -423,8 +420,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20221205180719-3fd0dac74452 h1:JZtNuL6LPB+scU5yaQ6hqRlJFRiddZm2FwRt2AQqtHA= -go.starlark.net v0.0.0-20221205180719-3fd0dac74452/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= +go.starlark.net v0.0.0-20230228032650-dded03209ead h1:qZOFk6/3JiKg5gjRTf4lShf/N0K3acJ95Bg70LsgnHI= +go.starlark.net v0.0.0-20230228032650-dded03209ead/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -437,8 +434,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -524,8 +521,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -775,7 +772,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 76e1147888594efefa00bc1baf0b4a37de714415 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:56:39 -0700 Subject: [PATCH 381/430] chore(release): v0.18.0-rc2 prep (#444) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 99f22cdb..032411b5 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.18.0-rc1 - github.com/go-vela/server v0.18.0-rc1 + github.com/go-vela/sdk-go v0.18.0-rc2 + github.com/go-vela/server v0.18.0-rc2 github.com/go-vela/types v0.18.0-rc1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -20,7 +20,7 @@ require ( golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 + k8s.io/apimachinery v0.26.2 k8s.io/client-go v0.26.1 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 7467571c..849d7f28 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.18.0-rc1 h1:YSNY4l5qUqE+9cLzIJ2Dfy1rZVzml8LsVa1k/TvdehI= -github.com/go-vela/sdk-go v0.18.0-rc1/go.mod h1:JRBduEcdVY1I0duwaIGPFK3QPBFxe7REI9mjnvnM8mg= -github.com/go-vela/server v0.18.0-rc1 h1:UiRWd0E/e73uBnPx/ZduahuOcc8hEj1SBwFwIsfoANU= -github.com/go-vela/server v0.18.0-rc1/go.mod h1:X6AhNghg1oEuz3aSsB8aAgBi2x52pSSKh3MAZCJqVqo= +github.com/go-vela/sdk-go v0.18.0-rc2 h1:LR4Lt/ELT7SAQYv8fjQnfx8MjjtkLVcIGhNvlImqAdM= +github.com/go-vela/sdk-go v0.18.0-rc2/go.mod h1:Z3YFC+6vvghCvEfwlb/PKLW0Tx8BBDz4q4KQ3mYhUK0= +github.com/go-vela/server v0.18.0-rc2 h1:/0GGtSG6q8hdYevLT8XkUijdbwzccGHY/d2jRTxDQug= +github.com/go-vela/server v0.18.0-rc2/go.mod h1:VQpgbboMvXK3vP9Hwr837BA5dNC1SqRpJYgl64Vz5HI= github.com/go-vela/types v0.18.0-rc1 h1:q93g+A/GOP56vmMi8AH1BKtgmqZy3gj5PD66Wqx8ej4= github.com/go-vela/types v0.18.0-rc1/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= @@ -796,8 +796,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/apimachinery v0.26.2 h1:da1u3D5wfR5u2RpLhE/ZtZS2P7QvDgLZTi9wrNZl/tQ= +k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= From 5f542523b5929b1c86fde95ce9a26b8b76f74fb3 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:20:02 -0700 Subject: [PATCH 382/430] chore(release): upgrade server, types, sdk to v0.18.0 (#445) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 032411b5..b826a56c 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.18.0-rc2 - github.com/go-vela/server v0.18.0-rc2 - github.com/go-vela/types v0.18.0-rc1 + github.com/go-vela/sdk-go v0.18.0 + github.com/go-vela/server v0.18.0 + github.com/go-vela/types v0.18.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 849d7f28..3bf59ed2 100644 --- a/go.sum +++ b/go.sum @@ -156,12 +156,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.18.0-rc2 h1:LR4Lt/ELT7SAQYv8fjQnfx8MjjtkLVcIGhNvlImqAdM= -github.com/go-vela/sdk-go v0.18.0-rc2/go.mod h1:Z3YFC+6vvghCvEfwlb/PKLW0Tx8BBDz4q4KQ3mYhUK0= -github.com/go-vela/server v0.18.0-rc2 h1:/0GGtSG6q8hdYevLT8XkUijdbwzccGHY/d2jRTxDQug= -github.com/go-vela/server v0.18.0-rc2/go.mod h1:VQpgbboMvXK3vP9Hwr837BA5dNC1SqRpJYgl64Vz5HI= -github.com/go-vela/types v0.18.0-rc1 h1:q93g+A/GOP56vmMi8AH1BKtgmqZy3gj5PD66Wqx8ej4= -github.com/go-vela/types v0.18.0-rc1/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= +github.com/go-vela/sdk-go v0.18.0 h1:T9REYKvBY2OO//IhFK6RCEQ/2ClHU+7D2W+a0h6tlsA= +github.com/go-vela/sdk-go v0.18.0/go.mod h1:WhuZ2fZhJ+CS8Jyu7CyfRuAWqUawccAfDxn+azkC3Ig= +github.com/go-vela/server v0.18.0 h1:/v3Ja2bCXki3xlZfJVTmFke5ABBKWWDhg4VzdUWskhQ= +github.com/go-vela/server v0.18.0/go.mod h1:U9HOzcEAqDuBCueqoWbskezOQrUNURZhT9pEoQhzGUs= +github.com/go-vela/types v0.18.0 h1:GLKRphkpSZBl9Y62/1FyzZxSEvCLjzrlr0AQ+qhBcQo= +github.com/go-vela/types v0.18.0/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From e54c2f51271d9d933a5fb39fe0cbf8c8749ce63d Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:39:29 -0600 Subject: [PATCH 383/430] chore: v0.18.1 (#446) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b826a56c..9c85d09a 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.18.0 - github.com/go-vela/server v0.18.0 - github.com/go-vela/types v0.18.0 + github.com/go-vela/sdk-go v0.18.1 + github.com/go-vela/server v0.18.1 + github.com/go-vela/types v0.18.1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 diff --git a/go.sum b/go.sum index 3bf59ed2..2f666479 100644 --- a/go.sum +++ b/go.sum @@ -156,12 +156,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.18.0 h1:T9REYKvBY2OO//IhFK6RCEQ/2ClHU+7D2W+a0h6tlsA= -github.com/go-vela/sdk-go v0.18.0/go.mod h1:WhuZ2fZhJ+CS8Jyu7CyfRuAWqUawccAfDxn+azkC3Ig= -github.com/go-vela/server v0.18.0 h1:/v3Ja2bCXki3xlZfJVTmFke5ABBKWWDhg4VzdUWskhQ= -github.com/go-vela/server v0.18.0/go.mod h1:U9HOzcEAqDuBCueqoWbskezOQrUNURZhT9pEoQhzGUs= -github.com/go-vela/types v0.18.0 h1:GLKRphkpSZBl9Y62/1FyzZxSEvCLjzrlr0AQ+qhBcQo= -github.com/go-vela/types v0.18.0/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= +github.com/go-vela/sdk-go v0.18.1 h1:qsm8XWjr9btNDL8c58JC93sstRUybL/TklWgeeft860= +github.com/go-vela/sdk-go v0.18.1/go.mod h1:QmfXBAdJ9prgE78TK13XJI8YjvGZA5hc+h79CbvgYGU= +github.com/go-vela/server v0.18.1 h1:INd+nwLh0c+WA+8diIh4scLkByGBGZHiyVd5doLSolQ= +github.com/go-vela/server v0.18.1/go.mod h1:WyJEXyJYYASfqN9PDuHqlBTbhsSRIzOn1E7tM2phZMA= +github.com/go-vela/types v0.18.1 h1:V/luHLnCEaJhD1m9PZCZicIasg8Op6MCK+utkz+gQiU= +github.com/go-vela/types v0.18.1/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From 2655964b1ec4c3d66cf063d57d0a725f0f2ed5e9 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Wed, 15 Mar 2023 12:07:47 -0500 Subject: [PATCH 384/430] chore(log): remove byte-chunks log method (#447) --- cmd/vela-worker/exec.go | 1 - cmd/vela-worker/run.go | 1 - docker-compose.yml | 1 - executor/executor_test.go | 2 - executor/flags.go | 7 - executor/linux/linux.go | 2 - executor/linux/opts.go | 17 -- executor/linux/opts_test.go | 50 ----- executor/linux/service.go | 178 +++++++----------- executor/linux/step.go | 193 +++++++------------- executor/setup.go | 12 -- executor/setup_test.go | 40 ---- router/middleware/executor/executor_test.go | 2 - 13 files changed, 135 insertions(+), 371 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index f1a9cbc5..62b1b648 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -86,7 +86,6 @@ func (w *Worker) exec(index int) error { Logger: logger, Mock: w.Config.Mock, Driver: w.Config.Executor.Driver, - LogMethod: w.Config.Executor.LogMethod, MaxLogSize: w.Config.Executor.MaxLogSize, LogStreamingTimeout: w.Config.Executor.LogStreamingTimeout, EnforceTrustedRepos: w.Config.Executor.EnforceTrustedRepos, diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 482911e0..222aed07 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -94,7 +94,6 @@ func run(c *cli.Context) error { // executor configuration Executor: &executor.Setup{ Driver: c.String("executor.driver"), - LogMethod: c.String("executor.log_method"), MaxLogSize: c.Uint("executor.max_log_size"), LogStreamingTimeout: c.Duration("executor.log_streaming_timeout"), EnforceTrustedRepos: c.Bool("executor.enforce-trusted-repos"), diff --git a/docker-compose.yml b/docker-compose.yml index 67cad74c..d0758630 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,6 @@ services: - vela environment: EXECUTOR_DRIVER: linux - EXECUTOR_LOG_METHOD: 'time-chunks' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' VELA_BUILD_LIMIT: 1 diff --git a/executor/executor_test.go b/executor/executor_test.go index fa2537ac..082d7946 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -45,7 +45,6 @@ func TestExecutor_New(t *testing.T) { _linux, err := linux.New( linux.WithBuild(_build), linux.WithHostname("localhost"), - linux.WithLogMethod("byte-chunks"), linux.WithMaxLogSize(2097152), linux.WithPipeline(_pipeline), linux.WithRepo(_repo), @@ -103,7 +102,6 @@ func TestExecutor_New(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, diff --git a/executor/flags.go b/executor/flags.go index 63de3dc6..ee31ecd2 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -26,13 +26,6 @@ var Flags = []cli.Flag{ Usage: "driver to be used for the executor", Value: constants.DriverLinux, }, - &cli.StringFlag{ - EnvVars: []string{"VELA_EXECUTOR_LOG_METHOD", "EXECUTOR_LOG_METHOD"}, - FilePath: "/vela/executor/log_method", - Name: "executor.log_method", - Usage: "method used to publish logs to the server - options: (byte-chunks|time-chunks)", - Value: "byte-chunks", - }, &cli.UintFlag{ EnvVars: []string{"VELA_EXECUTOR_MAX_LOG_SIZE", "EXECUTOR_MAX_LOG_SIZE"}, FilePath: "/vela/executor/max_log_size", diff --git a/executor/linux/linux.go b/executor/linux/linux.go index c3df35c8..6c9bf921 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -33,7 +33,6 @@ type ( // private fields init *pipeline.Container - logMethod string maxLogSize uint logStreamingTimeout time.Duration privilegedImages []string @@ -72,7 +71,6 @@ func Equal(a, b *client) bool { a.Hostname == b.Hostname && a.Version == b.Version && reflect.DeepEqual(a.init, b.init) && - a.logMethod == b.logMethod && a.maxLogSize == b.maxLogSize && reflect.DeepEqual(a.privilegedImages, b.privilegedImages) && a.enforceTrustedRepos == b.enforceTrustedRepos && diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 1b143152..2365d9e5 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -36,23 +36,6 @@ func WithBuild(b *library.Build) Opt { } } -// WithLogMethod sets the method used to publish logs in the executor client for Linux. -func WithLogMethod(method string) Opt { - return func(c *client) error { - c.Logger.Trace("configuring log streaming method in linux executor client") - - // check if a method is provided - if len(method) == 0 { - return fmt.Errorf("empty log method provided") - } - - // set the log method in the client - c.logMethod = method - - return nil - } -} - // WithMaxLogSize sets the maximum log size (in bytes) in the executor client for Linux. func WithMaxLogSize(size uint) Opt { return func(c *client) error { diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 2a2af2d5..d2b30c56 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -69,56 +69,6 @@ func TestLinux_Opt_WithBuild(t *testing.T) { } } -func TestLinux_Opt_WithLogMethod(t *testing.T) { - // setup tests - tests := []struct { - name string - failure bool - logMethod string - }{ - { - name: "byte-chunks", - failure: false, - logMethod: "byte-chunks", - }, - { - name: "time-chunks", - failure: false, - logMethod: "time-chunks", - }, - { - name: "empty", - failure: true, - logMethod: "", - }, - } - - // run tests - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - _engine, err := New( - WithLogMethod(test.logMethod), - ) - - if test.failure { - if err == nil { - t.Errorf("WithLogMethod should have returned err") - } - - return // continue to next test - } - - if err != nil { - t.Errorf("WithLogMethod returned err: %v", err) - } - - if !reflect.DeepEqual(_engine.logMethod, test.logMethod) { - t.Errorf("WithLogMethod is %v, want %v", _engine.logMethod, test.logMethod) - } - }) - } -} - func TestLinux_Opt_WithMaxLogSize(t *testing.T) { // setup tests tests := []struct { diff --git a/executor/linux/service.go b/executor/linux/service.go index a79cd2ea..f340b10e 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -224,130 +224,82 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // create new buffer for uploading logs logs := new(bytes.Buffer) - switch c.logMethod { - case "time-chunks": - // create new channel for processing logs - done := make(chan bool) - - go func() { - logger.Debug("polling logs for container") - - // spawn "infinite" loop that will upload logs - // from the buffer until the channel is closed - for { - // sleep for "1s" before attempting to upload logs - time.Sleep(1 * time.Second) - - // create a non-blocking select to check if the channel is closed - select { - // after repo timeout of idle (no response) end the stream - // - // this is a safety mechanism - case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): - logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) - - return - // channel is closed - case <-done: - logger.Trace("channel closed for polling container logs") - - // return out of the go routine - return - // channel is not closed - default: - // update the existing log with the new bytes if there is new data to add - if len(logs.Bytes()) > 0 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) - - logger.Debug("appending logs") - // send API call to append the logs for the service - // - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService - _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) - if err != nil { - logger.Error(err) - } - - // flush the buffer of logs - logs.Reset() + // create new channel for processing logs + done := make(chan bool) + + go func() { + logger.Debug("polling logs for container") + + // spawn "infinite" loop that will upload logs + // from the buffer until the channel is closed + for { + // sleep for "1s" before attempting to upload logs + time.Sleep(1 * time.Second) + + // create a non-blocking select to check if the channel is closed + select { + // after repo timeout of idle (no response) end the stream + // + // this is a safety mechanism + case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): + logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) + + return + // channel is closed + case <-done: + logger.Trace("channel closed for polling container logs") + + // return out of the go routine + return + // channel is not closed + default: + // update the existing log with the new bytes if there is new data to add + if len(logs.Bytes()) > 0 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + logger.Debug("appending logs") + // send API call to append the logs for the service + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService + _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Error(err) } - // check whether we've reached the maximum log size - if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { - logger.Trace("maximum log size reached") - - return - } + // flush the buffer of logs + logs.Reset() } - } - }() - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - } + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") - logger.Info("finished streaming logs") - - // close channel to stop processing logs - close(done) - - return scanner.Err() - case "byte-chunks": - fallthrough - default: - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) - - logger.Debug("appending logs") - // send API call to append the logs for the service - // - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService - //nolint:contextcheck // ignore passing context - _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) - if err != nil { - return err + return } - - // flush the buffer of logs - logs.Reset() - } - - // check whether we've reached the maximum log size - if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { - logger.Trace("maximum log size reached") - - break } } + }() - logger.Info("finished streaming logs") + // create new scanner from the container output + scanner := bufio.NewScanner(rc) - return scanner.Err() + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) } + + logger.Info("finished streaming logs") + + // close channel to stop processing logs + close(done) + + return scanner.Err() } // DestroyService cleans up services after execution. diff --git a/executor/linux/step.go b/executor/linux/step.go index 70d5d64d..107c56ce 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -267,140 +267,87 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // create new buffer for uploading logs logs := new(bytes.Buffer) - switch c.logMethod { - case "time-chunks": - // create new channel for processing logs - done := make(chan bool) - - go func() { - logger.Debug("polling logs for container") - - // spawn "infinite" loop that will upload logs - // from the buffer until the channel is closed - for { - // sleep for "1s" before attempting to upload logs - time.Sleep(1 * time.Second) - - // create a non-blocking select to check if the channel is closed - select { - // after repo timeout of idle (no response) end the stream - // - // this is a safety mechanism - case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): - logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) - - return - // channel is closed - case <-done: - logger.Trace("channel closed for polling container logs") - - // return out of the go routine - return - // channel is not closed - default: - // update the existing log with the new bytes if there is new data to add - if len(logs.Bytes()) > 0 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) - - // mask secrets within the logs before updating database - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData - _log.MaskData(secretValues) - - logger.Debug("appending logs") - // send API call to append the logs for the step - // - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep - _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) - if err != nil { - logger.Error(err) - } - - // flush the buffer of logs - logs.Reset() + // create new channel for processing logs + done := make(chan bool) + + go func() { + logger.Debug("polling logs for container") + + // spawn "infinite" loop that will upload logs + // from the buffer until the channel is closed + for { + // sleep for "1s" before attempting to upload logs + time.Sleep(1 * time.Second) + + // create a non-blocking select to check if the channel is closed + select { + // after repo timeout of idle (no response) end the stream + // + // this is a safety mechanism + case <-time.After(time.Duration(c.repo.GetTimeout()) * time.Minute): + logger.Tracef("repo timeout of %d exceeded", c.repo.GetTimeout()) + + return + // channel is closed + case <-done: + logger.Trace("channel closed for polling container logs") + + // return out of the go routine + return + // channel is not closed + default: + // update the existing log with the new bytes if there is new data to add + if len(logs.Bytes()) > 0 { + logger.Trace(logs.String()) + + // update the existing log with the new bytes + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData + _log.AppendData(logs.Bytes()) + + // mask secrets within the logs before updating database + // + // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData + _log.MaskData(secretValues) + + logger.Debug("appending logs") + // send API call to append the logs for the step + // + // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep + _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + if err != nil { + logger.Error(err) } - // check whether we've reached the maximum log size - if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { - logger.Trace("maximum log size reached") - - return - } + // flush the buffer of logs + logs.Reset() } - } - }() - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - } + // check whether we've reached the maximum log size + if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { + logger.Trace("maximum log size reached") - logger.Info("finished streaming logs") - - // close channel to stop processing logs - close(done) - - return scanner.Err() - case "byte-chunks": - fallthrough - default: - // create new scanner from the container output - scanner := bufio.NewScanner(rc) - - // scan entire container output - for scanner.Scan() { - // write all the logs from the scanner - logs.Write(append(scanner.Bytes(), []byte("\n")...)) - - // if we have at least 1000 bytes in our buffer - if logs.Len() > 1000 { - logger.Trace(logs.String()) - - // update the existing log with the new bytes - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.AppendData - _log.AppendData(logs.Bytes()) - - // mask secrets within the logs before updating database - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Log.MaskData - _log.MaskData(secretValues) - - logger.Debug("appending logs") - // send API call to append the logs for the step - // - // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep - //nolint:contextcheck // ignore passing context - _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) - if err != nil { - return err + return } - - // flush the buffer of logs - logs.Reset() - } - - // check whether we've reached the maximum log size - if c.maxLogSize > 0 && uint(len(_log.GetData())) >= c.maxLogSize { - logger.Trace("maximum log size reached") - - break } } + }() - logger.Info("finished streaming logs") + // create new scanner from the container output + scanner := bufio.NewScanner(rc) - return scanner.Err() + // scan entire container output + for scanner.Scan() { + // write all the logs from the scanner + logs.Write(append(scanner.Bytes(), []byte("\n")...)) } + + logger.Info("finished streaming logs") + + // close channel to stop processing logs + close(done) + + return scanner.Err() } // DestroyStep cleans up steps after execution. diff --git a/executor/setup.go b/executor/setup.go index 333a83d6..32446334 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -37,8 +37,6 @@ type Setup struct { // specifies the executor driver to use Driver string - // specifies the executor method used to publish logs - LogMethod string // specifies the maximum log size MaxLogSize uint // specifies how long to wait after the build finishes @@ -87,7 +85,6 @@ func (s *Setup) Linux() (Engine, error) { // https://pkg.go.dev/github.com/go-vela/worker/executor/linux?tab=doc#New return linux.New( linux.WithBuild(s.Build), - linux.WithLogMethod(s.LogMethod), linux.WithMaxLogSize(s.MaxLogSize), linux.WithLogStreamingTimeout(s.LogStreamingTimeout), linux.WithPrivilegedImages(s.PrivilegedImages), @@ -159,15 +156,6 @@ func (s *Setup) Validate() error { return nil } - // handle the executor log method provided - switch s.LogMethod { - case "byte-chunks", "time-chunks": - case "": - return fmt.Errorf("empty executor log method provided in setup") - default: - return fmt.Errorf("invalid executor log method provided in setup: %s", s.LogMethod) - } - // check if a Vela client was provided if s.Client == nil { return fmt.Errorf("no Vela client provided in setup") diff --git a/executor/setup_test.go b/executor/setup_test.go index 615b9ccd..638bf90c 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -78,7 +78,6 @@ func TestExecutor_Setup_Linux(t *testing.T) { want, err := linux.New( linux.WithBuild(_build), - linux.WithLogMethod("byte-chunks"), linux.WithMaxLogSize(2097152), linux.WithLogStreamingTimeout(1*time.Second), linux.WithHostname("localhost"), @@ -97,7 +96,6 @@ func TestExecutor_Setup_Linux(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Hostname: "localhost", Pipeline: _pipeline, @@ -239,7 +237,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -254,7 +251,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: nil, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -269,7 +265,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: nil, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -284,7 +279,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: "", - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -299,7 +293,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: nil, Repo: _repo, @@ -314,7 +307,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: nil, @@ -329,7 +321,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -344,7 +335,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { Build: _build, Client: _client, Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Pipeline: _pipeline, Repo: _repo, @@ -353,36 +343,6 @@ func TestExecutor_Setup_Validate(t *testing.T) { }, failure: true, }, - { - name: "empty log-method", - setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "", - MaxLogSize: 2097152, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - }, - failure: true, - }, - { - name: "invalid log-method", - setup: &Setup{ - Build: _build, - Client: _client, - Driver: constants.DriverLinux, - LogMethod: "foobar", - MaxLogSize: 2097152, - Pipeline: _pipeline, - Repo: _repo, - Runtime: _runtime, - User: _user, - }, - failure: true, - }, } // run tests diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index fde97dbb..6b3af032 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -31,7 +31,6 @@ func TestExecutor_Retrieve(t *testing.T) { want, err := executor.New(&executor.Setup{ Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Client: new(vela.Client), Runtime: _runtime, @@ -67,7 +66,6 @@ func TestExecutor_Establish(t *testing.T) { want, err := executor.New(&executor.Setup{ Driver: constants.DriverLinux, - LogMethod: "byte-chunks", MaxLogSize: 2097152, Client: new(vela.Client), Runtime: _runtime, From 82a649e7b6ec552c66882ee633b8b6e15db064fa Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 15 Mar 2023 14:08:08 -0500 Subject: [PATCH 385/430] enhance(executor tests): Add kubernetes runtime test cases for Build tests (#438) * test(executor): add kubernetes runtime to CreateBuild test * test: Use kubernetes runtime in executor build tests The kubernetes Mock does not support some of the failure modes simulated by the docker Mock. So, those test cases are commented out with a FIXME. * cleanup commented blocks * test(executor): add remaining StreamBuild k8s test cases --------- Co-authored-by: JordanBrockopp Co-authored-by: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Co-authored-by: David May <1301201+wass3r@users.noreply.github.com> --- executor/linux/build_test.go | 467 +++++++++++++++++++++++++++++++++++ 1 file changed, 467 insertions(+) diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index c1297a4a..2bc35cca 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -69,6 +69,14 @@ func TestLinux_CreateBuild(t *testing.T) { build: _build, pipeline: "testdata/build/secrets/basic.yml", }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + build: _build, + pipeline: "testdata/build/secrets/basic.yml", + }, { name: "docker-basic services pipeline", failure: false, @@ -77,6 +85,14 @@ func TestLinux_CreateBuild(t *testing.T) { build: _build, pipeline: "testdata/build/services/basic.yml", }, + { + name: "kubernetes-basic services pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + build: _build, + pipeline: "testdata/build/services/basic.yml", + }, { name: "docker-basic steps pipeline", failure: false, @@ -85,6 +101,14 @@ func TestLinux_CreateBuild(t *testing.T) { build: _build, pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + build: _build, + pipeline: "testdata/build/steps/basic.yml", + }, { name: "docker-basic stages pipeline", failure: false, @@ -93,6 +117,14 @@ func TestLinux_CreateBuild(t *testing.T) { build: _build, pipeline: "testdata/build/stages/basic.yml", }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + build: _build, + pipeline: "testdata/build/stages/basic.yml", + }, { name: "docker-steps pipeline with empty build", failure: true, @@ -101,6 +133,14 @@ func TestLinux_CreateBuild(t *testing.T) { build: new(library.Build), pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-steps pipeline with empty build", + failure: true, + logError: false, + runtime: constants.DriverKubernetes, + build: new(library.Build), + pipeline: "testdata/build/steps/basic.yml", + }, } // run test @@ -1052,6 +1092,13 @@ func TestLinux_PlanBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/secrets/basic.yml", + }, { name: "docker-basic services pipeline", failure: false, @@ -1059,6 +1106,13 @@ func TestLinux_PlanBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, + { + name: "kubernetes-basic services pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + }, { name: "docker-basic steps pipeline", failure: false, @@ -1066,6 +1120,13 @@ func TestLinux_PlanBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + }, { name: "docker-basic stages pipeline", failure: false, @@ -1073,6 +1134,13 @@ func TestLinux_PlanBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/stages/basic.yml", + }, } // run test @@ -1202,6 +1270,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/secrets/basic.yml", + }, { name: "docker-secrets pipeline with image not found", failure: true, @@ -1209,6 +1284,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_notfound.yml", }, + //{ + // name: "kubernetes-secrets pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/secrets/img_notfound.yml", + //}, { name: "docker-secrets pipeline with ignoring image not found", failure: true, @@ -1216,6 +1298,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/img_ignorenotfound.yml", }, + //{ + // name: "kubernetes-secrets pipeline with ignoring image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/secrets/img_ignorenotfound.yml", + //}, { name: "docker-basic services pipeline", failure: false, @@ -1223,6 +1312,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, + { + name: "kubernetes-basic services pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + }, { name: "docker-services pipeline with image not found", failure: true, @@ -1230,6 +1326,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, + //{ + // name: "kubernetes-services pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/services/img_notfound.yml", + //}, { name: "docker-services pipeline with ignoring image not found", failure: true, @@ -1237,6 +1340,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_ignorenotfound.yml", }, + //{ + // name: "kubernetes-services pipeline with ignoring image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/services/img_ignorenotfound.yml", + //}, { name: "docker-basic steps pipeline", failure: false, @@ -1244,6 +1354,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + }, { name: "docker-steps pipeline with image not found", failure: true, @@ -1251,6 +1368,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, + //{ + // name: "kubernetes-steps pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/steps/img_notfound.yml", + //}, { name: "docker-steps pipeline with ignoring image not found", failure: true, @@ -1258,6 +1382,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_ignorenotfound.yml", }, + //{ + // name: "kubernetes-steps pipeline with ignoring image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/steps/img_ignorenotfound.yml", + //}, { name: "docker-basic stages pipeline", failure: false, @@ -1265,6 +1396,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/stages/basic.yml", + }, { name: "docker-stages pipeline with image not found", failure: true, @@ -1272,6 +1410,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, + //{ + // name: "kubernetes-stages pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/stages/img_notfound.yml", + //}, { name: "docker-stages pipeline with ignoring image not found", failure: true, @@ -1279,6 +1424,13 @@ func TestLinux_AssembleBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_ignorenotfound.yml", }, + //{ + // name: "kubernetes-stages pipeline with ignoring image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/stages/img_ignorenotfound.yml", + //}, } // run test @@ -1429,6 +1581,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, + { + name: "kubernetes-basic services pipeline", + failure: false, // fixed + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + }, { name: "docker-services pipeline with image not found", failure: true, @@ -1436,6 +1595,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/img_notfound.yml", }, + //{ + // name: "kubernetes-services pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/services/img_notfound.yml", + //}, { name: "docker-basic steps pipeline", failure: false, @@ -1443,6 +1609,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + }, { name: "docker-steps pipeline with image not found", failure: true, @@ -1450,6 +1623,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/img_notfound.yml", }, + //{ + // name: "kubernetes-steps pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/steps/img_notfound.yml", + //}, { name: "docker-basic stages pipeline", failure: false, @@ -1457,6 +1637,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/stages/basic.yml", + }, { name: "docker-stages pipeline with image not found", failure: true, @@ -1464,6 +1651,13 @@ func TestLinux_ExecBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/img_notfound.yml", }, + //{ + // name: "kubernetes-stages pipeline with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/stages/img_notfound.yml", + //}, } // run test @@ -1701,6 +1895,31 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic services pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + return c.PlanService + }, + ctn: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-basic services pipeline with StreamService failure", failure: false, @@ -1727,6 +1946,32 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic services pipeline with StreamService failure", + failure: false, + logError: true, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + messageKey: "service", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamService + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanService + return planNothing + }, + ctn: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:latest", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-basic steps pipeline", failure: false, @@ -1750,6 +1995,29 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic steps pipeline with StreamStep failure", failure: false, @@ -1774,6 +2042,30 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic steps pipeline with StreamStep failure", + failure: false, + logError: true, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + // simulate failure to call PlanStep + return planNothing + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic stages pipeline", failure: false, @@ -1797,6 +2089,29 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/stages/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic secrets pipeline", failure: false, @@ -1821,6 +2136,30 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/secrets/basic.yml", + messageKey: "secret", + streamFunc: func(c *client) message.StreamFunc { + return c.secret.stream + }, + planFunc: func(c *client) planFuncType { + // no plan function equivalent for secret containers + return planNothing + }, + ctn: &pipeline.Container{ + ID: "secret-github-octocat-1-vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-early exit from ExecBuild", failure: false, @@ -1845,6 +2184,30 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-early exit from ExecBuild", + failure: false, + earlyExecExit: true, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-build complete before ExecBuild called", failure: false, @@ -1869,6 +2232,30 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-build complete before ExecBuild called", + failure: false, + earlyBuildDone: true, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-early exit from ExecBuild and build complete signaled", failure: false, @@ -1893,6 +2280,30 @@ func TestLinux_StreamBuild(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-early exit from ExecBuild and build complete signaled", + failure: false, + earlyExecExit: true, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + messageKey: "step", + streamFunc: func(c *client) message.StreamFunc { + return c.StreamStep + }, + planFunc: func(c *client) planFuncType { + return c.PlanStep + }, + ctn: &pipeline.Container{ + ID: "step-github-octocat-1-test", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "test", + Number: 1, + Pull: "not_present", + }, + }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { @@ -2072,6 +2483,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/secrets/basic.yml", + }, { name: "docker-secrets pipeline with name not found", failure: false, @@ -2079,6 +2497,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/name_notfound.yml", }, + //{ + // name: "kubernetes-secrets pipeline with name not found", + // failure: false, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/secrets/name_notfound.yml", + //}, { name: "docker-basic services pipeline", failure: false, @@ -2086,6 +2511,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/basic.yml", }, + { + name: "kubernetes-basic services pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/services/basic.yml", + }, { name: "docker-services pipeline with name not found", failure: false, @@ -2093,6 +2525,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/services/name_notfound.yml", }, + //{ + // name: "kubernetes-services pipeline with name not found", + // failure: false, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/services/name_notfound.yml", + //}, { name: "docker-basic steps pipeline", failure: false, @@ -2100,6 +2539,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/basic.yml", }, + { + name: "kubernetes-basic steps pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/steps/basic.yml", + }, { name: "docker-steps pipeline with name not found", failure: false, @@ -2107,6 +2553,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/steps/name_notfound.yml", }, + //{ + // name: "kubernetes-steps pipeline with name not found", + // failure: false, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/steps/name_notfound.yml", + //}, { name: "docker-basic stages pipeline", failure: false, @@ -2114,6 +2567,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/basic.yml", }, + { + name: "kubernetes-basic stages pipeline", + failure: false, + logError: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/stages/basic.yml", + }, { name: "docker-stages pipeline with name not found", failure: false, @@ -2121,6 +2581,13 @@ func TestLinux_DestroyBuild(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/stages/name_notfound.yml", }, + //{ + // name: "kubernetes-stages pipeline with name not found", + // failure: false, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // logError: false, + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/stages/name_notfound.yml", + //}, } // run test From b991a6e951e6d6b3a08f110809ed8f951ed4c0b2 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 15 Mar 2023 16:04:28 -0500 Subject: [PATCH 386/430] enhance(executor tests): Add kubernetes runtime test cases for Opts and Secrets tests (#439) --- executor/linux/opts_test.go | 11 ++ executor/linux/secret_test.go | 272 ++++++++++++++++++++++++++++++++++ 2 files changed, 283 insertions(+) diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index d2b30c56..a16be68c 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -18,6 +18,7 @@ import ( "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" "github.com/sirupsen/logrus" ) @@ -432,6 +433,11 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -443,6 +449,11 @@ func TestLinux_Opt_WithRuntime(t *testing.T) { failure: false, runtime: _docker, }, + { + name: "kubernetes runtime", + failure: false, + runtime: _kubernetes, + }, { name: "nil runtime", failure: true, diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 0043872c..e88d23b2 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -47,6 +47,11 @@ func TestLinux_Secret_create(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -68,6 +73,20 @@ func TestLinux_Secret_create(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-good image tag", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "secret-github-octocat-1-vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-notfound image tag", failure: true, @@ -82,6 +101,20 @@ func TestLinux_Secret_create(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-notfound image tag", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "secret-github-octocat-1-vault", + // Directory: "/vela/src/vcs.company.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "target/secret-vault:notfound", + // Name: "vault", + // Number: 1, + // Pull: "not_present", + // }, + //}, } // run tests @@ -122,6 +155,7 @@ func TestLinux_Secret_delete(t *testing.T) { _repo := testRepo() _user := testUser() _dockerSteps := testSteps(constants.DriverDocker) + _kubernetesSteps := testSteps(constants.DriverKubernetes) gin.SetMode(gin.TestMode) @@ -137,6 +171,11 @@ func TestLinux_Secret_delete(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + _step := new(library.Step) _step.SetName("clone") _step.SetNumber(2) @@ -167,6 +206,22 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), steps: _dockerSteps, }, + { + name: "kubernetes-running container-empty step", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "secret-github-octocat-1-vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 1, + Pull: "always", + }, + step: new(library.Step), + steps: _kubernetesSteps, + }, { name: "docker-running container-pending step", failure: false, @@ -183,6 +238,22 @@ func TestLinux_Secret_delete(t *testing.T) { step: _step, steps: _dockerSteps, }, + { + name: "kubernetes-running container-pending step", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "secret-github-octocat-1-vault", + Directory: "/vela/src/vcs.company.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "target/secret-vault:latest", + Name: "vault", + Number: 2, + Pull: "always", + }, + step: _step, + steps: _kubernetesSteps, + }, { name: "docker-inspecting container failure due to invalid container id", failure: true, @@ -199,6 +270,22 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), steps: _dockerSteps, }, + //{ + // name: "kubernetes-inspecting container failure due to invalid container id", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "secret-github-octocat-1-notfound", + // Directory: "/vela/src/vcs.company.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "target/secret-vault:latest", + // Name: "notfound", + // Number: 2, + // Pull: "always", + // }, + // step: new(library.Step), + // steps: _kubernetesSteps, + //}, { name: "docker-removing container failure", failure: true, @@ -215,6 +302,22 @@ func TestLinux_Secret_delete(t *testing.T) { step: new(library.Step), steps: _dockerSteps, }, + //{ + // name: "kubernetes-removing container failure", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "secret-github-octocat-1-ignorenotfound", + // Directory: "/vela/src/vcs.company.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "target/secret-vault:latest", + // Name: "ignorenotfound", + // Number: 2, + // Pull: "always", + // }, + // step: new(library.Step), + // steps: _kubernetesSteps, + //}, } // run tests @@ -298,12 +401,24 @@ func TestLinux_Secret_exec(t *testing.T) { runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/basic.yml", }, + { + name: "kubernetes-basic secrets pipeline", + failure: false, + runtime: constants.DriverKubernetes, + pipeline: "testdata/build/secrets/basic.yml", + }, { name: "docker-pipeline with secret name not found", failure: true, runtime: constants.DriverDocker, pipeline: "testdata/build/secrets/name_notfound.yml", }, + //{ + // name: "kubernetes-pipeline with secret name not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: constants.DriverKubernetes, + // pipeline: "testdata/build/secrets/name_notfound.yml", + //}, } // run tests @@ -406,6 +521,11 @@ func TestLinux_Secret_pull(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -426,6 +546,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-success with org secret", + failure: false, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with invalid org secret", failure: true, @@ -439,6 +572,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with invalid org secret", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "foo/foo/foo", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with org secret key not found", failure: true, @@ -452,6 +598,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with org secret key not found", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "org", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-success with repo secret", failure: false, @@ -465,6 +624,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-success with repo secret", + failure: false, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octocat/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with invalid repo secret", failure: true, @@ -478,6 +650,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with invalid repo secret", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "foo/foo/foo/foo", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with repo secret key not found", failure: true, @@ -491,6 +676,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with repo secret key not found", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "repo", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-success with shared secret", failure: false, @@ -504,6 +702,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-success with shared secret", + failure: false, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octokitties/foo", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with shared secret key not found", failure: true, @@ -517,6 +728,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with shared secret key not found", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "not-found", + Engine: "native", + Type: "shared", + Origin: &pipeline.Container{}, + }, + }, { name: "docker-failure with invalid type", failure: true, @@ -530,6 +754,19 @@ func TestLinux_Secret_pull(t *testing.T) { Origin: &pipeline.Container{}, }, }, + { + name: "kubernetes-failure with invalid type", + failure: true, + runtime: _kubernetes, + secret: &pipeline.Secret{ + Name: "foo", + Value: "bar", + Key: "github/octokitties/foo", + Engine: "native", + Type: "invalid", + Origin: &pipeline.Container{}, + }, + }, } // run tests @@ -585,6 +822,11 @@ func TestLinux_Secret_stream(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -608,6 +850,21 @@ func TestLinux_Secret_stream(t *testing.T) { Pull: "always", }, }, + { + name: "kubernetes-container step succeeds", + failure: false, + runtime: _kubernetes, + logs: new(library.Log), + container: &pipeline.Container{ + ID: "step-github-octocat-1-init", + Directory: "/home/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "always", + }, + }, { name: "docker-container step fails because of invalid container id", failure: true, @@ -623,6 +880,21 @@ func TestLinux_Secret_stream(t *testing.T) { Pull: "always", }, }, + //{ + // name: "kubernetes-container step fails because of invalid container id", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // logs: new(library.Log), + // container: &pipeline.Container{ + // ID: "secret-github-octocat-1-notfound", + // Directory: "/vela/src/vcs.company.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "target/secret-vault:latest", + // Name: "notfound", + // Number: 2, + // Pull: "always", + // }, + //}, } // run tests From 7e8893b60397657d95c192142cb5ae153f431cb8 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 15 Mar 2023 16:48:27 -0500 Subject: [PATCH 387/430] enhance(executor tests): Add kubernetes runtime test cases for Step tests (#440) --- executor/linux/step_test.go | 267 ++++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 60ad4b6b..447cbf29 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -19,6 +19,7 @@ import ( "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" ) func TestLinux_CreateStep(t *testing.T) { @@ -41,6 +42,11 @@ func TestLinux_CreateStep(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -62,6 +68,20 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-init step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic step container", failure: false, @@ -76,6 +96,20 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-step container with image not found", failure: true, @@ -90,12 +124,32 @@ func TestLinux_CreateStep(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-step container with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "step-github-octocat-1-echo", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:notfound", + // Name: "echo", + // Number: 1, + // Pull: "not_present", + // }, + //}, { name: "docker-empty step container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty step container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -150,6 +204,11 @@ func TestLinux_PlanStep(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -171,6 +230,20 @@ func TestLinux_PlanStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-step container with nil environment", failure: true, @@ -185,12 +258,32 @@ func TestLinux_PlanStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-step container with nil environment", + failure: true, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: nil, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-empty step container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty step container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -245,6 +338,13 @@ func TestLinux_ExecStep(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + + _kubernetes.PodTracker.Start(context.Background()) + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() @@ -269,6 +369,20 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-init step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic step container", failure: false, @@ -283,6 +397,20 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-detached step container", failure: false, @@ -298,6 +426,21 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-detached step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-step container with image not found", failure: true, @@ -312,12 +455,32 @@ func TestLinux_ExecStep(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-step container with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "step-github-octocat-1-echo", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:notfound", + // Name: "echo", + // Number: 1, + // Pull: "not_present", + // }, + //}, { name: "docker-empty step container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty step container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -382,6 +545,11 @@ func TestLinux_StreamStep(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -405,6 +573,21 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-init step container", + failure: false, + runtime: _kubernetes, + logs: _logs, + container: &pipeline.Container{ + ID: "step-github-octocat-1-init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic step container", failure: false, @@ -420,6 +603,21 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic step container", + failure: false, + runtime: _kubernetes, + logs: _logs, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-step container with name not found", failure: true, @@ -435,6 +633,21 @@ func TestLinux_StreamStep(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-step container with name not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // logs: _logs, + // container: &pipeline.Container{ + // ID: "step-github-octocat-1-notfound", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:latest", + // Name: "notfound", + // Number: 1, + // Pull: "not_present", + // }, + //}, { name: "docker-empty step container", failure: true, @@ -442,6 +655,13 @@ func TestLinux_StreamStep(t *testing.T) { logs: _logs, container: new(pipeline.Container), }, + { + name: "kubernetes-empty step container", + failure: true, + runtime: _kubernetes, + logs: _logs, + container: new(pipeline.Container), + }, } // run tests @@ -502,6 +722,11 @@ func TestLinux_DestroyStep(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -523,6 +748,20 @@ func TestLinux_DestroyStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-init step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-init", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "#init", + Name: "init", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-basic step container", failure: false, @@ -537,6 +776,20 @@ func TestLinux_DestroyStep(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic step container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "step-github-octocat-1-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, { name: "docker-step container with ignoring name not found", failure: true, @@ -551,6 +804,20 @@ func TestLinux_DestroyStep(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-step container with ignoring name not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "step-github-octocat-1-ignorenotfound", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:latest", + // Name: "ignorenotfound", + // Number: 1, + // Pull: "not_present", + // }, + //}, } // run tests From 345edf7876def5f83ea21124eafec1f099de902e Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 20 Mar 2023 13:41:04 -0500 Subject: [PATCH 388/430] enhance(executor tests): Add kubernetes runtime test cases for Stage tests (#441) --- executor/linux/stage_test.go | 219 +++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index c70b94ce..3bd2e684 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -20,6 +20,7 @@ import ( "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" "github.com/urfave/cli/v2" ) @@ -60,6 +61,11 @@ func TestLinux_CreateStage(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(true)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -86,6 +92,25 @@ func TestLinux_CreateStage(t *testing.T) { }, }, }, + { + name: "kubernetes-basic stage", + failure: false, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, { name: "docker-stage with step container with image not found", failure: true, @@ -105,12 +130,37 @@ func TestLinux_CreateStage(t *testing.T) { }, }, }, + //{ + // name: "kubernetes-stage with step container with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // stage: &pipeline.Stage{ + // Name: "echo", + // Steps: pipeline.ContainerSlice{ + // { + // ID: "github-octocat-1-echo-echo", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:notfound", + // Name: "echo", + // Number: 1, + // Pull: "not_present", + // }, + // }, + // }, + //}, { name: "docker-empty stage", failure: true, runtime: _docker, stage: new(pipeline.Stage), }, + { + name: "kubernetes-empty stage", + failure: true, + runtime: _kubernetes, + stage: new(pipeline.Stage), + }, } // run tests @@ -173,6 +223,11 @@ func TestLinux_PlanStage(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(true)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + dockerTestMap := new(sync.Map) dockerTestMap.Store("foo", make(chan error, 1)) @@ -180,6 +235,13 @@ func TestLinux_PlanStage(t *testing.T) { dtm.(chan error) <- nil close(dtm.(chan error)) + kubernetesTestMap := new(sync.Map) + kubernetesTestMap.Store("foo", make(chan error, 1)) + + ktm, _ := kubernetesTestMap.Load("foo") + ktm.(chan error) <- nil + close(ktm.(chan error)) + dockerErrMap := new(sync.Map) dockerErrMap.Store("foo", make(chan error, 1)) @@ -187,6 +249,13 @@ func TestLinux_PlanStage(t *testing.T) { dem.(chan error) <- errors.New("bar") close(dem.(chan error)) + kubernetesErrMap := new(sync.Map) + kubernetesErrMap.Store("foo", make(chan error, 1)) + + kem, _ := kubernetesErrMap.Load("foo") + kem.(chan error) <- errors.New("bar") + close(kem.(chan error)) + // setup tests tests := []struct { name string @@ -215,6 +284,26 @@ func TestLinux_PlanStage(t *testing.T) { }, stageMap: new(sync.Map), }, + { + name: "kubernetes-basic stage", + failure: false, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: new(sync.Map), + }, { name: "docker-basic stage with nil stage map", failure: false, @@ -236,6 +325,27 @@ func TestLinux_PlanStage(t *testing.T) { }, stageMap: dockerTestMap, }, + { + name: "kubernetes-basic stage with nil stage map", + failure: false, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: kubernetesTestMap, + }, { name: "docker-basic stage with error stage map", failure: true, @@ -257,6 +367,27 @@ func TestLinux_PlanStage(t *testing.T) { }, stageMap: dockerErrMap, }, + { + name: "kubernetes-basic stage with error stage map", + failure: true, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Needs: []string{"foo"}, + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + stageMap: kubernetesErrMap, + }, } // run tests @@ -311,6 +442,13 @@ func TestLinux_ExecStage(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(true)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + + _kubernetes.PodTracker.Start(context.Background()) + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() @@ -341,6 +479,25 @@ func TestLinux_ExecStage(t *testing.T) { }, }, }, + { + name: "kubernetes-basic stage", + failure: false, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, { name: "docker-stage with step container with image not found", failure: true, @@ -361,6 +518,25 @@ func TestLinux_ExecStage(t *testing.T) { }, }, }, + //{ + // name: "kubernetes-stage with step container with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // stage: &pipeline.Stage{ + // Name: "echo", + // Steps: pipeline.ContainerSlice{ + // { + // ID: "github-octocat-1-echo-echo", + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "alpine:notfound", + // Name: "echo", + // Number: 1, + // Pull: "not_present", + // }, + // }, + // }, + //}, { name: "docker-stage with step container with bad number", failure: true, @@ -381,6 +557,25 @@ func TestLinux_ExecStage(t *testing.T) { }, }, }, + { + name: "kubernetes-stage with step container with bad number", + failure: true, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 0, + Pull: "not_present", + }, + }, + }, + }, } // run tests @@ -439,6 +634,11 @@ func TestLinux_DestroyStage(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(true)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -465,6 +665,25 @@ func TestLinux_DestroyStage(t *testing.T) { }, }, }, + { + name: "kubernetes-basic stage", + failure: false, + runtime: _kubernetes, + stage: &pipeline.Stage{ + Name: "echo", + Steps: pipeline.ContainerSlice{ + { + ID: "github-octocat-1-echo-echo", + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "alpine:latest", + Name: "echo", + Number: 1, + Pull: "not_present", + }, + }, + }, + }, } // run tests From 1a29515f094508bc7d1dc6c1f245632a049bd44c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 20 Mar 2023 14:32:25 -0500 Subject: [PATCH 389/430] enhance(executor tests): Add kubernetes runtime test cases for Service tests (#442) --- executor/linux/service_test.go | 210 +++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 144a38bf..44c820ab 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -17,6 +17,7 @@ import ( "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" ) func TestLinux_CreateService(t *testing.T) { @@ -39,6 +40,11 @@ func TestLinux_CreateService(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -62,6 +68,22 @@ func TestLinux_CreateService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic service container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-service container with image not found", failure: true, @@ -78,12 +100,34 @@ func TestLinux_CreateService(t *testing.T) { Pull: "not_present", }, }, + // { + // name: "kubernetes-service container with image not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "service-github-octocat-1-postgres", + // Detach: true, + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "postgres:notfound", + // Name: "postgres", + // Number: 1, + // Ports: []string{"5432:5432"}, + // Pull: "not_present", + // }, + // }, { name: "docker-empty service container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty service container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -138,6 +182,11 @@ func TestLinux_PlanService(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -161,6 +210,22 @@ func TestLinux_PlanService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic service container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-service container with nil environment", failure: true, @@ -177,12 +242,34 @@ func TestLinux_PlanService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-service container with nil environment", + failure: true, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: nil, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-empty service container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty service container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -237,6 +324,11 @@ func TestLinux_ExecService(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + streamRequests, done := message.MockStreamRequestsWithCancel(context.Background()) defer done() @@ -263,6 +355,22 @@ func TestLinux_ExecService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic service container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-service container with image not found", failure: true, @@ -279,12 +387,34 @@ func TestLinux_ExecService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-service container with image not found", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:notfound", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-empty service container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty service container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -345,6 +475,11 @@ func TestLinux_StreamService(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -368,6 +503,22 @@ func TestLinux_StreamService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic service container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-service container with name not found", failure: true, @@ -384,12 +535,34 @@ func TestLinux_StreamService(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-service container with name not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "service-github-octocat-1-notfound", + // Detach: true, + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "postgres:12-alpine", + // Name: "notfound", + // Number: 1, + // Ports: []string{"5432:5432"}, + // Pull: "not_present", + // }, + //}, { name: "docker-empty service container", failure: true, runtime: _docker, container: new(pipeline.Container), }, + { + name: "kubernetes-empty service container", + failure: true, + runtime: _kubernetes, + container: new(pipeline.Container), + }, } // run tests @@ -449,6 +622,11 @@ func TestLinux_DestroyService(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } + _kubernetes, err := kubernetes.NewMock(testPod(false)) + if err != nil { + t.Errorf("unable to create kubernetes runtime engine: %v", err) + } + // setup tests tests := []struct { name string @@ -472,6 +650,22 @@ func TestLinux_DestroyService(t *testing.T) { Pull: "not_present", }, }, + { + name: "kubernetes-basic service container", + failure: false, + runtime: _kubernetes, + container: &pipeline.Container{ + ID: "service-github-octocat-1-postgres", + Detach: true, + Directory: "/vela/src/github.com/github/octocat", + Environment: map[string]string{"FOO": "bar"}, + Image: "postgres:12-alpine", + Name: "postgres", + Number: 1, + Ports: []string{"5432:5432"}, + Pull: "not_present", + }, + }, { name: "docker-service container with ignoring name not found", failure: true, @@ -488,6 +682,22 @@ func TestLinux_DestroyService(t *testing.T) { Pull: "not_present", }, }, + //{ + // name: "kubernetes-service container with ignoring name not found", + // failure: true, // FIXME: make Kubernetes mock simulate failure similar to Docker mock + // runtime: _kubernetes, + // container: &pipeline.Container{ + // ID: "service-github-octocat-1-ignorenotfound", + // Detach: true, + // Directory: "/vela/src/github.com/github/octocat", + // Environment: map[string]string{"FOO": "bar"}, + // Image: "postgres:12-alpine", + // Name: "ignorenotfound", + // Number: 1, + // Ports: []string{"5432:5432"}, + // Pull: "not_present", + // }, + //}, } // run tests From 3d6fa74f1d067ff922b3f7b0be31fdf5180b341e Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:39:51 -0500 Subject: [PATCH 390/430] feat: use validate-token endpoint in MustServer (#449) --- cmd/vela-worker/server.go | 2 +- go.mod | 8 +- go.sum | 16 +- router/middleware/perm/perm.go | 66 ++++- router/middleware/perm/perm_test.go | 344 +++++++++++++++++++++---- router/middleware/secret.go | 18 -- router/middleware/secret_test.go | 46 ---- router/middleware/server.go | 18 ++ router/middleware/user/context.go | 39 --- router/middleware/user/context_test.go | 90 ------- router/middleware/user/doc.go | 12 - router/middleware/user/user.go | 44 ---- router/middleware/user/user_test.go | 162 ------------ router/router.go | 3 +- 14 files changed, 386 insertions(+), 482 deletions(-) delete mode 100644 router/middleware/secret.go delete mode 100644 router/middleware/secret_test.go create mode 100644 router/middleware/server.go delete mode 100644 router/middleware/user/context.go delete mode 100644 router/middleware/user/context_test.go delete mode 100644 router/middleware/user/doc.go delete mode 100644 router/middleware/user/user.go delete mode 100644 router/middleware/user/user_test.go diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index cecd9210..d9810659 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -30,8 +30,8 @@ func (w *Worker) server() (http.Handler, *tls.Config) { // https://pkg.go.dev/github.com/go-vela/worker/router?tab=doc#Load _server := router.Load( middleware.RequestVersion, + middleware.ServerAddress(w.Config.Server.Address), middleware.Executors(w.Executors), - middleware.Secret(w.Config.Server.Secret), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), ) diff --git a/go.mod b/go.mod index 9c85d09a..cc15e3ba 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.18.1 - github.com/go-vela/server v0.18.1 - github.com/go-vela/types v0.18.1 + github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb + github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 + github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 @@ -34,7 +34,7 @@ require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/alicebob/miniredis/v2 v2.30.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 // indirect + github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect github.com/bytedance/sonic v1.8.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect diff --git a/go.sum b/go.sum index 2f666479..6d05d5c5 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ= github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8= -github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396 h1:qLN32md48xyTEqw6XEZMyNMre7njm0XXvDrea6NVwOM= -github.com/buildkite/yaml v0.0.0-20210326113714-4a3f40911396/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= +github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 h1:Zfkih+Opdv9y5AOob+8iMsaMYnans+Ozrkb8wiPHbj0= +github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -156,12 +156,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-vela/sdk-go v0.18.1 h1:qsm8XWjr9btNDL8c58JC93sstRUybL/TklWgeeft860= -github.com/go-vela/sdk-go v0.18.1/go.mod h1:QmfXBAdJ9prgE78TK13XJI8YjvGZA5hc+h79CbvgYGU= -github.com/go-vela/server v0.18.1 h1:INd+nwLh0c+WA+8diIh4scLkByGBGZHiyVd5doLSolQ= -github.com/go-vela/server v0.18.1/go.mod h1:WyJEXyJYYASfqN9PDuHqlBTbhsSRIzOn1E7tM2phZMA= -github.com/go-vela/types v0.18.1 h1:V/luHLnCEaJhD1m9PZCZicIasg8Op6MCK+utkz+gQiU= -github.com/go-vela/types v0.18.1/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= +github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb h1:JXEolOu+HFktExoDFcGYIdWS9LfPAQnQMIB4Rm48WS0= +github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb/go.mod h1:N8qFPxB0RsHrSYr01GVwgOOowtSfhvjXtJ1cRBaeTc4= +github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 h1:yJis1sso5c0ZoeZLfZ/lYsjfxU7H9cYP/VJXssRxDa8= +github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004/go.mod h1:b+7XeGHO4ynIinY9mpWb6ye9psdwHpsAqMWy5oC+zJ0= +github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c h1:lnCL1knUGvgZQG4YBHSs/CZnxNBfqFUBlGhyq9LO9uk= +github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index 135d452c..85dd60d8 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -9,29 +9,79 @@ import ( "net/http" "strings" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types" - "github.com/go-vela/worker/router/middleware/user" + "github.com/go-vela/worker/router/middleware/token" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" ) -// MustServer ensures the user is the vela server. +// MustServer ensures the caller is the vela server. func MustServer() gin.HandlerFunc { return func(c *gin.Context) { - u := user.Retrieve(c) + // retrieve the callers token from the request headers + tkn, err := token.Retrieve(c.Request) + if err != nil { + msg := fmt.Sprintf("error parsing token: %v", err) + + logrus.Error(msg) + + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) + + return + } + + // retrieve the configured server address from the context + addr := c.MustGet("server-address").(string) + + // create a temporary client to validate the incoming request + vela, err := vela.NewClient(addr, "vela-worker", nil) + if err != nil { + msg := fmt.Sprintf("error creating vela client: %s", err) + + logrus.Error(msg) + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + return + } + + // validate a token was provided + if strings.EqualFold(tkn, "") { + msg := "missing token" + + logrus.Error(msg) + + c.AbortWithStatusJSON(http.StatusBadRequest, types.Error{Message: &msg}) - if strings.EqualFold(u.GetName(), "vela-server") { return } - msg := fmt.Sprintf("User %s is not a platform admin", u.GetName()) + // set the token auth provided in the callers request header + vela.Authentication.SetTokenAuth(tkn) - err := c.Error(fmt.Errorf(msg)) + // validate the token with the configured vela server + resp, err := vela.Authentication.ValidateToken() if err != nil { - logrus.Error(err) + msg := fmt.Sprintf("error validating token: %s", err) + + logrus.Error(msg) + + c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg}) + + return } - c.AbortWithStatusJSON(http.StatusUnauthorized, types.Error{Message: &msg}) + // if ValidateToken returned anything other than 200 consider the token invalid + if resp.StatusCode != http.StatusOK { + msg := "unable to validate token" + + logrus.Error(msg) + + c.AbortWithStatusJSON(http.StatusUnauthorized, types.Error{Message: &msg}) + + return + } } } diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index 64eb967c..c0e634a0 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -10,85 +10,333 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/worker/router/middleware/user" - - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" ) -func TestPerm_MustServer_success(t *testing.T) { +func TestPerm_MustServer_ValidateToken200(t *testing.T) { + // setup types + tkn := "superSecret" + + // setup context + gin.SetMode(gin.TestMode) + + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) + + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { + // token is not expired and matches server token + c.Status(http.StatusOK) + }) + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() + + // run test + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) + + if workerResp.Code != http.StatusOK { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusOK) + } +} + +func TestPerm_MustServer_ValidateToken401(t *testing.T) { + // setup types + tkn := "superSecret" + + // setup context + gin.SetMode(gin.TestMode) + + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) + + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { + // test that validate-token returning a 401 works as expected + c.Status(http.StatusUnauthorized) + }) + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() + + // run test + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) + + if workerResp.Code != http.StatusUnauthorized { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusUnauthorized) + } +} + +func TestPerm_MustServer_ValidateToken404(t *testing.T) { + // setup types + tkn := "superSecret" + + // setup context + gin.SetMode(gin.TestMode) + + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) + + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // skip mocked token validation endpoint used in MustServer + // test that validate-token returning a 404 works as expected + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() + + // run test + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) + + if workerResp.Code != http.StatusUnauthorized { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusUnauthorized) + } +} + +func TestPerm_MustServer_ValidateToken500(t *testing.T) { // setup types - secret := "superSecret" + tkn := "superSecret" + + // setup context + gin.SetMode(gin.TestMode) + + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) + + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { + // validate-token returning a server error + c.Status(http.StatusInternalServerError) + }) + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() - u := new(library.User) - u.SetID(1) - u.SetName("vela-server") - u.SetToken("bar") - u.SetHash("baz") - u.SetAdmin(true) + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() + + // run test + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) + + if workerResp.Code != http.StatusUnauthorized { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusUnauthorized) + } +} + +func TestPerm_MustServer_BadServerAddress(t *testing.T) { + // setup types + tkn := "superSecret" + badServerAddress := "test.example.com" // setup context gin.SetMode(gin.TestMode) - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) - context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) - // setup vela mock server - engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(user.Establish()) - engine.Use(MustServer()) - engine.GET("/server/users", func(c *gin.Context) { + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { c.Status(http.StatusOK) }) - s1 := httptest.NewServer(engine) - defer s1.Close() + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", badServerAddress) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() // run test - engine.ServeHTTP(context.Writer, context.Request) + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) - if resp.Code != http.StatusOK { - t.Errorf("MustServer returned %v, want %v", resp.Code, http.StatusOK) + if workerResp.Code != http.StatusInternalServerError { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusInternalServerError) } } -func TestPerm_MustServer_failure(t *testing.T) { +func TestPerm_MustServer_NoToken(t *testing.T) { // setup types - secret := "foo" + tkn := "" + + // setup context + gin.SetMode(gin.TestMode) + + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + workerCtx.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tkn)) - u := new(library.User) - u.SetID(1) - u.SetName("not-vela-server") - u.SetToken("bar") - u.SetHash("baz") - u.SetAdmin(true) + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) + + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() + + // run test + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) + + if workerResp.Code != http.StatusBadRequest { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusBadRequest) + } +} + +func TestPerm_MustServer_NoAuth(t *testing.T) { // setup context gin.SetMode(gin.TestMode) - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/server/users", nil) - context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) + // setup mock worker router + workerResp := httptest.NewRecorder() + workerCtx, workerEngine := gin.CreateTestContext(workerResp) + + // fake request made to the worker router + workerCtx.Request, _ = http.NewRequest(http.MethodGet, "/build/cancel", nil) + // test that skipping adding an authorization header is handled properly + + // setup mock server router + // the URL of the mock server router is injected into the mock worker router + serverResp := httptest.NewRecorder() + _, serverEngine := gin.CreateTestContext(serverResp) + + // mocked token validation endpoint used in MustServer + serverEngine.GET("/validate-token", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + + serverMock := httptest.NewServer(serverEngine) + defer serverMock.Close() + + workerEngine.Use(func(c *gin.Context) { c.Set("server-address", serverMock.URL) }) - // setup vela mock server - engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(func(c *gin.Context) { c.Set("user", u) }) - engine.Use(MustServer()) - engine.GET("/server/users", func(c *gin.Context) { + // attach perm middleware that we are testing + workerEngine.Use(MustServer()) + workerEngine.GET("/build/cancel", func(c *gin.Context) { c.Status(http.StatusOK) }) - s1 := httptest.NewServer(engine) - defer s1.Close() + workerMock := httptest.NewServer(workerEngine) + defer workerMock.Close() // run test - engine.ServeHTTP(context.Writer, context.Request) + workerEngine.ServeHTTP(workerCtx.Writer, workerCtx.Request) - if resp.Code != http.StatusUnauthorized { - t.Errorf("MustServer returned %v, want %v", resp.Code, http.StatusUnauthorized) + if workerResp.Code != http.StatusBadRequest { + t.Errorf("MustServer returned %v, want %v", workerResp.Code, http.StatusBadRequest) } } diff --git a/router/middleware/secret.go b/router/middleware/secret.go deleted file mode 100644 index c880a425..00000000 --- a/router/middleware/secret.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package middleware - -import ( - "github.com/gin-gonic/gin" -) - -// Secret is a middleware function that attaches the secret used for -// server <-> agent communication to the context of every http.Request. -func Secret(secret string) gin.HandlerFunc { - return func(c *gin.Context) { - c.Set("secret", secret) - c.Next() - } -} diff --git a/router/middleware/secret_test.go b/router/middleware/secret_test.go deleted file mode 100644 index 1f37a084..00000000 --- a/router/middleware/secret_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package middleware - -import ( - "net/http" - "net/http/httptest" - "reflect" - "testing" - - "github.com/gin-gonic/gin" -) - -func TestMiddleware_Secret(t *testing.T) { - // setup types - got := "" - want := "foobar" - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) - - // setup mock server - engine.Use(Secret(want)) - engine.GET("/health", func(c *gin.Context) { - got = c.Value("secret").(string) - - c.Status(http.StatusOK) - }) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - if resp.Code != http.StatusOK { - t.Errorf("Secret returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("Secret is %v, want %v", got, want) - } -} diff --git a/router/middleware/server.go b/router/middleware/server.go new file mode 100644 index 00000000..3c93dbfb --- /dev/null +++ b/router/middleware/server.go @@ -0,0 +1,18 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "github.com/gin-gonic/gin" +) + +// ServerAddress is a middleware function that attaches the +// server address to the context of every http.Request. +func ServerAddress(addr string) gin.HandlerFunc { + return func(c *gin.Context) { + c.Set("server-address", addr) + c.Next() + } +} diff --git a/router/middleware/user/context.go b/router/middleware/user/context.go deleted file mode 100644 index 944a1f3e..00000000 --- a/router/middleware/user/context.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package user - -import ( - "context" - - "github.com/go-vela/types/library" -) - -const key = "user" - -// Setter defines a context that enables setting values. -type Setter interface { - Set(string, interface{}) -} - -// FromContext returns the User associated with this context. -func FromContext(c context.Context) *library.User { - value := c.Value(key) - if value == nil { - return nil - } - - u, ok := value.(*library.User) - if !ok { - return nil - } - - return u -} - -// ToContext adds the User to this context if it supports -// the Setter interface. -func ToContext(c Setter, u *library.User) { - c.Set(key, u) -} diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go deleted file mode 100644 index 6cfe188a..00000000 --- a/router/middleware/user/context_test.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package user - -import ( - "testing" - - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" -) - -func TestUser_FromContext(t *testing.T) { - // setup types - uID := int64(1) - want := &library.User{ID: &uID} - - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, want) - - // run test - got := FromContext(context) - - if got != want { - t.Errorf("FromContext is %v, want %v", got, want) - } -} - -func TestUser_FromContext_Bad(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, nil) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestUser_FromContext_WrongType(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - context.Set(key, 1) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestUser_FromContext_Empty(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - - // run test - got := FromContext(context) - - if got != nil { - t.Errorf("FromContext is %v, want nil", got) - } -} - -func TestUser_ToContext(t *testing.T) { - // setup types - uID := int64(1) - want := &library.User{ID: &uID} - - // setup context - gin.SetMode(gin.TestMode) - context, _ := gin.CreateTestContext(nil) - ToContext(context, want) - - // run test - got := context.Value(key) - - if got != want { - t.Errorf("ToContext is %v, want %v", got, want) - } -} diff --git a/router/middleware/user/doc.go b/router/middleware/user/doc.go deleted file mode 100644 index 7ba0a485..00000000 --- a/router/middleware/user/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -// Package user provides the ability for inserting -// Vela user resources into or extracting Vela user -// resources from the middleware chain for the API. -// -// Usage: -// -// import "github.com/go-vela/worker/router/middleware/user" -package user diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go deleted file mode 100644 index 817aa0e9..00000000 --- a/router/middleware/user/user.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package user - -import ( - "net/http" - "strings" - - "github.com/go-vela/worker/router/middleware/token" - - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" -) - -// Retrieve gets the user in the given context. -func Retrieve(c *gin.Context) *library.User { - return FromContext(c) -} - -// Establish sets the user in the given context. -func Establish() gin.HandlerFunc { - return func(c *gin.Context) { - u := new(library.User) - - t, err := token.Retrieve(c.Request) - if err != nil { - c.AbortWithStatusJSON(http.StatusUnauthorized, err.Error()) - return - } - - secret := c.MustGet("secret").(string) - if strings.EqualFold(t, secret) { - u.SetName("vela-server") - u.SetActive(true) - u.SetAdmin(true) - } - - ToContext(c, u) - c.Next() - } -} diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go deleted file mode 100644 index b4f8b52f..00000000 --- a/router/middleware/user/user_test.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. - -package user - -import ( - "fmt" - "net/http" - "net/http/httptest" - "reflect" - "testing" - - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" -) - -func TestUser_Retrieve(t *testing.T) { - // setup types - want := new(library.User) - want.SetID(1) - - // setup context - gin.SetMode(gin.TestMode) - - context, _ := gin.CreateTestContext(nil) - ToContext(context, want) - - // run test - got := Retrieve(context) - - if got != want { - t.Errorf("Retrieve is %v, want %v", got, want) - } -} - -func TestUser_Establish(t *testing.T) { - // setup types - secret := "superSecret" - got := new(library.User) - want := new(library.User) - want.SetName("vela-server") - want.SetActive(true) - want.SetAdmin(true) - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) - context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) - - // setup vela mock server - engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(Establish()) - engine.GET("/users/:user", func(c *gin.Context) { - got = Retrieve(c) - - c.Status(http.StatusOK) - }) - - s1 := httptest.NewServer(engine) - defer s1.Close() - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - if resp.Code != http.StatusOK { - t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("Establish is %v, want %v", got, want) - } -} - -func TestUser_Establish_NoToken(t *testing.T) { - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo", nil) - - // setup mock server - engine.Use(Establish()) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - if resp.Code != http.StatusUnauthorized { - t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusUnauthorized) - } -} - -func TestUser_Establish_SecretValid(t *testing.T) { - // setup types - secret := "superSecret" - - want := new(library.User) - want.SetName("vela-server") - want.SetActive(true) - want.SetAdmin(true) - - got := new(library.User) - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/users/vela-server", nil) - context.Request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", secret)) - - // setup vela mock server - engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(Establish()) - engine.GET("/users/:user", func(c *gin.Context) { - got = Retrieve(c) - - c.Status(http.StatusOK) - }) - - s := httptest.NewServer(engine) - defer s.Close() - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - if resp.Code != http.StatusOK { - t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusOK) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("Establish is %v, want %v", got, want) - } -} - -func TestUser_Establish_NoAuthorizeUser(t *testing.T) { - // setup types - secret := "superSecret" - - // setup context - gin.SetMode(gin.TestMode) - - resp := httptest.NewRecorder() - context, engine := gin.CreateTestContext(resp) - context.Request, _ = http.NewRequest(http.MethodGet, "/users/foo?access_token=bar", nil) - - // setup vela mock server - engine.Use(func(c *gin.Context) { c.Set("secret", secret) }) - engine.Use(Establish()) - - // run test - engine.ServeHTTP(context.Writer, context.Request) - - if resp.Code != http.StatusUnauthorized { - t.Errorf("Establish returned %v, want %v", resp.Code, http.StatusUnauthorized) - } -} diff --git a/router/router.go b/router/router.go index 222029df..14b3955c 100644 --- a/router/router.go +++ b/router/router.go @@ -31,7 +31,6 @@ import ( "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware" "github.com/go-vela/worker/router/middleware/perm" - "github.com/go-vela/worker/router/middleware/user" ) const ( @@ -95,7 +94,7 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { // add a collection of endpoints for handling API related requests // // https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc#RouterGroup.Group - baseAPI := r.Group(base, user.Establish(), perm.MustServer()) + baseAPI := r.Group(base, perm.MustServer()) { // add an endpoint for shutting down the worker // From f8666052840b849fe88e566067dd2f92d3eb093d Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:13:55 -0600 Subject: [PATCH 391/430] enhance(auth): implement registration flow (#452) * initial work * more work * backwards compatibility with comments * adjust middleware to only use validate-token for server tokens * more work * rename auth token channel to RegisterToken * rename token channel and update api comments * updating some comments and not loggin token * fix docker compose * fix local replace * token expiration func has two return vals * docker compose no register * name register token middleware file correctly * update swagger for register --- api/register.go | 70 +++++++++++++++++++++++ cmd/vela-worker/flags.go | 1 + cmd/vela-worker/operate.go | 72 ++++++++++++++++++------ cmd/vela-worker/register.go | 20 +++---- cmd/vela-worker/run.go | 7 +++ cmd/vela-worker/server.go | 1 + cmd/vela-worker/validate.go | 5 -- cmd/vela-worker/worker.go | 12 ++-- docker-compose.yml | 10 +++- router/middleware/register_token.go | 18 ++++++ router/middleware/register_token_test.go | 48 ++++++++++++++++ router/middleware/server_test.go | 46 +++++++++++++++ router/router.go | 3 + router/router_test.go | 6 ++ 14 files changed, 280 insertions(+), 39 deletions(-) create mode 100644 api/register.go create mode 100644 router/middleware/register_token.go create mode 100644 router/middleware/register_token_test.go create mode 100644 router/middleware/server_test.go diff --git a/api/register.go b/api/register.go new file mode 100644 index 00000000..33829dff --- /dev/null +++ b/api/register.go @@ -0,0 +1,70 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" + "github.com/go-vela/worker/router/middleware/token" +) + +// swagger:operation POST /register system Register +// +// Fill registration token channel in worker to continue operation +// +// --- +// produces: +// - application/json +// parameters: +// security: +// - ApiKeyAuth: [] +// responses: +// '200': +// description: Successfully passed token to worker +// schema: +// type: string +// '500': +// description: Unable to pass token to worker +// schema: +// "$ref": "#/definitions/Error" + +// Register will pass the token given in the request header to the register token +// channel of the worker. This will unblock operation if the worker has not been +// registered and the provided registration token is valid. +func Register(c *gin.Context) { + // extract the register token channel that was packed into gin context + v, ok := c.Get("register-token") + if !ok { + c.JSON(http.StatusInternalServerError, "no register token channel in the context") + return + } + + // make sure we configured the channel properly + rChan, ok := v.(chan string) + if !ok { + c.JSON(http.StatusInternalServerError, "register token channel in the context is the wrong type") + return + } + + // if token is present in the channel, deny registration + // this will likely never happen as the channel is offloaded immediately + if len(rChan) > 0 { + c.JSON(http.StatusOK, "worker already registered") + return + } + + // retrieve auth token from header + token, err := token.Retrieve(c.Request) + if err != nil { + c.JSON(http.StatusInternalServerError, err) + return + } + + // write registration token to auth token channel + rChan <- token + + c.JSON(http.StatusOK, "successfully passed token to worker") +} diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index bce7284c..23d7b025 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -74,6 +74,7 @@ func flags() []cli.Flag { EnvVars: []string{"WORKER_SERVER_SECRET", "VELA_SERVER_SECRET", "SERVER_SECRET"}, Name: "server.secret", Usage: "secret used for server <-> worker communication", + Value: "", }, &cli.StringFlag{ EnvVars: []string{"WORKER_SERVER_CERT", "VELA_SERVER_CERT", "SERVER_CERT"}, diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index bbbe2e7a..8a8909a5 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -22,12 +22,6 @@ import ( func (w *Worker) operate(ctx context.Context) error { var err error - // setup the vela client with the server - w.VelaClient, err = setupClient(w.Config.Server, w.Config.Server.Secret) - if err != nil { - return err - } - // create the errgroup for managing operator subprocesses // // https://pkg.go.dev/golang.org/x/sync/errgroup?tab=doc#Group @@ -40,9 +34,17 @@ func (w *Worker) operate(ctx context.Context) error { registryWorker.SetAddress(w.Config.API.Address.String()) registryWorker.SetRoutes(w.Config.Queue.Routes) registryWorker.SetActive(true) - registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) registryWorker.SetBuildLimit(int64(w.Config.Build.Limit)) + // pull registration token from configuration if provided; wait if not + token := <-w.RegisterToken + + // setup the vela client with the token + w.VelaClient, err = setupClient(w.Config.Server, token) + if err != nil { + return err + } + // spawn goroutine for phoning home executors.Go(func() error { for { @@ -51,19 +53,51 @@ func (w *Worker) operate(ctx context.Context) error { logrus.Info("Completed looping on worker registration") return nil default: - // set checking time to now and call the server - registryWorker.SetLastCheckedIn(time.Now().UTC().Unix()) + // check in attempt loop + for { + // register or update the worker + //nolint:contextcheck // ignore passing context + w.CheckedIn, token, err = w.checkIn(registryWorker) + // check in failed + if err != nil { + // check if token is expired + expired, err := w.VelaClient.Authentication.IsTokenAuthExpired() + if err != nil { + logrus.Error("unable to check token expiration") + return err + } + + // token has expired + if expired && len(w.Config.Server.Secret) == 0 { + // wait on new registration token, return to check in attempt + token = <-w.RegisterToken + + // setup the vela client with the token + w.VelaClient, err = setupClient(w.Config.Server, token) + if err != nil { + return err + } + + continue + } + + // check in failed, token is still valid, retry + logrus.Errorf("unable to check-in worker %s on the server: %v", registryWorker.GetHostname(), err) + logrus.Info("retrying...") + + time.Sleep(5 * time.Second) + + continue + } - // register or update the worker - //nolint:contextcheck // ignore passing context - err = w.checkIn(registryWorker) - if err != nil { - logrus.Error(err) + // successful check in breaks the loop + break } - // if unable to update the worker, log the error but allow the worker to continue running + // setup the vela client with the token + w.VelaClient, err = setupClient(w.Config.Server, token) if err != nil { - logrus.Errorf("unable to update worker %s on the server: %v", registryWorker.GetHostname(), err) + return err } // sleep for the configured time @@ -99,6 +133,12 @@ func (w *Worker) operate(ctx context.Context) error { executors.Go(func() error { // create an infinite loop to poll for builds for { + // do not pull from queue unless worker is checked in with server + if !w.CheckedIn { + time.Sleep(5 * time.Second) + logrus.Info("worker not checked in, skipping queue read") + continue + } select { case <-gctx.Done(): logrus.WithFields(logrus.Fields{ diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index 5de52721..e922c745 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -13,7 +13,7 @@ import ( ) // checkIn is a helper function to phone home to the server. -func (w *Worker) checkIn(config *library.Worker) error { +func (w *Worker) checkIn(config *library.Worker) (bool, string, error) { // check to see if the worker already exists in the database logrus.Infof("retrieving worker %s from the server", config.GetHostname()) @@ -21,37 +21,37 @@ func (w *Worker) checkIn(config *library.Worker) error { if err != nil { respErr := fmt.Errorf("unable to retrieve worker %s from the server: %w", config.GetHostname(), err) if resp == nil { - return respErr + return false, "", respErr } // if we receive a 404 the worker needs to be registered if resp.StatusCode == http.StatusNotFound { return w.register(config) } - return respErr + return false, "", respErr } // if we were able to GET the worker, update it logrus.Infof("checking worker %s into the server", config.GetHostname()) - _, _, err = w.VelaClient.Worker.Update(config.GetHostname(), config) + tkn, _, err := w.VelaClient.Worker.RefreshAuth(config.GetHostname()) if err != nil { - return fmt.Errorf("unable to update worker %s on the server: %w", config.GetHostname(), err) + return false, "", fmt.Errorf("unable to refresh auth for worker %s on the server: %w", config.GetHostname(), err) } - return nil + return true, tkn.GetToken(), nil } // register is a helper function to register the worker with the server. -func (w *Worker) register(config *library.Worker) error { +func (w *Worker) register(config *library.Worker) (bool, string, error) { logrus.Infof("worker %s not found, registering it with the server", config.GetHostname()) - _, _, err := w.VelaClient.Worker.Add(config) + tkn, _, err := w.VelaClient.Worker.Add(config) if err != nil { // log the error instead of returning so the operation doesn't block worker deployment - return fmt.Errorf("unable to register worker %s with the server: %w", config.GetHostname(), err) + return false, "", fmt.Errorf("unable to register worker %s with the server: %w", config.GetHostname(), err) } // successfully added the worker so return nil - return nil + return true, tkn.GetToken(), nil } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 222aed07..10cf5c02 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -135,6 +135,8 @@ func run(c *cli.Context) error { TLSMinVersion: c.String("server.tls-min-version"), }, Executors: make(map[int]executor.Engine), + + RegisterToken: make(chan string, 1), } // set the worker address if no flag was provided @@ -142,6 +144,11 @@ func run(c *cli.Context) error { w.Config.API.Address, _ = url.Parse(fmt.Sprintf("http://%s", hostname)) } + // if server secret is provided, use as register token on start up + if len(c.String("server.secret")) > 0 { + w.RegisterToken <- c.String("server.secret") + } + // validate the worker err = w.Validate() if err != nil { diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index d9810659..7961fe73 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -33,6 +33,7 @@ func (w *Worker) server() (http.Handler, *tls.Config) { middleware.ServerAddress(w.Config.Server.Address), middleware.Executors(w.Executors), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), + middleware.RegisterToken(w.RegisterToken), ) // log a message indicating the start of serving traffic diff --git a/cmd/vela-worker/validate.go b/cmd/vela-worker/validate.go index 84db82b1..82d1b79a 100644 --- a/cmd/vela-worker/validate.go +++ b/cmd/vela-worker/validate.go @@ -52,11 +52,6 @@ func (w *Worker) Validate() error { return fmt.Errorf("no worker server address provided") } - // verify a server secret was provided - if len(w.Config.Server.Secret) == 0 { - return fmt.Errorf("no worker server secret provided") - } - // verify an executor driver was provided if len(w.Config.Executor.Driver) == 0 { return fmt.Errorf("no worker executor driver provided") diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 1d21e75c..895fdd19 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -62,10 +62,12 @@ type ( // Worker represents all configuration and // system processes for the worker. Worker struct { - Config *Config - Executors map[int]executor.Engine - Queue queue.Service - Runtime runtime.Engine - VelaClient *vela.Client + Config *Config + Executors map[int]executor.Engine + Queue queue.Service + Runtime runtime.Engine + VelaClient *vela.Client + RegisterToken chan string + CheckedIn bool } ) diff --git a/docker-compose.yml b/docker-compose.yml index d0758630..8fde3ef5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,9 +30,10 @@ services: VELA_RUNTIME_PRIVILEGED_IMAGES: 'target/vela-docker' VELA_EXECUTOR_ENFORCE_TRUSTED_REPOS: 'true' VELA_SERVER_ADDR: 'http://server:8080' + # comment the line below to use registration flow VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' - WORKER_CHECK_IN: 5m + WORKER_CHECK_IN: 2m restart: always ports: - "8081:8080" @@ -68,9 +69,12 @@ services: VELA_ADDR: 'http://localhost:8080' VELA_WEBUI_ADDR: 'http://localhost:8888' VELA_LOG_LEVEL: trace + # comment the line below to use registration flow VELA_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' - VELA_REFRESH_TOKEN_DURATION: 90m - VELA_ACCESS_TOKEN_DURATION: 60m + VELA_SERVER_PRIVATE_KEY: 'F534FF2A080E45F38E05DC70752E6787' + VELA_USER_REFRESH_TOKEN_DURATION: 90m + VELA_USER_ACCESS_TOKEN_DURATION: 60m + VELA_WORKER_AUTH_TOKEN_DURATION: 3m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' VELA_REPO_ALLOWLIST: '*' diff --git a/router/middleware/register_token.go b/router/middleware/register_token.go new file mode 100644 index 00000000..177fd3f2 --- /dev/null +++ b/router/middleware/register_token.go @@ -0,0 +1,18 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "github.com/gin-gonic/gin" +) + +// RegisterToken is a middleware function that attaches the +// auth-token channel to the context of every http.Request. +func RegisterToken(r chan string) gin.HandlerFunc { + return func(c *gin.Context) { + c.Set("register-token", r) + c.Next() + } +} diff --git a/router/middleware/register_token_test.go b/router/middleware/register_token_test.go new file mode 100644 index 00000000..afe8241d --- /dev/null +++ b/router/middleware/register_token_test.go @@ -0,0 +1,48 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" +) + +func TestMiddleware_RegisterToken(t *testing.T) { + // setup types + want := make(chan string, 1) + got := make(chan string, 1) + + want <- "foo" + + // setup context + gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) + + // setup mock server + engine.Use(RegisterToken(want)) + engine.GET("/health", func(c *gin.Context) { + got = c.Value("register-token").(chan string) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("RegisterToken returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("RegisterToken is %v, want foo", got) + } +} diff --git a/router/middleware/server_test.go b/router/middleware/server_test.go new file mode 100644 index 00000000..a1221287 --- /dev/null +++ b/router/middleware/server_test.go @@ -0,0 +1,46 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" +) + +func TestMiddleware_ServerAddress(t *testing.T) { + // setup types + got := "" + want := "foobar" + + // setup context + gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) + + // setup mock server + engine.Use(ServerAddress(want)) + engine.GET("/health", func(c *gin.Context) { + got = c.Value("server-address").(string) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("ServerAddress returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("ServerAddress is %v, want %v", got, want) + } +} diff --git a/router/router.go b/router/router.go index 14b3955c..7de750f4 100644 --- a/router/router.go +++ b/router/router.go @@ -107,5 +107,8 @@ func Load(options ...gin.HandlerFunc) *gin.Engine { ExecutorHandlers(baseAPI) } + // endpoint for passing a new registration token to the deadloop running operate.go + r.POST("/register", api.Register) + return r } diff --git a/router/router_test.go b/router/router_test.go index 549369a9..128d91fd 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -41,6 +41,12 @@ func TestRouter_Load(t *testing.T) { Handler: "github.com/go-vela/worker/api.Shutdown", HandlerFunc: api.Shutdown, }, + { + Method: "POST", + Path: "/api/v1/register", + Handler: "github.com/go-vela/worker/api.Register", + HandlerFunc: api.Register, + }, { Method: "GET", Path: "/api/v1/executors", From c367ab398295be0edd7069057daff60122491b9a Mon Sep 17 00:00:00 2001 From: David May <49894298+wass3rw3rk@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:18:13 -0500 Subject: [PATCH 392/430] feat(mock): add support for register endpoint (#457) --- api/register.go | 7 ++++++- mock/worker/register.go | 23 +++++++++++++++++++++++ mock/worker/server.go | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 mock/worker/register.go diff --git a/api/register.go b/api/register.go index 33829dff..52141c12 100644 --- a/api/register.go +++ b/api/register.go @@ -26,6 +26,10 @@ import ( // description: Successfully passed token to worker // schema: // type: string +// '401': +// description: No token was passed +// schema: +// "$ref": "#/definitions/Error" // '500': // description: Unable to pass token to worker // schema: @@ -59,7 +63,8 @@ func Register(c *gin.Context) { // retrieve auth token from header token, err := token.Retrieve(c.Request) if err != nil { - c.JSON(http.StatusInternalServerError, err) + // an error occurs when no token was passed + c.JSON(http.StatusUnauthorized, err) return } diff --git a/mock/worker/register.go b/mock/worker/register.go new file mode 100644 index 00000000..1e874be5 --- /dev/null +++ b/mock/worker/register.go @@ -0,0 +1,23 @@ +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package worker + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// postRegister returns mock JSON for a http POST. +// +// Do not pass an auth token to fail the request. +func postRegister(c *gin.Context) { + token := c.Request.Header.Get("Authorization") + if len(token) == 0 { + c.JSON(http.StatusUnauthorized, "no token provided in Authorization header") + } + + c.JSON(http.StatusOK, "successfully passed token to worker") +} diff --git a/mock/worker/server.go b/mock/worker/server.go index a3a687b6..b5067b46 100644 --- a/mock/worker/server.go +++ b/mock/worker/server.go @@ -31,5 +31,8 @@ func FakeHandler() http.Handler { // mock endpoints for repo calls e.GET("/api/v1/executors/:executor/repo", getRepo) + // mock endpoint for register call + e.POST("/register", postRegister) + return e } From 3bf4d5eda8e219c02ae10d7c6f9f6d892a15aeeb Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 6 Apr 2023 10:51:41 -0600 Subject: [PATCH 393/430] feat(runtime/docker): add drop kernel capabilities option to runtime flags (#454) * capabilities * docker compose revert + opencontainers version * revert lots of go mod stuff * fix copy pasta and add a test in opts --- cmd/vela-worker/exec.go | 1 + cmd/vela-worker/run.go | 1 + go.mod | 4 +++- go.sum | 9 ++++++--- runtime/docker/container.go | 2 +- runtime/docker/docker.go | 2 ++ runtime/docker/opts.go | 12 ++++++++++++ runtime/docker/opts_test.go | 37 +++++++++++++++++++++++++++++++++++++ runtime/docker/volume.go | 3 ++- runtime/flags.go | 6 ++++++ runtime/setup.go | 24 +++++++++++++++++++++++- runtime/setup_test.go | 11 ++++++++++- 12 files changed, 104 insertions(+), 8 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 62b1b648..b1bace02 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -74,6 +74,7 @@ func (w *Worker) exec(index int) error { PodsTemplateName: w.Config.Runtime.PodsTemplateName, PodsTemplateFile: w.Config.Runtime.PodsTemplateFile, PrivilegedImages: w.Config.Runtime.PrivilegedImages, + DropCapabilities: w.Config.Runtime.DropCapabilities, }) if err != nil { return err diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 10cf5c02..f00ce224 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -112,6 +112,7 @@ func run(c *cli.Context) error { PodsTemplateFile: c.Path("runtime.pods-template-file"), HostVolumes: c.StringSlice("runtime.volumes"), PrivilegedImages: c.StringSlice("runtime.privileged-images"), + DropCapabilities: c.StringSlice("runtime.drop-capabilities"), }, // queue configuration Queue: &queue.Setup{ diff --git a/go.mod b/go.mod index cc15e3ba..d98da806 100644 --- a/go.mod +++ b/go.mod @@ -97,6 +97,8 @@ require ( github.com/spf13/afero v1.9.4 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.8.2 // indirect + github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.9 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect @@ -106,7 +108,7 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.5.0 // indirect - golang.org/x/sys v0.5.0 // indirect + golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index 6d05d5c5..45b794cb 100644 --- a/go.sum +++ b/go.sum @@ -397,8 +397,11 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= @@ -589,8 +592,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 9f5106ec..5ec9edff 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -95,7 +95,7 @@ func (c *client) RunContainer(ctx context.Context, ctn *pipeline.Container, b *p // allocate new container config from pipeline container containerConf := ctnConfig(ctn) // allocate new host config with volume data - hostConf := hostConfig(c.Logger, b.ID, ctn.Ulimits, c.config.Volumes) + hostConf := hostConfig(c.Logger, b.ID, ctn.Ulimits, c.config.Volumes, c.config.DropCapabilities) // allocate new network config with container name networkConf := netConfig(b.ID, ctn.Name) diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index ba0de3b0..f5c7ee03 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -31,6 +31,8 @@ type config struct { Images []string // specifies a list of host volumes to use for the Docker client Volumes []string + // specifies a list of kernel capabilities to drop for each Docker container + DropCapabilities []string } type client struct { diff --git a/runtime/docker/opts.go b/runtime/docker/opts.go index de1b46be..2c373e91 100644 --- a/runtime/docker/opts.go +++ b/runtime/docker/opts.go @@ -49,3 +49,15 @@ func WithPrivilegedImages(images []string) ClientOpt { return nil } } + +// WithDropCapabilities sets the kernel capabilities to drop from each container in the runtime client for Docker. +func WithDropCapabilities(caps []string) ClientOpt { + return func(c *client) error { + c.Logger.Trace("configuring dropped capabilities in docker runtime client") + + // set the runtime dropped kernel capabilities in the docker client + c.config.DropCapabilities = caps + + return nil + } +} diff --git a/runtime/docker/opts_test.go b/runtime/docker/opts_test.go index d5efd269..52250a3f 100644 --- a/runtime/docker/opts_test.go +++ b/runtime/docker/opts_test.go @@ -133,3 +133,40 @@ func TestDocker_ClientOpt_WithLogger(t *testing.T) { }) } } + +func TestDocker_ClientOpt_WithDropCapabilities(t *testing.T) { + // setup tests + tests := []struct { + name string + caps []string + want []string + }{ + { + name: "defined", + caps: []string{"CAP_CHOWN", "CAP_DAC_OVERRIDE"}, + want: []string{"CAP_CHOWN", "CAP_DAC_OVERRIDE"}, + }, + { + name: "empty", + caps: []string{}, + want: []string{}, + }, + } + + // run tests + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + _service, err := New( + WithDropCapabilities(test.caps), + ) + + if err != nil { + t.Errorf("WithDropCapabilities returned err: %v", err) + } + + if !reflect.DeepEqual(_service.config.DropCapabilities, test.want) { + t.Errorf("WithDropCapabilities is %v, want %v", _service.config.DropCapabilities, test.want) + } + }) + } +} diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index 0f8552ad..0e76a9e0 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -90,7 +90,7 @@ func (c *client) RemoveVolume(ctx context.Context, b *pipeline.Build) error { // hostConfig is a helper function to generate the host config // with Ulimit and volume specifications for a container. -func hostConfig(logger *logrus.Entry, id string, ulimits pipeline.UlimitSlice, volumes []string) *container.HostConfig { +func hostConfig(logger *logrus.Entry, id string, ulimits pipeline.UlimitSlice, volumes []string, dropCaps []string) *container.HostConfig { logger.Tracef("creating mount for default volume %s", id) // create default mount for pipeline volume @@ -146,5 +146,6 @@ func hostConfig(logger *logrus.Entry, id string, ulimits pipeline.UlimitSlice, v Mounts: mounts, // https://pkg.go.dev/github.com/docker/docker/api/types/container#Resources.Ulimits Resources: resources, + CapDrop: dropCaps, } } diff --git a/runtime/flags.go b/runtime/flags.go index cbf87de3..cc00fb75 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -60,4 +60,10 @@ var Flags = []cli.Flag{ Name: "runtime.volumes", Usage: "list of host volumes to mount for the runtime", }, + &cli.StringSliceFlag{ + EnvVars: []string{"VELA_RUNTIME_DROP_CAPABILITIES", "RUNTIME_DROP_CAPABILITIES"}, + FilePath: "/vela/runtime/drop_capabilities", + Name: "runtime.drop-capabilities", + Usage: "list of kernel capabilities to drop from container privileges (only used by Docker)", + }, } diff --git a/runtime/setup.go b/runtime/setup.go index 7207f39c..b4dd3f2a 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -6,10 +6,13 @@ package runtime import ( "fmt" + "strings" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" + "github.com/docker/docker/oci/caps" + "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" @@ -42,6 +45,8 @@ type Setup struct { PodsTemplateFile string // specifies a list of privileged images to use for the runtime client PrivilegedImages []string + // specifies a list of kernel capabilities to drop from container (only used by Docker) + DropCapabilities []string } // Docker creates and returns a Vela engine capable of @@ -53,6 +58,7 @@ func (s *Setup) Docker() (Engine, error) { docker.WithHostVolumes(s.HostVolumes), docker.WithPrivilegedImages(s.PrivilegedImages), docker.WithLogger(s.Logger), + docker.WithDropCapabilities(s.DropCapabilities), } if s.Mock { @@ -108,7 +114,23 @@ func (s *Setup) Validate() error { // process the secret driver being provided switch s.Driver { case constants.DriverDocker: - break + // check to make sure drop capabilities is configured correctly + if len(s.DropCapabilities) != 0 { + for _, configCap := range s.DropCapabilities { + valid := false + + for _, validCap := range caps.GetAllCapabilities() { + if strings.EqualFold(configCap, validCap) { + valid = true + break + } + } + + if !valid { + return fmt.Errorf("invalid capability %s provided in RUNTIME_DROP_CAPABILITIES", configCap) + } + } + } case constants.DriverKubernetes: // check if a runtime namespace was provided if len(s.Namespace) == 0 { diff --git a/runtime/setup_test.go b/runtime/setup_test.go index 2484fe2d..ef07452d 100644 --- a/runtime/setup_test.go +++ b/runtime/setup_test.go @@ -76,7 +76,16 @@ func TestRuntime_Validate(t *testing.T) { name: "docker driver", failure: false, setup: &Setup{ - Driver: constants.DriverDocker, + Driver: constants.DriverDocker, + DropCapabilities: []string{"CAP_DAC_OVERRIDE"}, + }, + }, + { + name: "docker driver bad cap", + failure: true, + setup: &Setup{ + Driver: constants.DriverDocker, + DropCapabilities: []string{"BAD"}, }, }, { From 5c0f76964b9e458162f24933ba40dea284ab3448 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:58:52 -0500 Subject: [PATCH 394/430] enhance: operate/exec logging (#461) --- cmd/vela-worker/exec.go | 5 +++-- cmd/vela-worker/operate.go | 18 ++++++++++++++---- cmd/vela-worker/run.go | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index b1bace02..33069499 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -36,12 +36,13 @@ func (w *Worker) exec(index int) error { return nil } - // GET build token from server to setup execBuildClient + // retrieve a build token from the server to setup the execBuildClient bt, _, err := w.VelaClient.Build.GetBuildToken(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber()) if err != nil { - logrus.Errorf("Unable to GetBuildToken: %s", err) + logrus.Errorf("unable to retrieve build token: %s", err) return err } + // set up build client with build token as auth execBuildClient, err := setupClient(w.Config.Server, bt.GetToken()) if err != nil { diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 8a8909a5..74188b10 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -37,8 +37,12 @@ func (w *Worker) operate(ctx context.Context) error { registryWorker.SetBuildLimit(int64(w.Config.Build.Limit)) // pull registration token from configuration if provided; wait if not + logrus.Trace("waiting for register token") + token := <-w.RegisterToken + logrus.Trace("received register token") + // setup the vela client with the token w.VelaClient, err = setupClient(w.Config.Server, token) if err != nil { @@ -50,7 +54,7 @@ func (w *Worker) operate(ctx context.Context) error { for { select { case <-gctx.Done(): - logrus.Info("Completed looping on worker registration") + logrus.Info("completed looping on worker registration") return nil default: // check in attempt loop @@ -70,6 +74,8 @@ func (w *Worker) operate(ctx context.Context) error { // token has expired if expired && len(w.Config.Server.Secret) == 0 { // wait on new registration token, return to check in attempt + logrus.Trace("check-in token has expired, waiting for new register token") + token = <-w.RegisterToken // setup the vela client with the token @@ -83,7 +89,7 @@ func (w *Worker) operate(ctx context.Context) error { // check in failed, token is still valid, retry logrus.Errorf("unable to check-in worker %s on the server: %v", registryWorker.GetHostname(), err) - logrus.Info("retrying...") + logrus.Info("retrying check-in...") time.Sleep(5 * time.Second) @@ -125,7 +131,7 @@ func (w *Worker) operate(ctx context.Context) error { // log a message indicating the start of an operator thread // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Info - logrus.Infof("Thread ID %d listening to queue...", id) + logrus.Infof("thread ID %d listening to queue...", id) // spawn errgroup routine for operator subprocess // @@ -143,9 +149,13 @@ func (w *Worker) operate(ctx context.Context) error { case <-gctx.Done(): logrus.WithFields(logrus.Fields{ "id": id, - }).Info("Completed looping on worker executor") + }).Info("completed looping on worker executor") return nil default: + logrus.WithFields(logrus.Fields{ + "id": id, + }).Info("running worker executor exec") + // exec operator subprocess to poll and execute builds // (do not pass the context to avoid errors in one // executor+build inadvertently canceling other builds) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index f00ce224..41c43df8 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -147,6 +147,8 @@ func run(c *cli.Context) error { // if server secret is provided, use as register token on start up if len(c.String("server.secret")) > 0 { + logrus.Trace("registering worker with embedded server secret") + w.RegisterToken <- c.String("server.secret") } From aaeb1c0a329345df742eb9feb8056f760ca7c3c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:52:34 -0500 Subject: [PATCH 395/430] chore(deps): update actions/setup-go action to v4 (#448) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/reviewdog.yml | 4 ++-- .github/workflows/spec.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/validate.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 985f50f3..e7060541 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index fe0bf035..e25a75f4 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 469e2d70..7ee304e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 9574e121..3e5e9c8e 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 0f7ccefb..c514c3b0 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b71bbd08..6c8f37e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1d46947a..c6a681a0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 - name: install go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: # use version from go.mod file go-version-file: 'go.mod' From 4422859a9e1563716dd80451e90fabf61d98ea81 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:08:11 -0500 Subject: [PATCH 396/430] fix(deps): update deps (patch) (#443) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index d98da806..013b4788 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/go-vela/worker go 1.19 require ( - github.com/Masterminds/semver/v3 v3.2.0 + github.com/Masterminds/semver/v3 v3.2.1 github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v20.10.23+incompatible github.com/docker/go-units v0.5.0 diff --git a/go.sum b/go.sum index 45b794cb..5c45c432 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= From b5b5987f5ba0c2b2de764412a30b6eb02730bdda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:18:17 -0500 Subject: [PATCH 397/430] fix(deps): update module github.com/urfave/cli/v2 to v2.25.1 (#453) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 013b4788..a876709a 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/opencontainers/image-spec v1.0.2 github.com/prometheus/client_golang v1.14.0 github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.24.4 + github.com/urfave/cli/v2 v2.25.1 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 k8s.io/api v0.26.1 diff --git a/go.sum b/go.sum index 5c45c432..0387a75d 100644 --- a/go.sum +++ b/go.sum @@ -407,8 +407,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= -github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= +github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 72de368c7410cb174f316d1cc5177401aa9a8474 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:23:07 -0500 Subject: [PATCH 398/430] fix(deps): update module github.com/docker/docker to v20.10.24+incompatible [security] (#456) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a876709a..30923870 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.23+incompatible + github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb diff --git a/go.sum b/go.sum index 0387a75d..d70bbbb3 100644 --- a/go.sum +++ b/go.sum @@ -102,8 +102,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.23+incompatible h1:1ZQUUYAdh+oylOT85aA2ZcfRp22jmLhoaEcVEfK8dyA= -github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= From e377d3ce8d3739c2db37533b8878310c588ecdff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:29:28 -0500 Subject: [PATCH 399/430] fix(deps): update module github.com/prometheus/client_golang to v1.15.0 (#460) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 12 +++---- go.sum | 100 ++++++++------------------------------------------------- 2 files changed, 19 insertions(+), 93 deletions(-) diff --git a/go.mod b/go.mod index 30923870..9dc73107 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_golang v1.15.0 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.25.1 golang.org/x/sync v0.1.0 @@ -58,7 +58,7 @@ require ( github.com/goccy/go-json v0.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v50 v50.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -77,7 +77,7 @@ require ( github.com/leodido/go-urn v1.2.1 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-isatty v0.0.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect @@ -89,8 +89,8 @@ require ( github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/redis/go-redis/v9 v9.0.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect @@ -113,7 +113,7 @@ require ( golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index d70bbbb3..5a5c8ded 100644 --- a/go.sum +++ b/go.sum @@ -54,17 +54,10 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.0 h1:uA3uhDbCxfO9+DI/DuGeAMr9qI+noVWwGPNTFuKID5M= github.com/alicebob/miniredis/v2 v2.30.0/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ= @@ -75,8 +68,6 @@ github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1 github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= @@ -130,14 +121,6 @@ github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH8 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -156,7 +139,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb h1:JXEolOu+HFktExoDFcGYIdWS9LfPAQnQMIB4Rm48WS0= github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb/go.mod h1:N8qFPxB0RsHrSYr01GVwgOOowtSfhvjXtJ1cRBaeTc4= github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 h1:yJis1sso5c0ZoeZLfZ/lYsjfxU7H9cYP/VJXssRxDa8= @@ -165,7 +147,6 @@ github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c h1:lnCL1knUGvgZQG github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -196,8 +177,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= @@ -267,27 +249,19 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -300,8 +274,8 @@ github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -312,16 +286,12 @@ github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXy github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= @@ -331,39 +301,21 @@ github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrB github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= +github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE= github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -372,10 +324,7 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.4 h1:Sd43wM1IWz/s1aVXdOBkjJvuP8UdyqioeE4AmM0QsBs= @@ -428,7 +377,6 @@ go.starlark.net v0.0.0-20230228032650-dded03209ead h1:qZOFk6/3JiKg5gjRTf4lShf/N0 go.starlark.net v0.0.0-20230228032650-dded03209ead/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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= @@ -476,7 +424,6 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 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= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -484,7 +431,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -507,9 +453,6 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= @@ -523,8 +466,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -542,12 +483,10 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/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= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -557,7 +496,6 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/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-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -570,8 +508,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -580,14 +516,9 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -607,7 +538,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= @@ -764,9 +694,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -776,10 +705,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= From c929b492cc667cbe9cb893895c5e5a41a50553c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 11:55:19 -0500 Subject: [PATCH 400/430] fix(deps): update kubernetes packages to v0.27.1 (#459) * fix(deps): update kubernetes packages to v0.27.1 * fix(deps): update kubernetes packages to v0.27.1 * update runtime k8s container to use proper type for log func * gosimple lint fix --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ecrupper --- go.mod | 28 ++++++------- go.sum | 73 ++++++++++++++++----------------- runtime/kubernetes/container.go | 4 +- 3 files changed, 52 insertions(+), 53 deletions(-) diff --git a/go.mod b/go.mod index 9dc73107..d405ee2c 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/urfave/cli/v2 v2.25.1 golang.org/x/sync v0.1.0 gotest.tools/v3 v3.4.0 - k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.2 - k8s.io/client-go v0.26.1 + k8s.io/api v0.27.1 + k8s.io/apimachinery v0.27.1 + k8s.io/client-go v0.27.1 sigs.k8s.io/yaml v1.3.0 ) @@ -49,9 +49,9 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect @@ -75,7 +75,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect @@ -106,20 +106,20 @@ require ( go.starlark.net v0.0.0-20230228032650-dded03209ead // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect golang.org/x/oauth2 v0.5.0 // indirect golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/term v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect + k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index 5a5c8ded..88fe4e1a 100644 --- a/go.sum +++ b/go.sum @@ -124,14 +124,12 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -139,6 +137,7 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb h1:JXEolOu+HFktExoDFcGYIdWS9LfPAQnQMIB4Rm48WS0= github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb/go.mod h1:N8qFPxB0RsHrSYr01GVwgOOowtSfhvjXtJ1cRBaeTc4= github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 h1:yJis1sso5c0ZoeZLfZ/lYsjfxU7H9cYP/VJXssRxDa8= @@ -216,6 +215,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -261,6 +261,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -268,10 +269,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -292,9 +291,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -319,7 +317,7 @@ github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE= github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -455,8 +453,8 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -530,8 +528,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -540,8 +538,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -598,6 +596,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -699,8 +698,8 @@ google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -724,24 +723,24 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apimachinery v0.26.2 h1:da1u3D5wfR5u2RpLhE/ZtZS2P7QvDgLZTi9wrNZl/tQ= -k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.27.1 h1:Z6zUGQ1Vd10tJ+gHcNNNgkV5emCyW+v2XTmn+CLjSd0= +k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= +k8s.io/apimachinery v0.27.1 h1:EGuZiLI95UQQcClhanryclaQE6xjg1Bts6/L3cD7zyc= +k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= +k8s.io/client-go v0.27.1 h1:oXsfhW/qncM1wDmWBIuDzRHNS2tLhK3BZv512Nc59W8= +k8s.io/client-go v0.27.1/go.mod h1:f8LHMUkVb3b9N8bWturc+EDtVVVwZ7ueTVquFAJb2vA= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg= +k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index e7118de3..b6fa66c0 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -236,7 +236,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // create function for periodically capturing // the logs from the container with backoff - logsFunc := func() (bool, error) { + var logsFunc wait.ConditionFunc = func() (bool, error) { // create options for capturing the logs from the container // // https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#PodLogOptions @@ -298,7 +298,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // perform the function to capture logs with periodic backoff // // https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait?tab=doc#ExponentialBackoff - err := wait.ExponentialBackoffWithContext(ctx, backoff, logsFunc) + err := wait.ExponentialBackoffWithContext(ctx, backoff, logsFunc.WithContext()) if err != nil { c.Logger.Errorf("exponential backoff error while tailing container %s: %v", ctn.ID, err) return nil, err From 1b4ea3b5c4b9f197c5bad18b026e95fe7e728cee Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:40:44 -0600 Subject: [PATCH 401/430] chore(release): upgrade types, server, sdk to v19 rc1 (#463) --- go.mod | 37 +++++++++++++------------- go.sum | 84 ++++++++++++++++++++++++++++++++-------------------------- 2 files changed, 65 insertions(+), 56 deletions(-) diff --git a/go.mod b/go.mod index d405ee2c..10969dfe 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb - github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 - github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c + github.com/go-vela/sdk-go v0.19.0-rc1 + github.com/go-vela/server v0.19.0-rc1 + github.com/go-vela/types v0.19.0-rc1 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 @@ -29,21 +29,23 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.30.0 // indirect + github.com/alicebob/miniredis/v2 v2.30.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect github.com/bytedance/sonic v1.8.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cloudflare/circl v1.1.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect - github.com/drone/envsubst v1.0.3 // indirect + github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect @@ -57,10 +59,10 @@ require ( github.com/go-playground/validator/v10 v10.11.2 // indirect github.com/goccy/go-json v0.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v5 v5.0.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-github/v50 v50.1.0 // indirect + github.com/google/go-github/v51 v51.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -91,26 +93,25 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect - github.com/redis/go-redis/v9 v9.0.2 // indirect + github.com/redis/go-redis/v9 v9.0.3 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/afero v1.9.4 // indirect + github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.2 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.9 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect - go.starlark.net v0.0.0-20230228032650-dded03209ead // indirect + github.com/yuin/gopher-lua v1.1.0 // indirect + go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/oauth2 v0.5.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect diff --git a/go.sum b/go.sum index 88fe4e1a..db587f28 100644 --- a/go.sum +++ b/go.sum @@ -50,20 +50,23 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.0 h1:uA3uhDbCxfO9+DI/DuGeAMr9qI+noVWwGPNTFuKID5M= -github.com/alicebob/miniredis/v2 v2.30.0/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= +github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= +github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ= -github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8= +github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= +github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 h1:Zfkih+Opdv9y5AOob+8iMsaMYnans+Ozrkb8wiPHbj0= github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -77,6 +80,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -100,8 +105,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= -github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= +github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 h1:7QPwrLT79GlD5sizHf27aoY2RTvw62mO6x7mxkScNk0= +github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46/go.mod h1:esf2rsHFNlZlxsqsZDojNBcnNs5REqIvRrWRHqX0vEU= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -138,18 +143,18 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb h1:JXEolOu+HFktExoDFcGYIdWS9LfPAQnQMIB4Rm48WS0= -github.com/go-vela/sdk-go v0.18.2-0.20230327141933-e8d38c73b1bb/go.mod h1:N8qFPxB0RsHrSYr01GVwgOOowtSfhvjXtJ1cRBaeTc4= -github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004 h1:yJis1sso5c0ZoeZLfZ/lYsjfxU7H9cYP/VJXssRxDa8= -github.com/go-vela/server v0.18.2-0.20230324155739-73f83fcfd004/go.mod h1:b+7XeGHO4ynIinY9mpWb6ye9psdwHpsAqMWy5oC+zJ0= -github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c h1:lnCL1knUGvgZQG4YBHSs/CZnxNBfqFUBlGhyq9LO9uk= -github.com/go-vela/types v0.18.2-0.20230321015315-6c723879639c/go.mod h1:6MzMhLaXKSZ9wiJveieqnBd2+4ZMS7yv7+POGSITyS8= +github.com/go-vela/sdk-go v0.19.0-rc1 h1:M/GtDOsSULjBqyPVB0ojkIojYznlp2eHxye9xJPxK58= +github.com/go-vela/sdk-go v0.19.0-rc1/go.mod h1:aD2KMlBOMaY1/ajbQVYyKmgf2HEMOiUEzBgtVQKHCsI= +github.com/go-vela/server v0.19.0-rc1 h1:ld6fNX5EhDL7SL9A/fP8QGuKmgqFy2nERxUNm6bQ1nQ= +github.com/go-vela/server v0.19.0-rc1/go.mod h1:CuPl3qaQxpy8J1YDY6GET0BZd63LKcbbwasK8EJ2F3k= +github.com/go-vela/types v0.19.0-rc1 h1:/l6l3DgqpifDlq30MMunu2V9bVD55vCDTkLSreUrs5k= +github.com/go-vela/types v0.19.0-rc1/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -195,8 +200,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v50 v50.1.0 h1:hMUpkZjklC5GJ+c3GquSqOP/T4BNsB7XohaPhtMOzRk= -github.com/google/go-github/v50 v50.1.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= +github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= +github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -314,8 +319,8 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE= -github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= +github.com/redis/go-redis/v9 v9.0.3 h1:+7mmR26M0IvyLxGZUHxu4GiBkJkVDid0Un+j4ScYu4k= +github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -325,8 +330,8 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.9.4 h1:Sd43wM1IWz/s1aVXdOBkjJvuP8UdyqioeE4AmM0QsBs= -github.com/spf13/afero v1.9.4/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -347,7 +352,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -363,16 +367,16 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= +github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= 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= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20230228032650-dded03209ead h1:qZOFk6/3JiKg5gjRTf4lShf/N0K3acJ95Bg70LsgnHI= -go.starlark.net v0.0.0-20230228032650-dded03209ead/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 h1:Ss6D3hLXTM0KobyBYEAygXzFfGcjnmfEJOBgSbemCtg= +go.starlark.net v0.0.0-20230302034142-4b1e35fe2254/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -382,10 +386,10 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -451,10 +455,11 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -464,8 +469,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -515,31 +520,34 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 7032c8b07372503e94d80b1d201c78b19dfdf596 Mon Sep 17 00:00:00 2001 From: David May <49894298+wass3rw3rk@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:56:48 -0500 Subject: [PATCH 402/430] fix: err shadowing (#464) --- cmd/vela-worker/operate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 74188b10..83ce5d3c 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -65,10 +65,10 @@ func (w *Worker) operate(ctx context.Context) error { // check in failed if err != nil { // check if token is expired - expired, err := w.VelaClient.Authentication.IsTokenAuthExpired() - if err != nil { + expired, expiredErr := w.VelaClient.Authentication.IsTokenAuthExpired() + if expiredErr != nil { logrus.Error("unable to check token expiration") - return err + return expiredErr } // token has expired From 891fc55cf7f79c79b404169d9afc6df29ddca52d Mon Sep 17 00:00:00 2001 From: David May <49894298+wass3rw3rk@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:09:36 -0500 Subject: [PATCH 403/430] fix(register): verify hostname (#465) --- api/register.go | 54 ++++++++++++++++++++++++++++++++ cmd/vela-worker/server.go | 1 + go.mod | 2 +- router/middleware/worker.go | 18 +++++++++++ router/middleware/worker_test.go | 46 +++++++++++++++++++++++++++ 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 router/middleware/worker.go create mode 100644 router/middleware/worker_test.go diff --git a/api/register.go b/api/register.go index 52141c12..ad7c6a4f 100644 --- a/api/register.go +++ b/api/register.go @@ -5,10 +5,12 @@ package api import ( + "fmt" "net/http" "github.com/gin-gonic/gin" "github.com/go-vela/worker/router/middleware/token" + "github.com/golang-jwt/jwt/v5" ) // swagger:operation POST /register system Register @@ -39,6 +41,13 @@ import ( // channel of the worker. This will unblock operation if the worker has not been // registered and the provided registration token is valid. func Register(c *gin.Context) { + // extract the worker hostname that was packed into gin context + w, ok := c.Get("worker-hostname") + if !ok { + c.JSON(http.StatusInternalServerError, "no worker hostname in the context") + return + } + // extract the register token channel that was packed into gin context v, ok := c.Get("register-token") if !ok { @@ -68,8 +77,53 @@ func Register(c *gin.Context) { return } + // extract the subject from the token + sub, err := getSubjectFromToken(token) + if err != nil { + c.JSON(http.StatusUnauthorized, err) + return + } + + // make sure we configured the hostname properly + hostname, ok := w.(string) + if !ok { + c.JSON(http.StatusInternalServerError, "worker hostname in the context is the wrong type") + return + } + + // if the subject doesn't match the worker hostname return an error + if sub != hostname { + c.JSON(http.StatusUnauthorized, "worker hostname is invalid") + return + } + // write registration token to auth token channel rChan <- token c.JSON(http.StatusOK, "successfully passed token to worker") } + +// getSubjectFromToken is a helper function to extract +// the subject from the token claims. +func getSubjectFromToken(token string) (string, error) { + // create a new JWT parser + j := jwt.NewParser() + + // parse the payload + t, _, err := j.ParseUnverified(token, jwt.MapClaims{}) + if err != nil { + return "", fmt.Errorf("unable to parse token") + } + + sub, err := t.Claims.GetSubject() + if err != nil { + return "", fmt.Errorf("unable to get subject from token") + } + + // make sure there was a subject defined + if len(sub) == 0 { + return "", fmt.Errorf("no subject defined in token") + } + + return sub, nil +} diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index 7961fe73..e540fb29 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -31,6 +31,7 @@ func (w *Worker) server() (http.Handler, *tls.Config) { _server := router.Load( middleware.RequestVersion, middleware.ServerAddress(w.Config.Server.Address), + middleware.WorkerHostname(w.Config.API.Address.Hostname()), middleware.Executors(w.Executors), middleware.Logger(logrus.StandardLogger(), time.RFC3339, true), middleware.RegisterToken(w.RegisterToken), diff --git a/go.mod b/go.mod index 10969dfe..48450bed 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/go-vela/sdk-go v0.19.0-rc1 github.com/go-vela/server v0.19.0-rc1 github.com/go-vela/types v0.19.0-rc1 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 @@ -59,7 +60,6 @@ require ( github.com/go-playground/validator/v10 v10.11.2 // indirect github.com/goccy/go-json v0.10.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-github/v51 v51.0.0 // indirect diff --git a/router/middleware/worker.go b/router/middleware/worker.go new file mode 100644 index 00000000..4b8576a8 --- /dev/null +++ b/router/middleware/worker.go @@ -0,0 +1,18 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "github.com/gin-gonic/gin" +) + +// WorkerHostname is a middleware function that attaches the +// worker hostname to the context of every http.Request. +func WorkerHostname(name string) gin.HandlerFunc { + return func(c *gin.Context) { + c.Set("worker-hostname", name) + c.Next() + } +} diff --git a/router/middleware/worker_test.go b/router/middleware/worker_test.go new file mode 100644 index 00000000..7b9294ff --- /dev/null +++ b/router/middleware/worker_test.go @@ -0,0 +1,46 @@ +// Copyright (c) 2023 Target Brands, Inc. All rights reserved. +// +// Use of this source code is governed by the LICENSE file in this repository. + +package middleware + +import ( + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/gin-gonic/gin" +) + +func TestMiddleware_WorkerHostname(t *testing.T) { + // setup types + got := "" + want := "foobar" + + // setup context + gin.SetMode(gin.TestMode) + + resp := httptest.NewRecorder() + context, engine := gin.CreateTestContext(resp) + context.Request, _ = http.NewRequest(http.MethodGet, "/health", nil) + + // setup mock server + engine.Use(WorkerHostname(want)) + engine.GET("/health", func(c *gin.Context) { + got = c.Value("worker-hostname").(string) + + c.Status(http.StatusOK) + }) + + // run test + engine.ServeHTTP(context.Writer, context.Request) + + if resp.Code != http.StatusOK { + t.Errorf("WorkerHostname returned %v, want %v", resp.Code, http.StatusOK) + } + + if !reflect.DeepEqual(got, want) { + t.Errorf("WorkerHostname is %v, want %v", got, want) + } +} From 1b8835b3059c56ec85f7d2b7f1abb6eece60cfcc Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 20 Apr 2023 07:49:12 -0600 Subject: [PATCH 404/430] chore(release): upgrade server and sdk to rc2 (#466) --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 48450bed..38c63e5a 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.0-rc1 - github.com/go-vela/server v0.19.0-rc1 + github.com/go-vela/sdk-go v0.19.0-rc2 + github.com/go-vela/server v0.19.0-rc2 github.com/go-vela/types v0.19.0-rc1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index db587f28..7947534c 100644 --- a/go.sum +++ b/go.sum @@ -143,10 +143,10 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.0-rc1 h1:M/GtDOsSULjBqyPVB0ojkIojYznlp2eHxye9xJPxK58= -github.com/go-vela/sdk-go v0.19.0-rc1/go.mod h1:aD2KMlBOMaY1/ajbQVYyKmgf2HEMOiUEzBgtVQKHCsI= -github.com/go-vela/server v0.19.0-rc1 h1:ld6fNX5EhDL7SL9A/fP8QGuKmgqFy2nERxUNm6bQ1nQ= -github.com/go-vela/server v0.19.0-rc1/go.mod h1:CuPl3qaQxpy8J1YDY6GET0BZd63LKcbbwasK8EJ2F3k= +github.com/go-vela/sdk-go v0.19.0-rc2 h1:IehmJqJFHbed8SLlBbiLeUDFIFQ/FGpRLhRtgIR6Oik= +github.com/go-vela/sdk-go v0.19.0-rc2/go.mod h1:c9DeWbEXFSzSopW6GIIsIm78c4UFHyvMS26Djsvuwpk= +github.com/go-vela/server v0.19.0-rc2 h1:NOocmdHM3Pk+aekF1B7c2tmNzVEmHO54mSeRo94ln8U= +github.com/go-vela/server v0.19.0-rc2/go.mod h1:CuPl3qaQxpy8J1YDY6GET0BZd63LKcbbwasK8EJ2F3k= github.com/go-vela/types v0.19.0-rc1 h1:/l6l3DgqpifDlq30MMunu2V9bVD55vCDTkLSreUrs5k= github.com/go-vela/types v0.19.0-rc1/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= From 4b22ebb065954d755a7a78751e78299d54159fc9 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 25 Apr 2023 10:05:04 -0600 Subject: [PATCH 405/430] chore(release): upgrade sdk, server, types to v0.19.0 for release (#467) --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 38c63e5a..e4114e02 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.0-rc2 - github.com/go-vela/server v0.19.0-rc2 - github.com/go-vela/types v0.19.0-rc1 + github.com/go-vela/sdk-go v0.19.0 + github.com/go-vela/server v0.19.0 + github.com/go-vela/types v0.19.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -34,7 +34,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.30.1 // indirect + github.com/alicebob/miniredis/v2 v2.30.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect github.com/bytedance/sonic v1.8.0 // indirect @@ -62,7 +62,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-github/v51 v51.0.0 // indirect + github.com/google/go-github/v52 v52.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect diff --git a/go.sum b/go.sum index 7947534c..85a0ef35 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= +github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= @@ -143,12 +143,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.0-rc2 h1:IehmJqJFHbed8SLlBbiLeUDFIFQ/FGpRLhRtgIR6Oik= -github.com/go-vela/sdk-go v0.19.0-rc2/go.mod h1:c9DeWbEXFSzSopW6GIIsIm78c4UFHyvMS26Djsvuwpk= -github.com/go-vela/server v0.19.0-rc2 h1:NOocmdHM3Pk+aekF1B7c2tmNzVEmHO54mSeRo94ln8U= -github.com/go-vela/server v0.19.0-rc2/go.mod h1:CuPl3qaQxpy8J1YDY6GET0BZd63LKcbbwasK8EJ2F3k= -github.com/go-vela/types v0.19.0-rc1 h1:/l6l3DgqpifDlq30MMunu2V9bVD55vCDTkLSreUrs5k= -github.com/go-vela/types v0.19.0-rc1/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= +github.com/go-vela/sdk-go v0.19.0 h1:Z+L0f6otWdbhhd8WgN9Sg+fLnvbpwbMO2p9HiynzkX0= +github.com/go-vela/sdk-go v0.19.0/go.mod h1:bpgOW1+L0OoYsh9f6F1cxRFHeXwKoW9sZ2dyEBVkHfs= +github.com/go-vela/server v0.19.0 h1:K5foaD7d5aLvAjb/VJvg9HVRJn8GwFc+YbH8We6/Sck= +github.com/go-vela/server v0.19.0/go.mod h1:i3mJxNj2n6/cNKVaim4dnmc5tKRjT5AgyNsqMOQSS+g= +github.com/go-vela/types v0.19.0 h1:LUNQJjXzcjZ3wh1ACppq9bAvzbLKqPmEDcYFwz+8IAw= +github.com/go-vela/types v0.19.0/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -200,8 +200,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= -github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= +github.com/google/go-github/v52 v52.0.0 h1:uyGWOY+jMQ8GVGSX8dkSwCzlehU3WfdxQ7GweO/JP7M= +github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4zAk2MZTIo+m+4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= From 2d14e4fabcb98801ba8286dc5842f40e3e050a4c Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 26 Apr 2023 13:43:45 -0600 Subject: [PATCH 406/430] chore(release): upgrade types, server, worker to v0.19.1 (#468) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e4114e02..71c14549 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.0 - github.com/go-vela/server v0.19.0 - github.com/go-vela/types v0.19.0 + github.com/go-vela/sdk-go v0.19.1 + github.com/go-vela/server v0.19.1 + github.com/go-vela/types v0.19.1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index 85a0ef35..4401a02c 100644 --- a/go.sum +++ b/go.sum @@ -143,12 +143,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.0 h1:Z+L0f6otWdbhhd8WgN9Sg+fLnvbpwbMO2p9HiynzkX0= -github.com/go-vela/sdk-go v0.19.0/go.mod h1:bpgOW1+L0OoYsh9f6F1cxRFHeXwKoW9sZ2dyEBVkHfs= -github.com/go-vela/server v0.19.0 h1:K5foaD7d5aLvAjb/VJvg9HVRJn8GwFc+YbH8We6/Sck= -github.com/go-vela/server v0.19.0/go.mod h1:i3mJxNj2n6/cNKVaim4dnmc5tKRjT5AgyNsqMOQSS+g= -github.com/go-vela/types v0.19.0 h1:LUNQJjXzcjZ3wh1ACppq9bAvzbLKqPmEDcYFwz+8IAw= -github.com/go-vela/types v0.19.0/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= +github.com/go-vela/sdk-go v0.19.1 h1:dEwsSRDHbC0GM/Xc12UAWqZAsnb+DWhjGxKGNPejzHo= +github.com/go-vela/sdk-go v0.19.1/go.mod h1:TBakoNwVkAWicBTTMP/PuyD98+N/Vq3EkZX7ypWmn3M= +github.com/go-vela/server v0.19.1 h1:hqxYtEypmBmLcx17mH4sg0oB8Wlqfec4gFlENoVmOIg= +github.com/go-vela/server v0.19.1/go.mod h1:/njKScAZl/TKkw0OiLNCMNZII0X//V4p2zWJqSIwUNk= +github.com/go-vela/types v0.19.1 h1:HA5tFwju/o1QbzjhASiDJhvpHmLLmLR9e327kWp0MXg= +github.com/go-vela/types v0.19.1/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From f9c112ac56e0519073f791abb8779b346a5d8a35 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 4 May 2023 09:24:00 -0600 Subject: [PATCH 407/430] chore(release): upgrade server, types, sdk to v0.19.2 (#470) --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 71c14549..b7f9ac9b 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.1 - github.com/go-vela/server v0.19.1 - github.com/go-vela/types v0.19.1 + github.com/go-vela/sdk-go v0.19.2 + github.com/go-vela/server v0.19.2 + github.com/go-vela/types v0.19.2 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -46,7 +46,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/go-connections v0.4.0 // indirect - github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect + github.com/drone/envsubst v1.0.3 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect diff --git a/go.sum b/go.sum index 4401a02c..3a199982 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 h1:7QPwrLT79GlD5sizHf27aoY2RTvw62mO6x7mxkScNk0= -github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46/go.mod h1:esf2rsHFNlZlxsqsZDojNBcnNs5REqIvRrWRHqX0vEU= +github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= +github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -143,12 +143,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.1 h1:dEwsSRDHbC0GM/Xc12UAWqZAsnb+DWhjGxKGNPejzHo= -github.com/go-vela/sdk-go v0.19.1/go.mod h1:TBakoNwVkAWicBTTMP/PuyD98+N/Vq3EkZX7ypWmn3M= -github.com/go-vela/server v0.19.1 h1:hqxYtEypmBmLcx17mH4sg0oB8Wlqfec4gFlENoVmOIg= -github.com/go-vela/server v0.19.1/go.mod h1:/njKScAZl/TKkw0OiLNCMNZII0X//V4p2zWJqSIwUNk= -github.com/go-vela/types v0.19.1 h1:HA5tFwju/o1QbzjhASiDJhvpHmLLmLR9e327kWp0MXg= -github.com/go-vela/types v0.19.1/go.mod h1:BvqapqTPOfHeTLiFYMa/eAzYqnujdPEd358J8TXc7l0= +github.com/go-vela/sdk-go v0.19.2 h1:bEMnEnEZxI27ZCjFx5fNRFc0EYHr2NsR2jb//0J5SJk= +github.com/go-vela/sdk-go v0.19.2/go.mod h1:p0WwKyBLslyhPjSQnA78SVZpLDkOL/P030BtzdRDjtE= +github.com/go-vela/server v0.19.2 h1:b5kQLbQzzY1PQ2/GJN5MHCmlo4wS9C3cyy4fErOl4/o= +github.com/go-vela/server v0.19.2/go.mod h1:N6ej04/c6kc/0sJK15jCLr3Au9L9Zs9TjcMtkJoyJx8= +github.com/go-vela/types v0.19.2 h1:xU61CX2jdMuBCtLOg8a7Z2aEWYM1zZt37Ygx1oHGbjM= +github.com/go-vela/types v0.19.2/go.mod h1:ZvDjYCKU36yJS3sLxPLCny/HLF1U6YtlOienzv/cXB4= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From f47b0d642ddbc9ae7798c115da8db0f9348276c9 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 10 May 2023 08:44:13 -0600 Subject: [PATCH 408/430] enhance(exec): do not kill worker if build has been canceled and build token minting fails (#472) * enhance(exec): do not kill worker if build has been canceled and build token minting fails * change status code to 409 conflict * upgrade server --- cmd/vela-worker/exec.go | 12 ++++++++++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 33069499..2f9e99c6 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,6 +6,7 @@ package main import ( "context" + "net/http" "sync" "time" @@ -19,7 +20,7 @@ import ( // exec is a helper function to poll the queue // and execute Vela pipelines for the Worker. // -//nolint:nilerr // ignore returning nil - don't want to crash worker +//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker func (w *Worker) exec(index int) error { var err error @@ -37,9 +38,16 @@ func (w *Worker) exec(index int) error { } // retrieve a build token from the server to setup the execBuildClient - bt, _, err := w.VelaClient.Build.GetBuildToken(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber()) + bt, resp, err := w.VelaClient.Build.GetBuildToken(item.Repo.GetOrg(), item.Repo.GetName(), item.Build.GetNumber()) if err != nil { logrus.Errorf("unable to retrieve build token: %s", err) + + // build is not in pending state — user canceled build while it was in queue. Pop, discard, move on. + if resp != nil && resp.StatusCode == http.StatusConflict { + return nil + } + + // something else is amiss (auth, server down, etc.) — shut down worker, will have to re-register if registration enabled. return err } diff --git a/go.mod b/go.mod index b7f9ac9b..5cd9d6ff 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.19.2 - github.com/go-vela/server v0.19.2 + github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 github.com/go-vela/types v0.19.2 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 3a199982..50498b1c 100644 --- a/go.sum +++ b/go.sum @@ -145,8 +145,8 @@ github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVL github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.19.2 h1:bEMnEnEZxI27ZCjFx5fNRFc0EYHr2NsR2jb//0J5SJk= github.com/go-vela/sdk-go v0.19.2/go.mod h1:p0WwKyBLslyhPjSQnA78SVZpLDkOL/P030BtzdRDjtE= -github.com/go-vela/server v0.19.2 h1:b5kQLbQzzY1PQ2/GJN5MHCmlo4wS9C3cyy4fErOl4/o= -github.com/go-vela/server v0.19.2/go.mod h1:N6ej04/c6kc/0sJK15jCLr3Au9L9Zs9TjcMtkJoyJx8= +github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 h1:hAj76WkNt+CZfkionu86xlpM3YpupZkX1OWHzWbeEpA= +github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4/go.mod h1:N6ej04/c6kc/0sJK15jCLr3Au9L9Zs9TjcMtkJoyJx8= github.com/go-vela/types v0.19.2 h1:xU61CX2jdMuBCtLOg8a7Z2aEWYM1zZt37Ygx1oHGbjM= github.com/go-vela/types v0.19.2/go.mod h1:ZvDjYCKU36yJS3sLxPLCny/HLF1U6YtlOienzv/cXB4= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= From 73626fb7b579998a631aa8c7b42ae98230c05673 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Wed, 10 May 2023 09:57:42 -0500 Subject: [PATCH 409/430] chore: add vscode project files to gitignore (#469) Co-authored-by: Easton Crupper <65553218+ecrupper@users.noreply.github.com> --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index e050907a..293a312b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,12 @@ release/ *.iws *.xml +# VSCode project folder +.vscode/ + +# VSCode project files +__debug_bin + # Secrets environment file secrets.env From b828b86378782476ce110a5733fefba831ffadb2 Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 11 May 2023 15:39:38 -0500 Subject: [PATCH 410/430] fix: generate example keys --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 31dab459..984d423d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' WORKER_CHECK_IN: 5m - VELA_SIGNING_PUBLIC_KEY: 'FVMNLuknxHlsCh23dLO6HCg6oQxmsOjf6aapAeSZS4Y=' + VELA_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' restart: always ports: - "8081:8080" @@ -74,7 +74,7 @@ services: VELA_ACCESS_TOKEN_DURATION: 60m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' - VELA_SIGNING_PRIVATE_KEY: 'Y9B5lVd5X/qWu931995HitA/u4oGRjxcfXyIO91tex4VUw0u6SfEeWwKHbd0s7ocKDqhDGaw6N/ppqkB5JlLhg==' + VELA_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' env_file: - .env restart: always From 08003228f22bc14240660baf85880764cf0824e7 Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 11 May 2023 15:42:07 -0500 Subject: [PATCH 411/430] tweak: env var naming --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 984d423d..76748503 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' WORKER_CHECK_IN: 5m - VELA_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' + VELA_QUEUE_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' restart: always ports: - "8081:8080" @@ -74,7 +74,7 @@ services: VELA_ACCESS_TOKEN_DURATION: 60m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' - VELA_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' + VELA_QUEUE_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' env_file: - .env restart: always From 715ccf5b1c6613782dbb4bbc68dc97b5ded444e4 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 25 May 2023 07:54:00 -0500 Subject: [PATCH 412/430] feat!: Use queue Item.ItemVersion field to fail stale builds (#478) --- cmd/vela-worker/exec.go | 24 +++++++++++++++++++++++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 2f9e99c6..e04878ea 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -10,10 +10,11 @@ import ( "sync" "time" + "github.com/go-vela/types" + "github.com/go-vela/types/constants" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/version" - "github.com/sirupsen/logrus" ) @@ -70,6 +71,27 @@ func (w *Worker) exec(index int) error { "version": v.Semantic(), }) + // handle stale item queued before a Vela upgrade or downgrade. + if item.ItemVersion != types.ItemVersion { + // If the ItemVersion is older or newer than what we expect, then it might + // not be safe to process the build. Fail the build and loop to the next item. + // TODO: Ask the server to re-compile and requeue the build instead of failing it. + logrus.Errorf("Failing stale queued build due to wrong item version: want %d, got %d", types.ItemVersion, item.ItemVersion) + + build := item.Build + build.SetError("Unable to process stale build (queued before Vela upgrade/downgrade).") + build.SetStatus(constants.StatusError) + build.SetFinished(time.Now().UTC().Unix()) + + _, _, err := w.VelaClient.Build.Update(item.Repo.GetOrg(), item.Repo.GetName(), build) + if err != nil { + logrus.Errorf("Unable to set build status to %s: %s", constants.StatusFailure, err) + return err + } + + return nil + } + // setup the runtime // // https://pkg.go.dev/github.com/go-vela/worker/runtime?tab=doc#New diff --git a/go.mod b/go.mod index 5cd9d6ff..10dce1d6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/gin-gonic/gin v1.9.0 github.com/go-vela/sdk-go v0.19.2 github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 - github.com/go-vela/types v0.19.2 + github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index 50498b1c..9115a567 100644 --- a/go.sum +++ b/go.sum @@ -147,8 +147,8 @@ github.com/go-vela/sdk-go v0.19.2 h1:bEMnEnEZxI27ZCjFx5fNRFc0EYHr2NsR2jb//0J5SJk github.com/go-vela/sdk-go v0.19.2/go.mod h1:p0WwKyBLslyhPjSQnA78SVZpLDkOL/P030BtzdRDjtE= github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 h1:hAj76WkNt+CZfkionu86xlpM3YpupZkX1OWHzWbeEpA= github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4/go.mod h1:N6ej04/c6kc/0sJK15jCLr3Au9L9Zs9TjcMtkJoyJx8= -github.com/go-vela/types v0.19.2 h1:xU61CX2jdMuBCtLOg8a7Z2aEWYM1zZt37Ygx1oHGbjM= -github.com/go-vela/types v0.19.2/go.mod h1:ZvDjYCKU36yJS3sLxPLCny/HLF1U6YtlOienzv/cXB4= +github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c h1:eAApIK5e5MxFF8RzZAFsvTSdwq/AzdUrdhJHOGQ0ILc= +github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c/go.mod h1:0lsuPfGyVyTWJSi2h3NS6uaEW6DgnFvIzaZu1sXYKrs= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From cc7aaf34c821b89b71c7bb1a0306f557316c0e11 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 26 May 2023 10:44:28 -0500 Subject: [PATCH 413/430] feat: add support for schedules (#479) * feat: add support for schedules * chore: update go dependencies * chore: update go deps --- go.mod | 4 ++-- go.sum | 8 ++++---- internal/step/skip.go | 6 ++++++ internal/step/skip_test.go | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 10dce1d6..5403cd7f 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.2 - github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 + github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c + github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0 github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 9115a567..95e90381 100644 --- a/go.sum +++ b/go.sum @@ -143,10 +143,10 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.2 h1:bEMnEnEZxI27ZCjFx5fNRFc0EYHr2NsR2jb//0J5SJk= -github.com/go-vela/sdk-go v0.19.2/go.mod h1:p0WwKyBLslyhPjSQnA78SVZpLDkOL/P030BtzdRDjtE= -github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4 h1:hAj76WkNt+CZfkionu86xlpM3YpupZkX1OWHzWbeEpA= -github.com/go-vela/server v0.19.3-0.20230510141710-f99a894333d4/go.mod h1:N6ej04/c6kc/0sJK15jCLr3Au9L9Zs9TjcMtkJoyJx8= +github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c h1:2GV5t+AOyMYIoyFvzOFCT1dt08KROzaUozK1oW6Q4p0= +github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c/go.mod h1:0XTE3DHG5B872POEhKJ3kZzL8ZvR1jAJSeakeJgjfCM= +github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0 h1:jyNJ1YdYj0YBRcwzyab8yZWBjGt543ATp/eftgPZBoA= +github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0/go.mod h1:sjfqYOyuXG7uqgeQF03URz7GGNjVE+JNIhkGK00eT9o= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c h1:eAApIK5e5MxFF8RzZAFsvTSdwq/AzdUrdhJHOGQ0ILc= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c/go.mod h1:0lsuPfGyVyTWJSi2h3NS6uaEW6DgnFvIzaZu1sXYKrs= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= diff --git a/internal/step/skip.go b/internal/step/skip.go index a341ae0f..4ee0e3e1 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -57,6 +57,12 @@ func Skip(c *pipeline.Container, b *library.Build, r *library.Repo) bool { ruledata.Target = b.GetDeploy() } + // check if the build event is schedule + if strings.EqualFold(b.GetEvent(), constants.EventSchedule) { + // add schedule target information to ruledata + ruledata.Target = b.GetDeploy() + } + // return the inverse of container execute // // https://pkg.go.dev/github.com/go-vela/types/pipeline#Container.Execute diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index 829bbd5c..16a023c6 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -126,6 +126,34 @@ func TestStep_Skip(t *testing.T) { Distribution: vela.String("linux"), } + _schedule := &library.Build{ + ID: vela.Int64(1), + Number: vela.Int(1), + Parent: vela.Int(1), + Event: vela.String("schedule"), + EventAction: vela.String(""), + Status: vela.String("success"), + Error: vela.String(""), + Enqueued: vela.Int64(1563474077), + Created: vela.Int64(1563474076), + Started: vela.Int64(1563474077), + Finished: vela.Int64(0), + Deploy: vela.String(""), + Clone: vela.String("https://github.com/github/octocat.git"), + Source: vela.String("https://github.com/github/octocat/abcdefghi123456789"), + Title: vela.String("push received from https://github.com/github/octocat"), + Message: vela.String("First commit..."), + Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), + Sender: vela.String("OctoKitty"), + Author: vela.String("OctoKitty"), + Branch: vela.String("master"), + Ref: vela.String("refs/heads/master"), + BaseRef: vela.String(""), + Host: vela.String("example.company.com"), + Runtime: vela.String("docker"), + Distribution: vela.String("linux"), + } + _tag := &library.Build{ ID: vela.Int64(1), Number: vela.Int(1), @@ -218,6 +246,13 @@ func TestStep_Skip(t *testing.T) { repo: _repo, want: false, }, + { + name: "schedule", + build: _schedule, + container: _container, + repo: _repo, + want: false, + }, { name: "tag", build: _tag, From ca7dfcc14702e17689c31aa267218e8fd6e3b4ba Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Wed, 7 Jun 2023 09:15:09 -0500 Subject: [PATCH 414/430] chore: vscode gitignore from toptal (#476) --- .gitignore | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 293a312b..1b32e9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -35,12 +35,6 @@ release/ *.iws *.xml -# VSCode project folder -.vscode/ - -# VSCode project files -__debug_bin - # Secrets environment file secrets.env @@ -52,3 +46,28 @@ secrets.env .DS_Store api-spec.json + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix +__debug_bin + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode From 42494ad712bdd6f0ea21e4268d6f04fb46ee45da Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:26:24 -0600 Subject: [PATCH 415/430] enhance(log): no library log return for update calls (#485) --- executor/linux/build.go | 2 +- executor/linux/secret.go | 4 ++-- executor/linux/service.go | 4 ++-- executor/linux/step.go | 4 ++-- go.mod | 4 ++-- go.sum | 8 ++++---- internal/step/snapshot.go | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/executor/linux/build.go b/executor/linux/build.go index 6f77539b..cb55d5be 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -226,7 +226,7 @@ func (c *client) AssembleBuild(ctx context.Context) error { // send API call to update the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep - _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), c.init.Number, _log) + _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), c.init.Number, _log) if err != nil { c.Logger.Errorf("unable to upload %s logs: %v", c.init.Name, err) } diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 137a7aca..986037a2 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -280,7 +280,7 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // send API call to update the logs for the service // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService - _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), ctn.Number, _log) + _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Errorf("unable to upload container logs: %v", err) } @@ -316,7 +316,7 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep //nolint:contextcheck // ignore passing context - _log, _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), s.client.init.Number, _log) + _, err = s.client.Vela.Log.UpdateStep(s.client.repo.GetOrg(), s.client.repo.GetName(), s.client.build.GetNumber(), s.client.init.Number, _log) if err != nil { return err } diff --git a/executor/linux/service.go b/executor/linux/service.go index f340b10e..40dcf310 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -207,7 +207,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService //nolint:contextcheck // ignore passing context - _, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Errorf("unable to upload container logs: %v", err) } @@ -266,7 +266,7 @@ func (c *client) StreamService(ctx context.Context, ctn *pipeline.Container) err // send API call to append the logs for the service // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateService - _log, _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + _, err = c.Vela.Log.UpdateService(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Error(err) } diff --git a/executor/linux/step.go b/executor/linux/step.go index 107c56ce..df0454f2 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -250,7 +250,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep //nolint:contextcheck // ignore passing context - _, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Errorf("unable to upload container logs: %v", err) } @@ -314,7 +314,7 @@ func (c *client) StreamStep(ctx context.Context, ctn *pipeline.Container) error // send API call to append the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogStep.UpdateStep - _log, _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) + _, err = c.Vela.Log.UpdateStep(c.repo.GetOrg(), c.repo.GetName(), c.build.GetNumber(), ctn.Number, _log) if err != nil { logger.Error(err) } diff --git a/go.mod b/go.mod index 5403cd7f..7f0a0864 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v20.10.24+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c - github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0 + github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a + github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 95e90381..8fed181d 100644 --- a/go.sum +++ b/go.sum @@ -143,10 +143,10 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c h1:2GV5t+AOyMYIoyFvzOFCT1dt08KROzaUozK1oW6Q4p0= -github.com/go-vela/sdk-go v0.19.3-0.20230525152744-4c6fc715258c/go.mod h1:0XTE3DHG5B872POEhKJ3kZzL8ZvR1jAJSeakeJgjfCM= -github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0 h1:jyNJ1YdYj0YBRcwzyab8yZWBjGt543ATp/eftgPZBoA= -github.com/go-vela/server v0.19.3-0.20230523191014-5a9a92d279e0/go.mod h1:sjfqYOyuXG7uqgeQF03URz7GGNjVE+JNIhkGK00eT9o= +github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a h1:8ZpMB3fYAyRGKPBq0Y8NltuDjzaD0k8oISjkP0fBP1o= +github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a/go.mod h1:4vnf8+6RVvWmMLaivX1okkA8s2YJxTcqFjIv+z3r5C0= +github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 h1:Vi1y5faOZ5CaCjCTRfc45z+BpR5JgMpLyIxmy7pSgqE= +github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03/go.mod h1:b520o4N7ss4kHATH291Ui1LHwuC0qEgJgg/Jab6yPIQ= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c h1:eAApIK5e5MxFF8RzZAFsvTSdwq/AzdUrdhJHOGQ0ILc= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c/go.mod h1:0lsuPfGyVyTWJSi2h3NS6uaEW6DgnFvIzaZu1sXYKrs= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go index 92c030ec..1b44a653 100644 --- a/internal/step/snapshot.go +++ b/internal/step/snapshot.go @@ -107,7 +107,7 @@ func SnapshotInit(ctn *pipeline.Container, b *library.Build, c *vela.Client, l * // send API call to update the logs for the step // // https://pkg.go.dev/github.com/go-vela/sdk-go/vela?tab=doc#LogService.UpdateStep - _, _, err = c.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber(), lg) + _, err = c.Log.UpdateStep(r.GetOrg(), r.GetName(), b.GetNumber(), s.GetNumber(), lg) if err != nil { l.Errorf("unable to upload step logs: %v", err) } From 4c40a1e8877c205fa7945f90b4516d662a2a6fb2 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 21 Jun 2023 08:35:19 -0600 Subject: [PATCH 416/430] chore(deps): bulk update (#487) --- go.mod | 53 +++++++++++++-------------- go.sum | 111 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 86 insertions(+), 78 deletions(-) diff --git a/go.mod b/go.mod index 7f0a0864..bb71a8d3 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.1 - github.com/docker/distribution v2.8.1+incompatible - github.com/docker/docker v20.10.24+incompatible + github.com/docker/distribution v2.8.2+incompatible + github.com/docker/docker v20.10.25+incompatible github.com/docker/go-units v0.5.0 - github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin v1.9.1 github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c @@ -15,14 +15,14 @@ require ( github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 github.com/opencontainers/image-spec v1.0.2 - github.com/prometheus/client_golang v1.15.0 - github.com/sirupsen/logrus v1.9.0 - github.com/urfave/cli/v2 v2.25.1 - golang.org/x/sync v0.1.0 + github.com/prometheus/client_golang v1.16.0 + github.com/sirupsen/logrus v1.9.3 + github.com/urfave/cli/v2 v2.25.7 + golang.org/x/sync v0.3.0 gotest.tools/v3 v3.4.0 - k8s.io/api v0.27.1 - k8s.io/apimachinery v0.27.1 - k8s.io/client-go v0.27.1 + k8s.io/api v0.27.3 + k8s.io/apimachinery v0.27.3 + k8s.io/client-go v0.27.3 sigs.k8s.io/yaml v1.3.0 ) @@ -37,10 +37,10 @@ require ( github.com/alicebob/miniredis/v2 v2.30.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect - github.com/bytedance/sonic v1.8.0 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/cloudflare/circl v1.1.0 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -49,6 +49,7 @@ require ( github.com/drone/envsubst v1.0.3 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.2.3 // indirect @@ -57,8 +58,8 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/goccy/go-json v0.10.0 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect @@ -75,10 +76,10 @@ require ( github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect - github.com/leodido/go-urn v1.2.1 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.1 // indirect @@ -88,11 +89,11 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/redis/go-redis/v9 v9.0.3 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect @@ -101,16 +102,16 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.9 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect - golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/net v0.9.0 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -119,7 +120,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.90.1 // indirect - k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/go.sum b/go.sum index 8fed181d..ff0935fc 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 h1:Zfkih+Opdv9y5AOo github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835/go.mod h1:AV5wtJnn1/CRaRGlJ8xspkMWfKXV0/pkJVgGleTIrfk= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -80,8 +80,9 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -96,10 +97,10 @@ 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= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= -github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v20.10.25+incompatible h1:URiHXOEOlhi6FS5U+YUE8YnsnZjIV3R+TFezL2ngdW0= +github.com/docker/docker v20.10.25+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -117,12 +118,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -140,8 +143,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a h1:8ZpMB3fYAyRGKPBq0Y8NltuDjzaD0k8oISjkP0fBP1o= github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a/go.mod h1:4vnf8+6RVvWmMLaivX1okkA8s2YJxTcqFjIv+z3r5C0= @@ -149,8 +152,8 @@ github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 h1:Vi1y5faOZ5CaC github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03/go.mod h1:b520o4N7ss4kHATH291Ui1LHwuC0qEgJgg/Jab6yPIQ= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c h1:eAApIK5e5MxFF8RzZAFsvTSdwq/AzdUrdhJHOGQ0ILc= github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c/go.mod h1:0lsuPfGyVyTWJSi2h3NS6uaEW6DgnFvIzaZu1sXYKrs= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= @@ -260,8 +263,9 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -272,12 +276,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -302,23 +306,23 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/redis/go-redis/v9 v9.0.3 h1:+7mmR26M0IvyLxGZUHxu4GiBkJkVDid0Un+j4ScYu4k= github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -328,8 +332,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= @@ -346,20 +350,21 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= -github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -377,8 +382,9 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 h1:Ss6D3hLXTM0KobyBYEAygXzFfGcjnmfEJOBgSbemCtg= go.starlark.net v0.0.0-20230302034142-4b1e35fe2254/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= 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= @@ -388,8 +394,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -458,8 +464,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -482,8 +488,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -525,18 +531,19 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -731,16 +738,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.27.1 h1:Z6zUGQ1Vd10tJ+gHcNNNgkV5emCyW+v2XTmn+CLjSd0= -k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= -k8s.io/apimachinery v0.27.1 h1:EGuZiLI95UQQcClhanryclaQE6xjg1Bts6/L3cD7zyc= -k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= -k8s.io/client-go v0.27.1 h1:oXsfhW/qncM1wDmWBIuDzRHNS2tLhK3BZv512Nc59W8= -k8s.io/client-go v0.27.1/go.mod h1:f8LHMUkVb3b9N8bWturc+EDtVVVwZ7ueTVquFAJb2vA= +k8s.io/api v0.27.3 h1:yR6oQXXnUEBWEWcvPWS0jQL575KoAboQPfJAuKNrw5Y= +k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= +k8s.io/apimachinery v0.27.3 h1:Ubye8oBufD04l9QnNtW05idcOe9Z3GQN8+7PqmuVcUM= +k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.27.3 h1:7dnEGHZEJld3lYwxvLl7WoehK6lAq7GvgjxpA3nv1E8= +k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg= -k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From d9224881dc3a01511d5a212e22ce740b69df151d Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 21 Jun 2023 10:22:26 -0500 Subject: [PATCH 417/430] feat(worker-visibility): allow update to worker table with status and build info (#482) * feat(register-and-operate): add ability for worker to update status to idle and error * docs(README): showing off commitizen cli * feat: update worker status and runningBuildIDs * feat: worker can update runningBuildIDs and status * chore(exec): clean up logging for worker database updates * feat(worker): update last_build_ timestamps in the database * fix(worker-visibility): update error to make logrus happy * chore(worker_visibility): update deps for types and server * Update cmd/vela-worker/register.go Co-authored-by: David May <49894298+wass3rw3rk@users.noreply.github.com> * add res nil check * move res nil above err * add res nil check * more accurate logging * make clean --------- Co-authored-by: Tim Huynh Co-authored-by: David May <49894298+wass3rw3rk@users.noreply.github.com> --- .github/README.md | 1 + cmd/vela-worker/exec.go | 66 ++++++++++++++++++++++++++++++++++++- cmd/vela-worker/operate.go | 28 ++++++++++++++-- cmd/vela-worker/register.go | 5 +++ cmd/vela-worker/run.go | 2 ++ cmd/vela-worker/worker.go | 17 ++++++---- go.mod | 10 +++--- go.sum | 20 +++++------ 8 files changed, 124 insertions(+), 25 deletions(-) diff --git a/.github/README.md b/.github/README.md index 9c23e1e9..ffbb08cd 100644 --- a/.github/README.md +++ b/.github/README.md @@ -38,3 +38,4 @@ Copyright (c) 2022 Target Brands, Inc. ``` [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) + diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index e04878ea..4e336997 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -7,11 +7,13 @@ package main import ( "context" "net/http" + "strconv" "sync" "time" "github.com/go-vela/types" "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/version" @@ -22,7 +24,7 @@ import ( // and execute Vela pipelines for the Worker. // //nolint:nilerr,funlen // ignore returning nil - don't want to crash worker -func (w *Worker) exec(index int) error { +func (w *Worker) exec(index int, config *library.Worker) error { var err error // setup the version @@ -71,6 +73,27 @@ func (w *Worker) exec(index int) error { "version": v.Semantic(), }) + // lock and append the build to the RunningBuildIDs list + w.RunningBuildIDsMutex.Lock() + + w.RunningBuildIDs = append(w.RunningBuildIDs, strconv.Itoa(item.Build.GetNumber())) + + config.SetRunningBuildIDs(w.RunningBuildIDs) + + w.RunningBuildIDsMutex.Unlock() + + // set worker status + updateStatus := w.getWorkerStatusFromConfig(config) + config.SetStatus(updateStatus) + config.SetLastStatusUpdateAt(time.Now().Unix()) + config.SetLastBuildStartedAt(time.Now().Unix()) + + // update worker in the database + _, _, err = w.VelaClient.Worker.Update(config.GetHostname(), config) + if err != nil { + logger.Errorf("unable to update worker: %v", err) + } + // handle stale item queued before a Vela upgrade or downgrade. if item.ItemVersion != types.ItemVersion { // If the ItemVersion is older or newer than what we expect, then it might @@ -154,6 +177,32 @@ func (w *Worker) exec(index int) error { } logger.Info("completed build") + + // lock and remove the build from the RunningBuildIDs list + w.RunningBuildIDsMutex.Lock() + + for i, v := range w.RunningBuildIDs { + if v == strconv.Itoa(item.Build.GetNumber()) { + w.RunningBuildIDs = append(w.RunningBuildIDs[:i], w.RunningBuildIDs[i+1:]...) + } + } + + config.SetRunningBuildIDs(w.RunningBuildIDs) + + w.RunningBuildIDsMutex.Unlock() + + // set worker status + updateStatus := w.getWorkerStatusFromConfig(config) + config.SetStatus(updateStatus) + config.SetLastStatusUpdateAt(time.Now().Unix()) + config.SetLastBuildFinishedAt(time.Now().Unix()) + + // update worker in the database + _, _, err := w.VelaClient.Worker.Update(config.GetHostname(), config) + if err != nil { + logger.Errorf("unable to update worker: %v", err) + } + }() // capture the configured build timeout @@ -222,3 +271,18 @@ func (w *Worker) exec(index int) error { return nil } + +// getWorkerStatusFromConfig is a helper function +// to determine the appropriate worker status +func (w *Worker) getWorkerStatusFromConfig(config *library.Worker) string { + switch rb := len(config.GetRunningBuildIDs()); { + case rb == 0: + return constants.WorkerStatusIdle + case rb < w.Config.Build.Limit: + return constants.WorkerStatusAvailable + case rb == w.Config.Build.Limit: + return constants.WorkerStatusBusy + default: + return constants.WorkerStatusError + } +} diff --git a/cmd/vela-worker/operate.go b/cmd/vela-worker/operate.go index 83ce5d3c..dfd84ed8 100644 --- a/cmd/vela-worker/operate.go +++ b/cmd/vela-worker/operate.go @@ -9,6 +9,7 @@ import ( "time" "github.com/go-vela/server/queue" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/sirupsen/logrus" @@ -118,6 +119,18 @@ func (w *Worker) operate(ctx context.Context) error { //nolint:contextcheck // ignore passing context w.Queue, err = queue.New(w.Config.Queue) if err != nil { + registryWorker.SetStatus(constants.WorkerStatusError) + _, resp, logErr := w.VelaClient.Worker.Update(registryWorker.GetHostname(), registryWorker) + if resp == nil { + // log the error instead of returning so the operation doesn't block worker deployment + logrus.Error("status update response is nil") + } + if logErr != nil { + if resp != nil { + // log the error instead of returning so the operation doesn't block worker deployment + logrus.Errorf("status code: %v, unable to update worker %s status with the server: %v", resp.StatusCode, registryWorker.GetHostname(), logErr) + } + } return err } @@ -160,13 +173,24 @@ func (w *Worker) operate(ctx context.Context) error { // (do not pass the context to avoid errors in one // executor+build inadvertently canceling other builds) //nolint:contextcheck // ignore passing context - err = w.exec(id) + err = w.exec(id, registryWorker) if err != nil { // log the error received from the executor // // https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Errorf logrus.Errorf("failing worker executor: %v", err) - + registryWorker.SetStatus(constants.WorkerStatusError) + _, resp, logErr := w.VelaClient.Worker.Update(registryWorker.GetHostname(), registryWorker) + if resp == nil { + // log the error instead of returning so the operation doesn't block worker deployment + logrus.Error("status update response is nil") + } + if logErr != nil { + if resp != nil { + // log the error instead of returning so the operation doesn't block worker deployment + logrus.Errorf("status code: %v, unable to update worker %s status with the server: %v", resp.StatusCode, registryWorker.GetHostname(), logErr) + } + } return err } } diff --git a/cmd/vela-worker/register.go b/cmd/vela-worker/register.go index e922c745..5621fe1c 100644 --- a/cmd/vela-worker/register.go +++ b/cmd/vela-worker/register.go @@ -8,6 +8,7 @@ import ( "fmt" "net/http" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/sirupsen/logrus" ) @@ -46,12 +47,16 @@ func (w *Worker) checkIn(config *library.Worker) (bool, string, error) { func (w *Worker) register(config *library.Worker) (bool, string, error) { logrus.Infof("worker %s not found, registering it with the server", config.GetHostname()) + config.SetStatus(constants.WorkerStatusIdle) + tkn, _, err := w.VelaClient.Worker.Add(config) if err != nil { // log the error instead of returning so the operation doesn't block worker deployment return false, "", fmt.Errorf("unable to register worker %s with the server: %w", config.GetHostname(), err) } + logrus.Infof("worker %q status updated successfully to %s", config.GetHostname(), config.GetStatus()) + // successfully added the worker so return nil return true, tkn.GetToken(), nil } diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index 41c43df8..76612fac 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -138,6 +138,8 @@ func run(c *cli.Context) error { Executors: make(map[int]executor.Engine), RegisterToken: make(chan string, 1), + + RunningBuildIDs: make([]string, 0), } // set the worker address if no flag was provided diff --git a/cmd/vela-worker/worker.go b/cmd/vela-worker/worker.go index 895fdd19..aecc1a61 100644 --- a/cmd/vela-worker/worker.go +++ b/cmd/vela-worker/worker.go @@ -6,6 +6,7 @@ package main import ( "net/url" + "sync" "time" "github.com/go-vela/sdk-go/vela" @@ -62,12 +63,14 @@ type ( // Worker represents all configuration and // system processes for the worker. Worker struct { - Config *Config - Executors map[int]executor.Engine - Queue queue.Service - Runtime runtime.Engine - VelaClient *vela.Client - RegisterToken chan string - CheckedIn bool + Config *Config + Executors map[int]executor.Engine + Queue queue.Service + Runtime runtime.Engine + VelaClient *vela.Client + RegisterToken chan string + CheckedIn bool + RunningBuildIDs []string + RunningBuildIDsMutex sync.Mutex } ) diff --git a/go.mod b/go.mod index bb71a8d3..6b3b7056 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a - github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 - github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c + github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd + github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -34,7 +34,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.30.2 // indirect + github.com/alicebob/miniredis/v2 v2.30.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect github.com/bytedance/sonic v1.9.1 // indirect @@ -71,7 +71,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -94,7 +94,7 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect - github.com/redis/go-redis/v9 v9.0.3 // indirect + github.com/redis/go-redis/v9 v9.0.5 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/afero v1.9.5 // indirect diff --git a/go.sum b/go.sum index ff0935fc..717304ab 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= -github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw= +github.com/alicebob/miniredis/v2 v2.30.3/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= @@ -148,10 +148,10 @@ github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a h1:8ZpMB3fYAyRGKPBq0Y8NltuDjzaD0k8oISjkP0fBP1o= github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a/go.mod h1:4vnf8+6RVvWmMLaivX1okkA8s2YJxTcqFjIv+z3r5C0= -github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03 h1:Vi1y5faOZ5CaCjCTRfc45z+BpR5JgMpLyIxmy7pSgqE= -github.com/go-vela/server v0.19.3-0.20230609145007-f8c795f7aa03/go.mod h1:b520o4N7ss4kHATH291Ui1LHwuC0qEgJgg/Jab6yPIQ= -github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c h1:eAApIK5e5MxFF8RzZAFsvTSdwq/AzdUrdhJHOGQ0ILc= -github.com/go-vela/types v0.19.3-0.20230523200921-35a0d5fc088c/go.mod h1:0lsuPfGyVyTWJSi2h3NS6uaEW6DgnFvIzaZu1sXYKrs= +github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd h1:cw9iz/4xbq+/lAlHke10RMjfjlPbLk7V8xJ2hqd3dmI= +github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd/go.mod h1:Vjxxn+BP9bvr43uiQtqhDNelajsJzEuIIJTdeRlSiDU= +github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af h1:Ixsa6Ha0j9Edq4v3IooDgyUoGSp08fk9FgrYKuZSML8= +github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -243,8 +243,8 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= 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= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= @@ -323,8 +323,8 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/redis/go-redis/v9 v9.0.3 h1:+7mmR26M0IvyLxGZUHxu4GiBkJkVDid0Un+j4ScYu4k= -github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl5o= +github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= From 410e51b882ec40905203476f79df41c709f709bb Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Wed, 21 Jun 2023 13:08:45 -0600 Subject: [PATCH 418/430] chore(release): upgrade types, server, sdk to v0.20.0-rc1 (#489) --- go.mod | 22 +++++++++++----------- go.sum | 44 ++++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 6b3b7056..393a9d28 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.25+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a - github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd - github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af + github.com/go-vela/sdk-go v0.20.0-rc1 + github.com/go-vela/server v0.20.0-rc1 + github.com/go-vela/types v0.20.0-rc1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -63,7 +63,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-github/v52 v52.0.0 // indirect + github.com/google/go-github/v53 v53.2.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -105,14 +105,14 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect + go.starlark.net v0.0.0-20230612165344-9532f5667272 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/oauth2 v0.9.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect diff --git a/go.sum b/go.sum index 717304ab..11ee8d5c 100644 --- a/go.sum +++ b/go.sum @@ -146,12 +146,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a h1:8ZpMB3fYAyRGKPBq0Y8NltuDjzaD0k8oISjkP0fBP1o= -github.com/go-vela/sdk-go v0.19.3-0.20230609172535-4dfd42c3640a/go.mod h1:4vnf8+6RVvWmMLaivX1okkA8s2YJxTcqFjIv+z3r5C0= -github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd h1:cw9iz/4xbq+/lAlHke10RMjfjlPbLk7V8xJ2hqd3dmI= -github.com/go-vela/server v0.19.3-0.20230616181003-4e5d484be2bd/go.mod h1:Vjxxn+BP9bvr43uiQtqhDNelajsJzEuIIJTdeRlSiDU= -github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af h1:Ixsa6Ha0j9Edq4v3IooDgyUoGSp08fk9FgrYKuZSML8= -github.com/go-vela/types v0.19.3-0.20230614134928-b1b57c0b34af/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= +github.com/go-vela/sdk-go v0.20.0-rc1 h1:GNWpi4GAWUeVqDMhBjThMDFAWScQHmiO/ENCYOKz+6E= +github.com/go-vela/sdk-go v0.20.0-rc1/go.mod h1:JWeATlJ/vEqA6gAJy0sE5+ZWBQeNmzJV6lDg5VGH8Xk= +github.com/go-vela/server v0.20.0-rc1 h1:WgjaXZlT0O32SMm5N14BUPXz2psYJUUtHXIu3aZTYzQ= +github.com/go-vela/server v0.20.0-rc1/go.mod h1:d5aTrrZGyiPZke1dxa/29FwravFEZ4CGhxp5ND9SGxw= +github.com/go-vela/types v0.20.0-rc1 h1:t4tz9YjExtrFMFTq6w+0xWens8b0UPC1kcI642Ta3yc= +github.com/go-vela/types v0.20.0-rc1/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -203,8 +203,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v52 v52.0.0 h1:uyGWOY+jMQ8GVGSX8dkSwCzlehU3WfdxQ7GweO/JP7M= -github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4zAk2MZTIo+m+4= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -380,8 +380,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 h1:Ss6D3hLXTM0KobyBYEAygXzFfGcjnmfEJOBgSbemCtg= -go.starlark.net v0.0.0-20230302034142-4b1e35fe2254/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20230612165344-9532f5667272 h1:2/wtqS591wZyD2OsClsVBKRPEvBsQt/Js+fsCiYhwu8= +go.starlark.net v0.0.0-20230612165344-9532f5667272/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -394,8 +394,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -464,8 +464,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -475,8 +475,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -536,14 +536,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -553,8 +553,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 18615858f3aec8d7090772c4e780f1ee6a96789c Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 29 Jun 2023 09:37:44 -0600 Subject: [PATCH 419/430] fix(compose): use hashicorp/vault docker repo (#490) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8fde3ef5..a5abe138 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -143,7 +143,7 @@ services: # # https://www.vaultproject.io/ vault: - image: vault:latest + image: hashicorp/vault:latest container_name: vault command: server -dev networks: From 2fedfb3e93a22d1a7ed6419e8e7375185ed63045 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 11:47:10 -0500 Subject: [PATCH 420/430] fix(deps): update module gotest.tools/v3 to v3.5.0 (#491) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 393a9d28..2ddc84a5 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/urfave/cli/v2 v2.25.7 golang.org/x/sync v0.3.0 - gotest.tools/v3 v3.4.0 + gotest.tools/v3 v3.5.0 k8s.io/api v0.27.3 k8s.io/apimachinery v0.27.3 k8s.io/client-go v0.27.3 diff --git a/go.sum b/go.sum index 11ee8d5c..aba608b0 100644 --- a/go.sum +++ b/go.sum @@ -729,8 +729,8 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 332a7256b74ba8978c261ee6d2350b0fca312d06 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:54:16 -0600 Subject: [PATCH 421/430] chore(release): bump server and sdk to v0.20.0-rc3 (#492) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 2ddc84a5..50c34468 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v20.10.25+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-vela/sdk-go v0.20.0-rc1 - github.com/go-vela/server v0.20.0-rc1 + github.com/go-vela/sdk-go v0.20.0-rc3 + github.com/go-vela/server v0.20.0-rc3 github.com/go-vela/types v0.20.0-rc1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 @@ -34,7 +34,7 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/alicebob/miniredis/v2 v2.30.3 // indirect + github.com/alicebob/miniredis/v2 v2.30.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect github.com/bytedance/sonic v1.9.1 // indirect diff --git a/go.sum b/go.sum index aba608b0..c7cd34e6 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw= -github.com/alicebob/miniredis/v2 v2.30.3/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= +github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= @@ -146,10 +146,10 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.20.0-rc1 h1:GNWpi4GAWUeVqDMhBjThMDFAWScQHmiO/ENCYOKz+6E= -github.com/go-vela/sdk-go v0.20.0-rc1/go.mod h1:JWeATlJ/vEqA6gAJy0sE5+ZWBQeNmzJV6lDg5VGH8Xk= -github.com/go-vela/server v0.20.0-rc1 h1:WgjaXZlT0O32SMm5N14BUPXz2psYJUUtHXIu3aZTYzQ= -github.com/go-vela/server v0.20.0-rc1/go.mod h1:d5aTrrZGyiPZke1dxa/29FwravFEZ4CGhxp5ND9SGxw= +github.com/go-vela/sdk-go v0.20.0-rc3 h1:PCMyvkxRmqJUjRqjlXLf7URUfyUq3OPH5Q3Zvfs0+J0= +github.com/go-vela/sdk-go v0.20.0-rc3/go.mod h1:edUiPUI/E7YSWIrZt5KLVZwwWiDx2/TrMwzVITOMARw= +github.com/go-vela/server v0.20.0-rc3 h1:eIMdNCbGJa8kpdJuCiEmAEEMRHvrDikRJQeE3hmZsdo= +github.com/go-vela/server v0.20.0-rc3/go.mod h1:XQiU5v8ihviZaNJ5ZwwTWceojHjzlzcrT2t1P8PJxGo= github.com/go-vela/types v0.20.0-rc1 h1:t4tz9YjExtrFMFTq6w+0xWens8b0UPC1kcI642Ta3yc= github.com/go-vela/types v0.20.0-rc1/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= From 5cd946fc518b36863a99164e5957ea6faf88a4f7 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Mon, 17 Jul 2023 11:01:24 -0600 Subject: [PATCH 422/430] chore(release): upgrade types, server, sdk-go to v0.20.0 (#494) --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 50c34468..128a7ef0 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.25+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-vela/sdk-go v0.20.0-rc3 - github.com/go-vela/server v0.20.0-rc3 - github.com/go-vela/types v0.20.0-rc1 + github.com/go-vela/sdk-go v0.20.0 + github.com/go-vela/server v0.20.0 + github.com/go-vela/types v0.20.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -105,7 +105,7 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - go.starlark.net v0.0.0-20230612165344-9532f5667272 // indirect + go.starlark.net v0.0.0-20230712173630-2226322290fc // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.10.0 // indirect golang.org/x/net v0.11.0 // indirect diff --git a/go.sum b/go.sum index c7cd34e6..427b3b1e 100644 --- a/go.sum +++ b/go.sum @@ -146,12 +146,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.20.0-rc3 h1:PCMyvkxRmqJUjRqjlXLf7URUfyUq3OPH5Q3Zvfs0+J0= -github.com/go-vela/sdk-go v0.20.0-rc3/go.mod h1:edUiPUI/E7YSWIrZt5KLVZwwWiDx2/TrMwzVITOMARw= -github.com/go-vela/server v0.20.0-rc3 h1:eIMdNCbGJa8kpdJuCiEmAEEMRHvrDikRJQeE3hmZsdo= -github.com/go-vela/server v0.20.0-rc3/go.mod h1:XQiU5v8ihviZaNJ5ZwwTWceojHjzlzcrT2t1P8PJxGo= -github.com/go-vela/types v0.20.0-rc1 h1:t4tz9YjExtrFMFTq6w+0xWens8b0UPC1kcI642Ta3yc= -github.com/go-vela/types v0.20.0-rc1/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= +github.com/go-vela/sdk-go v0.20.0 h1:+kM2sF/DKibzuHK/4XO0QeRkLgjorpuDkr//P95FhqQ= +github.com/go-vela/sdk-go v0.20.0/go.mod h1:0cgibC9qs9/JheSsU1qHuAecY1njJDwPSE4XeD4gP7c= +github.com/go-vela/server v0.20.0 h1:niU7Hg9/uJRaRuA2VR+Obq2sAbG8iw32esPgTBawZ/g= +github.com/go-vela/server v0.20.0/go.mod h1:l6ToQGKLn9RP9Kcqwyq3JtgkFRhq1nlIKHq/mynkA+E= +github.com/go-vela/types v0.20.0 h1:u/wHwc6ElVbIEI+q9TaVl9Iai1EoEr4Lwis6mikOte8= +github.com/go-vela/types v0.20.0/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -380,8 +380,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20230612165344-9532f5667272 h1:2/wtqS591wZyD2OsClsVBKRPEvBsQt/Js+fsCiYhwu8= -go.starlark.net v0.0.0-20230612165344-9532f5667272/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20230712173630-2226322290fc h1:x7dWtxLF8z8E5/+KkK3MJJTK/kBZhTCLmYCk75rhKxk= +go.starlark.net v0.0.0-20230712173630-2226322290fc/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= From 054b67da8c0843338c4f1a2070687814e84d2177 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:17:02 -0600 Subject: [PATCH 423/430] chore(release): ugprade types, server, sdk to v0.20.1 + other deps (#496) * chore(release): ugprade types, server, sdk to v0.20.1 + other deps * pin to alpine version --- Dockerfile | 2 +- Dockerfile-alpine | 2 +- go.mod | 24 +++++++++++------------ go.sum | 50 +++++++++++++++++++++++------------------------ 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Dockerfile b/Dockerfile index 94738924..4d683692 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # # Use of this source code is governed by the LICENSE file in this repository. -FROM alpine as certs +FROM alpine:3.18.2@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 as certs RUN apk add --update --no-cache ca-certificates diff --git a/Dockerfile-alpine b/Dockerfile-alpine index c1c42c56..6367584e 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -2,7 +2,7 @@ # # Use of this source code is governed by the LICENSE file in this repository. -FROM alpine +FROM alpine:3.18.2@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 RUN apk add --update --no-cache ca-certificates diff --git a/go.mod b/go.mod index 128a7ef0..650b52b8 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/docker/docker v20.10.25+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-vela/sdk-go v0.20.0 - github.com/go-vela/server v0.20.0 - github.com/go-vela/types v0.20.0 + github.com/go-vela/sdk-go v0.20.1 + github.com/go-vela/server v0.20.1 + github.com/go-vela/types v0.20.1 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 @@ -20,9 +20,9 @@ require ( github.com/urfave/cli/v2 v2.25.7 golang.org/x/sync v0.3.0 gotest.tools/v3 v3.5.0 - k8s.io/api v0.27.3 - k8s.io/apimachinery v0.27.3 - k8s.io/client-go v0.27.3 + k8s.io/api v0.27.4 + k8s.io/apimachinery v0.27.4 + k8s.io/client-go v0.27.4 sigs.k8s.io/yaml v1.3.0 ) @@ -105,14 +105,14 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - go.starlark.net v0.0.0-20230712173630-2226322290fc // indirect + go.starlark.net v0.0.0-20230725161458-0d7263928a74 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/net v0.11.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/net v0.12.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect diff --git a/go.sum b/go.sum index 427b3b1e..011680e2 100644 --- a/go.sum +++ b/go.sum @@ -146,12 +146,12 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/go-vela/sdk-go v0.20.0 h1:+kM2sF/DKibzuHK/4XO0QeRkLgjorpuDkr//P95FhqQ= -github.com/go-vela/sdk-go v0.20.0/go.mod h1:0cgibC9qs9/JheSsU1qHuAecY1njJDwPSE4XeD4gP7c= -github.com/go-vela/server v0.20.0 h1:niU7Hg9/uJRaRuA2VR+Obq2sAbG8iw32esPgTBawZ/g= -github.com/go-vela/server v0.20.0/go.mod h1:l6ToQGKLn9RP9Kcqwyq3JtgkFRhq1nlIKHq/mynkA+E= -github.com/go-vela/types v0.20.0 h1:u/wHwc6ElVbIEI+q9TaVl9Iai1EoEr4Lwis6mikOte8= -github.com/go-vela/types v0.20.0/go.mod h1:1ZSmKWX9MamKogwaIb53mzzRpZMV34mJFKiGfVFadFk= +github.com/go-vela/sdk-go v0.20.1 h1:c0i4kzeHtvdZHJwCEIK9SsUUc6oSyynYv66IXw6MRCc= +github.com/go-vela/sdk-go v0.20.1/go.mod h1:LnWNiqcFVv9GARBFLLvgoYycfbi5PI187NrL1FLn8v0= +github.com/go-vela/server v0.20.1 h1:TsAhCj3wqm4kxfq9M6J8+3MmBKlDeJoTr4UGknT9yQw= +github.com/go-vela/server v0.20.1/go.mod h1:M4rSAg8arMhIQYXQpc/ZmMbNW73ur8yE88klMk0Dq9w= +github.com/go-vela/types v0.20.1 h1:hHAX0Iij2J7UZ9f3SlXbwNy481CjKzU9CBfkiLuysVE= +github.com/go-vela/types v0.20.1/go.mod h1:AXO4oQSygOBQ02fPapsKjQHkx2aQO3zTu7clpvVbXBY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -326,7 +326,7 @@ github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPH github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl5o= github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -380,8 +380,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.starlark.net v0.0.0-20230712173630-2226322290fc h1:x7dWtxLF8z8E5/+KkK3MJJTK/kBZhTCLmYCk75rhKxk= -go.starlark.net v0.0.0-20230712173630-2226322290fc/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20230725161458-0d7263928a74 h1:EL8MuNFlzO8vvpHgZxDGPaehP0ozoJ1j1zA768zKXUQ= +go.starlark.net v0.0.0-20230725161458-0d7263928a74/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= @@ -394,8 +394,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -464,8 +464,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -536,14 +536,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -553,8 +553,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -738,12 +738,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.27.3 h1:yR6oQXXnUEBWEWcvPWS0jQL575KoAboQPfJAuKNrw5Y= -k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= -k8s.io/apimachinery v0.27.3 h1:Ubye8oBufD04l9QnNtW05idcOe9Z3GQN8+7PqmuVcUM= -k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= -k8s.io/client-go v0.27.3 h1:7dnEGHZEJld3lYwxvLl7WoehK6lAq7GvgjxpA3nv1E8= -k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= +k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs= +k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y= +k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= +k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.27.4 h1:vj2YTtSJ6J4KxaC88P4pMPEQECWMY8gqPqsTgUKzvjk= +k8s.io/client-go v0.27.4/go.mod h1:ragcly7lUlN0SRPk5/ZkGnDjPknzb37TICq07WhI6Xc= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= From f270db7f9dca4bca7f5935eef74602142ffb4e90 Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 17 Aug 2023 11:46:17 -0500 Subject: [PATCH 424/430] chore: go mod tidy --- go.sum | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go.sum b/go.sum index 0825729e..f51327f1 100644 --- a/go.sum +++ b/go.sum @@ -148,12 +148,8 @@ github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.20.0 h1:+kM2sF/DKibzuHK/4XO0QeRkLgjorpuDkr//P95FhqQ= github.com/go-vela/sdk-go v0.20.0/go.mod h1:0cgibC9qs9/JheSsU1qHuAecY1njJDwPSE4XeD4gP7c= -github.com/go-vela/sdk-go v0.20.1 h1:c0i4kzeHtvdZHJwCEIK9SsUUc6oSyynYv66IXw6MRCc= -github.com/go-vela/sdk-go v0.20.1/go.mod h1:LnWNiqcFVv9GARBFLLvgoYycfbi5PI187NrL1FLn8v0= github.com/go-vela/server v0.20.1-0.20230817163703-032818057b47 h1:fmus9Yq6dcJAl3TooiRZRGhbHweV2FywiQSbJlEwKMs= github.com/go-vela/server v0.20.1-0.20230817163703-032818057b47/go.mod h1:PCebZY9j81a/00TcrpkKGf1mwz1lPW6bASWDAOYV0UI= -github.com/go-vela/server v0.20.1 h1:TsAhCj3wqm4kxfq9M6J8+3MmBKlDeJoTr4UGknT9yQw= -github.com/go-vela/server v0.20.1/go.mod h1:M4rSAg8arMhIQYXQpc/ZmMbNW73ur8yE88klMk0Dq9w= github.com/go-vela/types v0.20.1 h1:hHAX0Iij2J7UZ9f3SlXbwNy481CjKzU9CBfkiLuysVE= github.com/go-vela/types v0.20.1/go.mod h1:AXO4oQSygOBQ02fPapsKjQHkx2aQO3zTu7clpvVbXBY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= From e6651c135387557b94957c8213a8a6b82eb93503 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 25 Aug 2023 11:18:08 -0500 Subject: [PATCH 425/430] chore: reorganize compose vars --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cce27222..15bbe636 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: EXECUTOR_DRIVER: linux QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' + VELA_QUEUE_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' VELA_BUILD_LIMIT: 1 VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace @@ -34,7 +35,6 @@ services: VELA_SERVER_SECRET: 'zB7mrKDTZqNeNTD8z47yG4DHywspAh' WORKER_ADDR: 'http://worker:8080' WORKER_CHECK_IN: 2m - VELA_QUEUE_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' restart: always ports: - "8081:8080" @@ -62,6 +62,7 @@ services: DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' + VELA_QUEUE_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' SCM_DRIVER: github SCM_CONTEXT: 'continuous-integration/vela' SECRET_VAULT: 'true' @@ -78,7 +79,6 @@ services: VELA_WORKER_AUTH_TOKEN_DURATION: 3m VELA_DISABLE_WEBHOOK_VALIDATION: 'true' VELA_ENABLE_SECURE_COOKIE: 'false' - VELA_QUEUE_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' VELA_REPO_ALLOWLIST: '*' env_file: - .env From fff29c6315c7df939262b8ce8a9be7015a12461b Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 25 Aug 2023 11:21:32 -0500 Subject: [PATCH 426/430] chore: simplify queue env variable names --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 15bbe636..80e0b31e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: EXECUTOR_DRIVER: linux QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' - VELA_QUEUE_SIGNING_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' + QUEUE_PUBLIC_KEY: 'DXsJkoTSkHlG26d75LyHJG+KQsXPr8VKPpmH/78zmko=' VELA_BUILD_LIMIT: 1 VELA_BUILD_TIMEOUT: 30m VELA_LOG_LEVEL: trace @@ -62,7 +62,7 @@ services: DATABASE_ENCRYPTION_KEY: 'C639A572E14D5075C526FDDD43E4ECF6' QUEUE_DRIVER: redis QUEUE_ADDR: 'redis://redis:6379' - VELA_QUEUE_SIGNING_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' + QUEUE_PRIVATE_KEY: 'tCIevHOBq6DdN5SSBtteXUusjjd0fOqzk2eyi0DMq04NewmShNKQeUbbp3vkvIckb4pCxc+vxUo+mYf/vzOaSg==' SCM_DRIVER: github SCM_CONTEXT: 'continuous-integration/vela' SECRET_VAULT: 'true' From 77e3acad2e732ad385a3b6341dafc983952c4b0c Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 25 Aug 2023 11:45:48 -0500 Subject: [PATCH 427/430] chore: bump server --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 38492554..4b229814 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 github.com/go-vela/sdk-go v0.20.0 - github.com/go-vela/server v0.20.1-0.20230817163703-032818057b47 - github.com/go-vela/types v0.20.1 + github.com/go-vela/server v0.20.1-0.20230825164412-2187e6b6ed99 + github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index f51327f1..7e009e62 100644 --- a/go.sum +++ b/go.sum @@ -148,10 +148,10 @@ github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.20.0 h1:+kM2sF/DKibzuHK/4XO0QeRkLgjorpuDkr//P95FhqQ= github.com/go-vela/sdk-go v0.20.0/go.mod h1:0cgibC9qs9/JheSsU1qHuAecY1njJDwPSE4XeD4gP7c= -github.com/go-vela/server v0.20.1-0.20230817163703-032818057b47 h1:fmus9Yq6dcJAl3TooiRZRGhbHweV2FywiQSbJlEwKMs= -github.com/go-vela/server v0.20.1-0.20230817163703-032818057b47/go.mod h1:PCebZY9j81a/00TcrpkKGf1mwz1lPW6bASWDAOYV0UI= -github.com/go-vela/types v0.20.1 h1:hHAX0Iij2J7UZ9f3SlXbwNy481CjKzU9CBfkiLuysVE= -github.com/go-vela/types v0.20.1/go.mod h1:AXO4oQSygOBQ02fPapsKjQHkx2aQO3zTu7clpvVbXBY= +github.com/go-vela/server v0.20.1-0.20230825164412-2187e6b6ed99 h1:EEpozU4JCB5Su6mjK4b2FXLxZUzgndU3V3lbkIJ2iLE= +github.com/go-vela/server v0.20.1-0.20230825164412-2187e6b6ed99/go.mod h1:MhGhkxKIAzFD+ThVay++Api7uW6XZzHqH0BnzCke5+w= +github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d h1:ag6trc3Ev+7hzifeWy0M9rHHjrO9nFCYgW8dlKdZ4j4= +github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d/go.mod h1:AXO4oQSygOBQ02fPapsKjQHkx2aQO3zTu7clpvVbXBY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= From f1b747313b1ace970f92ca144c5545e901fbd731 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 25 Aug 2023 11:48:58 -0500 Subject: [PATCH 428/430] chore: tweak var naming --- cmd/vela-worker/run.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index bc4b59c8..9b01f543 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -116,12 +116,12 @@ func run(c *cli.Context) error { }, // queue configuration Queue: &queue.Setup{ - Driver: c.String("queue.driver"), - Address: c.String("queue.addr"), - Cluster: c.Bool("queue.cluster"), - Routes: c.StringSlice("queue.routes"), - Timeout: c.Duration("queue.pop.timeout"), - EncodedSigningPublicKey: c.String("queue.signing.public-key"), + Driver: c.String("queue.driver"), + Address: c.String("queue.addr"), + Cluster: c.Bool("queue.cluster"), + Routes: c.StringSlice("queue.routes"), + Timeout: c.Duration("queue.pop.timeout"), + PublicKey: c.String("queue.public-key"), }, // server configuration Server: &Server{ From 45de44203167d34a3a98ca8de318f670a9985c49 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 25 Aug 2023 11:54:16 -0500 Subject: [PATCH 429/430] todo: build executables types change --- cmd/vela-worker/exec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 81190db7..90e9d3ad 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -149,10 +149,11 @@ func (w *Worker) exec(index int, config *library.Worker) error { Hostname: w.Config.API.Address.Hostname(), Runtime: w.Runtime, Build: item.Build, - Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), - Repo: item.Repo, - User: item.User, - Version: v.Semantic(), + // todo: implement build executables + // Pipeline: item.Pipeline.Sanitize(w.Config.Runtime.Driver), + Repo: item.Repo, + User: item.User, + Version: v.Semantic(), }) // add the executor to the worker From 50ccf9b43174bdd7699122a85d8ae449ee028d21 Mon Sep 17 00:00:00 2001 From: davidvader Date: Tue, 29 Aug 2023 11:00:34 -0500 Subject: [PATCH 430/430] chore: go mod tidy --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6e4c1dd7..5562ad5b 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.9.1 github.com/go-vela/sdk-go v0.20.2-0.20230824133536-0b0212b996f5 - github.com/go-vela/server v0.20.1 + github.com/go-vela/server v0.20.1-0.20230829140453-5df4993e51a1 github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 61e62003..bd5cf534 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,8 @@ github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-vela/sdk-go v0.20.2-0.20230824133536-0b0212b996f5 h1:PfGWo9Yzv6xfHYSYYArlsrWfs3cvOlBopCjHyHi/SPs= github.com/go-vela/sdk-go v0.20.2-0.20230824133536-0b0212b996f5/go.mod h1:j7DFviaUd+XArpFr9KoHLWwUXRyFYAiZvPPF42gktoA= -github.com/go-vela/server v0.20.1 h1:TsAhCj3wqm4kxfq9M6J8+3MmBKlDeJoTr4UGknT9yQw= -github.com/go-vela/server v0.20.1/go.mod h1:M4rSAg8arMhIQYXQpc/ZmMbNW73ur8yE88klMk0Dq9w= +github.com/go-vela/server v0.20.1-0.20230829140453-5df4993e51a1 h1:dYJ8FNJeyARCi7Ok2yET6H97wVKszl3lvMV6EwVpbug= +github.com/go-vela/server v0.20.1-0.20230829140453-5df4993e51a1/go.mod h1:MhGhkxKIAzFD+ThVay++Api7uW6XZzHqH0BnzCke5+w= github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d h1:ag6trc3Ev+7hzifeWy0M9rHHjrO9nFCYgW8dlKdZ4j4= github.com/go-vela/types v0.20.2-0.20230822144153-14b37585731d/go.mod h1:AXO4oQSygOBQ02fPapsKjQHkx2aQO3zTu7clpvVbXBY= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=