From c8dad53b0ea7abb4d7910f84862cb705c7057356 Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:00:43 -0400 Subject: [PATCH] chore(patch-release-prep): upgrade types, server, sdk to v0.20.2 (#506) * chore(patch-release-prep): upgrade types, server, sdk to v0.20.2 * fix tests by using VELA_BUILD_EVENT --- executor/linux/secret_test.go | 44 +++++++++++++++++------------------ go.mod | 6 ++--- go.sum | 12 +++++----- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index e88d23b2..036b3615 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -1010,104 +1010,104 @@ func TestLinux_Secret_injectSecret(t *testing.T) { name: "secret with matching push event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"push"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "push"}, + Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "push"}, }, }, { name: "secret with non-matching push event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, }, }, { // 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"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "pull_request"}, }, }, { 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"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "pull_request"}, }, }, { // tag event checks name: "secret with matching tag event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "tag"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "tag"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Events: &[]string{"tag"}}}, want: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"FOO": "foo", "BUILD_EVENT": "tag"}, + Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "tag"}, }, }, { name: "secret with non-matching tag event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "tag"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "tag"}, }, }, { // deployment event checks name: "secret with matching deployment event ACL injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "deployment"}, }, }, { name: "secret with non-matching deployment event ACL not injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "deployment"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "deployment"}, }, }, @@ -1116,39 +1116,39 @@ func TestLinux_Secret_injectSecret(t *testing.T) { 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"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, }, }, { 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"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, }, }, { name: "secret with matching event ACL and matching image ACL injected", step: &pipeline.Container{ Image: "alpine:latest", - Environment: map[string]string{"BUILD_EVENT": "push"}, + Environment: map[string]string{"VELA_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"}, + Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "push"}, }, }, } diff --git a/go.mod b/go.mod index 650b52b8..ec7b5460 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.1 - github.com/go-vela/server v0.20.1 - github.com/go-vela/types v0.20.1 + github.com/go-vela/sdk-go v0.20.2 + github.com/go-vela/server v0.20.2 + github.com/go-vela/types v0.20.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 diff --git a/go.sum b/go.sum index 011680e2..ee35d117 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.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/go-vela/sdk-go v0.20.2 h1:NW5m7Efu4bO6a3R1pZH972OfuCTXuyEQCMs4h/ClS/8= +github.com/go-vela/sdk-go v0.20.2/go.mod h1:JmJeroTgIQR0hR5liRESYmwtK6FyfvimoNwNGFfI8M0= +github.com/go-vela/server v0.20.2 h1:PkPkZq98hsqbEUkkYRnyX5V80rAR7Qh5nHKlgH7jE4s= +github.com/go-vela/server v0.20.2/go.mod h1:GvJ3E3AGbMGxJGaDXev853Te6G0msNqhYdm6bEnne8E= +github.com/go-vela/types v0.20.2 h1:PnyKJareZTEvVoAOe48tRnOMETVtpm+5JdHqOsMA0v0= +github.com/go-vela/types v0.20.2/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=