Skip to content

Commit 8c6f7be

Browse files
chuangw6JeromeJu
authored andcommitted
Add Provenance field in TaskRun&PipelineRun status
Change 1: Add a Provenance field in TaskRun&PipelineRun status. This field currently only contains a subfield named `ConfigSource`, but can be extended later to have more provenance-related fields. Change 2: Prior, tektoncd#5551 introduced the ConfigSource to api/resolution alpha & beta package. In this PR, we moved the ConfigSource to api/pipeline alpha & beta package for the provenance field to reuse that type (cannot import the api/resolution alpha because of import cycle). Why: See the motivation and discussions in tektoncd#5550. The tldr is that it helps pass provenance-related data in a more structured way ConfigSource is one example. Signed-off-by: Chuang Wang <chuangw@google.com>
1 parent 116431d commit 8c6f7be

30 files changed

+760
-293
lines changed

docs/how-to-write-a-resolver.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ We'll also need to add another import for this package at the top:
186186
import (
187187
"context"
188188

189-
"github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1"
190-
// Add this one; it defines LabelKeyResolverType we use in GetSelector
189+
// Add this one; it defines LabelKeyResolverType we use in GetSelector
191190
"github.com/tektoncd/pipeline/pkg/resolution/common"
192191
"github.com/tektoncd/pipeline/pkg/resolution/resolver/framework"
193192
"knative.dev/pkg/injection/sharedmain"
193+
pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
194194
)
195195
```
196196

@@ -262,7 +262,7 @@ func (*myResolvedResource) Annotations() map[string]string {
262262

263263
// Source is the source reference of the remote data that records where the remote
264264
// file came from including the url, digest and the entrypoint. None atm.
265-
func (*myResolvedResource) Source() *v1beta1.ConfigSource {
265+
func (*myResolvedResource) Source() *pipelinev1beta1.ConfigSource {
266266
return nil
267267
}
268268
```
@@ -275,8 +275,8 @@ following example.
275275
```go
276276
// Source is the source reference of the remote data that records where the remote
277277
// file came from including the url, digest and the entrypoint.
278-
func (*myResolvedResource) Source() *v1beta1.ConfigSource {
279-
return &v1beta1.ConfigSource{
278+
func (*myResolvedResource) Source() *pipelinev1beta1.ConfigSource {
279+
return &v1alpha1.ConfigSource{
280280
URI: "https://github.com/user/example",
281281
Digest: map[string]string{
282282
"sha1": "example",

0 commit comments

Comments
 (0)