---
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=