Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump tektoncd/pipelines dependency to v0.45 #712

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/sigstore/sigstore v1.5.1
github.com/spiffe/go-spiffe/v2 v2.1.2
github.com/stretchr/testify v1.8.1
github.com/tektoncd/pipeline v0.44.0
github.com/tektoncd/pipeline v0.45.0
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399
go.uber.org/atomic v1.10.0
Expand Down Expand Up @@ -425,12 +425,12 @@ require (
go.mongodb.org/mongo-driver v1.11.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0 // indirect
go.opentelemetry.io/otel v1.11.1 // indirect
go.opentelemetry.io/otel v1.13.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.1 // indirect
go.opentelemetry.io/otel/sdk v1.11.1 // indirect
go.opentelemetry.io/otel/trace v1.11.1 // indirect
go.opentelemetry.io/otel/sdk v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/automaxprocs v1.5.1 // indirect
go.uber.org/multierr v1.8.0 // indirect
Expand Down
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0
github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s=
github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE=
github.com/containerd/containerd v1.6.15 h1:4wWexxzLNHNE46aIETc6ge4TofO550v+BlLoANrbses=
github.com/containerd/containerd v1.6.17 h1:XDnJIeJW0cLf6v7/+N+6L9kGrChHeXekZp2VHu6OpiY=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
Expand Down Expand Up @@ -1196,6 +1197,7 @@ github.com/go-critic/go-critic v0.6.5 h1:fDaR/5GWURljXwF8Eh31T2GZNz9X4jeboS912mW
github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/go-billy/v5 v5.4.0 h1:Vaw7LaSTRJOUric7pe4vnzBSgyuf2KrLsu2Y4ZpQBDE=
github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4=
github.com/go-git/go-git/v5 v5.5.2 h1:v8lgZa5k9ylUw+OR/roJHTxR4QItsNFI5nKtAXFuynw=
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=
Expand Down Expand Up @@ -1822,6 +1824,7 @@ github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b/go.mod h1:hQm
github.com/jellydator/ttlcache/v2 v2.11.1 h1:AZGME43Eh2Vv3giG6GeqeLeFXxwxn1/qHItqWZl6U64=
github.com/jellydator/ttlcache/v2 v2.11.1/go.mod h1:RtE5Snf0/57e+2cLWFYWCCsLas2Hy3c5Z4n14XmSvTI=
github.com/jenkins-x/go-scm v1.12.3 h1:9l0IeFnDrmgTsbgUAE1wgzcqdrpYIRWCAlIRm+1LBoI=
github.com/jenkins-x/go-scm v1.13.2 h1:+jzbfA7E8dtKnrncTxYfC9r+Hwyve6x5ErzqZSHUBa4=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM=
Expand Down Expand Up @@ -2566,6 +2569,8 @@ github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTB
github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0=
github.com/tektoncd/pipeline v0.44.0 h1:gTiLCjTDDog3R9sRtQugiIZYqadmq5K6HArrtM1sHkU=
github.com/tektoncd/pipeline v0.44.0/go.mod h1:z8D9m9nnG2JQGHTpRw/sie9tK37odai/iONmYaY7llA=
github.com/tektoncd/pipeline v0.45.0 h1:Hv9kyutu5GWGXKtcMrM7PXdAULgeQc0F2HWDNg+jo5c=
github.com/tektoncd/pipeline v0.45.0/go.mod h1:20Xs6qk3BTpsLHYWEtLNPM44XKqNH5jYwoomXHOGNs8=
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 h1:YsjQ83UBIIq4k/s2PzQ6pqe4tpPtm1hia3oyNBDDrDU=
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7/go.mod h1:uJBaI0AL/kjPThiMYZcWRujEz7D401v643d6s/21GAg=
github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA=
Expand Down Expand Up @@ -2786,6 +2791,8 @@ go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOU
go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ=
go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4=
go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE=
go.opentelemetry.io/otel v1.13.0 h1:1ZAKnNQKwBBxFtww/GwxNUyTf0AxkZzrukO8MeXqe4Y=
go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg=
go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.1/go.mod h1:NEu79Xo32iVb+0gVNV8PMd7GoWqnyDXRlj04yFjqz40=
Expand All @@ -2811,6 +2818,8 @@ go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1t
go.opentelemetry.io/otel/sdk v1.6.1/go.mod h1:IVYrddmFZ+eJqu2k38qD3WezFR2pymCzm8tdxyh3R4E=
go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs=
go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys=
go.opentelemetry.io/otel/sdk v1.13.0 h1:BHib5g8MvdqS65yo2vV1s6Le42Hm6rrw08qU6yz5JaM=
go.opentelemetry.io/otel/sdk v1.13.0/go.mod h1:YLKPx5+6Vx/o1TCUYYs+bpymtkmazOMT6zoRrC7AQ7I=
go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE=
go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE=
go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
Expand All @@ -2819,6 +2828,8 @@ go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qE
go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0=
go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ=
go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk=
go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFhfBSdY=
go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ=
go.opentelemetry.io/proto/otlp v0.12.1/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
Expand Down
17 changes: 2 additions & 15 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,8 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, pr *v1beta1.PipelineRun)

// Get TaskRun names depending on whether embeddedstatus feature is set or not
var trs []string
if len(pr.Status.ChildReferences) == 0 || len(pr.Status.TaskRuns) > 0 || len(pr.Status.Runs) > 0 {
for trName, ptrs := range pr.Status.TaskRuns {
// TaskRuns within a PipelineRun may not have been finalized yet if the PipelineRun timeout
// has exceeded. Wait to process the PipelineRun on the next update, see
// https://github.com/tektoncd/pipeline/issues/4916
if ptrs.Status == nil || ptrs.Status.CompletionTime == nil {
logging.FromContext(ctx).Infof("taskrun %s within pipelinerun is not yet finalized: embedded status is not complete", trName)
return nil
}
trs = append(trs, trName)
}
} else {
for _, cr := range pr.Status.ChildReferences {
trs = append(trs, cr.Name)
}
for _, cr := range pr.Status.ChildReferences {
trs = append(trs, cr.Name)
}

// Signing both taskruns and pipelineruns causes a race condition when using oci storage
Expand Down
30 changes: 9 additions & 21 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,10 @@ func TestReconciler_handlePipelineRun(t *testing.T) {
Conditions: []apis.Condition{{Type: apis.ConditionSucceeded}},
},
PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{
TaskRuns: map[string]*v1beta1.PipelineRunTaskRunStatus{
"taskrun1": {
ChildReferences: []v1beta1.ChildStatusReference{
v1beta1.ChildStatusReference{
Name: "taskrun1",
PipelineTaskName: "task1",
Status: &v1beta1.TaskRunStatus{
TaskRunStatusFields: v1beta1.TaskRunStatusFields{
CompletionTime: &metav1.Time{},
},
},
},
},
},
Expand Down Expand Up @@ -217,14 +213,10 @@ func TestReconciler_handlePipelineRun(t *testing.T) {
Conditions: []apis.Condition{{Type: apis.ConditionSucceeded}},
},
PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{
TaskRuns: map[string]*v1beta1.PipelineRunTaskRunStatus{
"taskrun1": {
ChildReferences: []v1beta1.ChildStatusReference{
v1beta1.ChildStatusReference{
Name: "taskrun1",
PipelineTaskName: "task1",
Status: &v1beta1.TaskRunStatus{
TaskRunStatusFields: v1beta1.TaskRunStatusFields{
CompletionTime: &metav1.Time{},
},
},
},
},
},
Expand Down Expand Up @@ -254,14 +246,10 @@ func TestReconciler_handlePipelineRun(t *testing.T) {
Conditions: []apis.Condition{{Type: apis.ConditionSucceeded}},
},
PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{
TaskRuns: map[string]*v1beta1.PipelineRunTaskRunStatus{
"taskrun1": {
ChildReferences: []v1beta1.ChildStatusReference{
v1beta1.ChildStatusReference{
Name: "taskrun1",
PipelineTaskName: "task1",
Status: &v1beta1.TaskRunStatus{
TaskRunStatusFields: v1beta1.TaskRunStatusFields{
CompletionTime: &metav1.Time{},
},
},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ header "Setting up environment"
# Test against nightly instead of latest.
install_tkn

export RELEASE_YAML="https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.40.0/release.yaml"
export RELEASE_YAML="https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.45.0/release.yaml"
install_pipeline_crd

install_chains
Expand Down
19 changes: 17 additions & 2 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,15 @@ func TestProvenanceMaterials(t *testing.T) {
},
},
}

if test.name == "pipelinerun" {
pr := signedObj.GetObject().(*v1beta1.PipelineRun)
for _, trStatus := range pr.Status.TaskRuns {
for _, step := range trStatus.Status.Steps {
for _, cr := range pr.Status.ChildReferences {
taskRun, err := c.PipelineClient.TektonV1beta1().TaskRuns(ns).Get(ctx, cr.Name, metav1.GetOptions{})
if err != nil {
t.Errorf("Did not expect an error but got %v", err)
}
for _, step := range taskRun.Status.Steps {
want = append(want, provenance.ProvenanceMaterial{
URI: strings.Split(step.ImageID, "@")[0],
Digest: provenance.DigestSet{
Expand All @@ -783,6 +788,16 @@ func TestProvenanceMaterials(t *testing.T) {
})
}
}
} else {
tr := signedObj.GetObject().(*v1beta1.TaskRun)
for _, step := range tr.Status.Steps {
want = append(want, provenance.ProvenanceMaterial{
URI: strings.Split(step.ImageID, "@")[0],
Digest: provenance.DigestSet{
"sha256": strings.Split(step.ImageID, ":")[1],
},
})
}
}
got := predicate.Materials

Expand Down
25 changes: 15 additions & 10 deletions test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import (
"github.com/tektoncd/chains/pkg/chains/objects"
"github.com/tektoncd/chains/pkg/test/tekton"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
Expand Down Expand Up @@ -143,7 +145,7 @@ func runInTotoFormatterTests(ctx context.Context, t *testing.T, ns string, c *cl
if err := json.Unmarshal(payload, &gotProvenance); err != nil {
t.Fatal(err)
}
expected := expectedProvenance(t, path, completed, test.outputLocation)
expected := expectedProvenance(t, ctx, path, completed, test.outputLocation, ns, c)

opts := []cmp.Option{
// Annotations and labels may contain release specific information. Ignore
Expand Down Expand Up @@ -200,12 +202,12 @@ func (v *verifier) Public() crypto.PublicKey {
return v.pub
}

func expectedProvenance(t *testing.T, example string, obj objects.TektonObject, outputLocation string) intoto.ProvenanceStatement {
func expectedProvenance(t *testing.T, ctx context.Context, example string, obj objects.TektonObject, outputLocation string, ns string, c *clients) intoto.ProvenanceStatement {
switch obj.(type) {
case *objects.TaskRunObject:
return expectedTaskRunProvenance(t, example, obj, outputLocation)
case *objects.PipelineRunObject:
return expectedPipelineRunProvenance(t, example, obj, outputLocation)
return expectedPipelineRunProvenance(t, ctx, example, obj, outputLocation, ns, c)
default:
t.Error("Unexpected type trying to get provenance")
}
Expand Down Expand Up @@ -265,7 +267,7 @@ func expectedTaskRunProvenance(t *testing.T, example string, obj objects.TektonO
return readExpectedAttestation(t, example, f, outputLocation)
}

func expectedPipelineRunProvenance(t *testing.T, example string, obj objects.TektonObject, outputLocation string) intoto.ProvenanceStatement {
func expectedPipelineRunProvenance(t *testing.T, ctx context.Context, example string, obj objects.TektonObject, outputLocation string, ns string, c *clients) intoto.ProvenanceStatement {
pr := obj.GetObject().(*v1beta1.PipelineRun)

buildStartTimes := []string{}
Expand All @@ -274,10 +276,14 @@ func expectedPipelineRunProvenance(t *testing.T, example string, obj objects.Tek
uriDigestSet := make(map[string]bool)

// TODO: Load TaskRun data from ChildReferences.
for _, trStatus := range pr.Status.TaskRuns {
buildStartTimes = append(buildStartTimes, trStatus.Status.StartTime.Time.UTC().Format(time.RFC3339))
buildFinishedTimes = append(buildFinishedTimes, trStatus.Status.CompletionTime.Time.UTC().Format(time.RFC3339))
for _, step := range trStatus.Status.Steps {
for _, cr := range pr.Status.ChildReferences {
taskRun, err := c.PipelineClient.TektonV1beta1().TaskRuns(ns).Get(ctx, cr.Name, metav1.GetOptions{})
if err != nil {
t.Errorf("Did not expect an error but got %v", err)
}
buildStartTimes = append(buildStartTimes, taskRun.Status.StartTime.Time.UTC().Format(time.RFC3339))
buildFinishedTimes = append(buildFinishedTimes, taskRun.Status.CompletionTime.Time.UTC().Format(time.RFC3339))
for _, step := range taskRun.Status.Steps {
// append uri and digest that havent already been appended
uri := strings.Split(step.ImageID, "@")[0]
digest := strings.Split(step.ImageID, ":")[1]
Expand All @@ -287,7 +293,7 @@ func expectedPipelineRunProvenance(t *testing.T, example string, obj objects.Tek
uriDigestSet[uriDigest] = true
}
}
for _, sidecar := range trStatus.Status.Sidecars {
for _, sidecar := range taskRun.Status.Sidecars {
// append uri and digest that havent already been appended
uri := strings.Split(sidecar.ImageID, "@")[0]
digest := strings.Split(sidecar.ImageID, ":")[1]
Expand All @@ -313,7 +319,6 @@ func expectedPipelineRunProvenance(t *testing.T, example string, obj objects.Tek
func readExpectedAttestation(t *testing.T, example string, f Format, outputLocation string) intoto.ProvenanceStatement {
path := filepath.Join("testdata", outputLocation, strings.Replace(filepath.Base(example), ".yaml", ".json", 1))
t.Logf("Reading expected provenance from %s", path)

contents, err := ioutil.ReadFile(path)
if err != nil {
t.Fatal(err)
Expand Down
Loading