Skip to content

Commit

Permalink
Add Provenance field in TaskRun&PipelineRun status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chuangw6 committed Oct 14, 2022
1 parent 5a0bd42 commit 8970bdd
Show file tree
Hide file tree
Showing 30 changed files with 760 additions and 293 deletions.
10 changes: 5 additions & 5 deletions docs/how-to-write-a-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ We'll also need to add another import for this package at the top:
import (
"context"

"github.com/tektoncd/pipeline/pkg/apis/resolution/v1beta1"
// Add this one; it defines LabelKeyResolverType we use in GetSelector
// Add this one; it defines LabelKeyResolverType we use in GetSelector
"github.com/tektoncd/pipeline/pkg/resolution/common"
"github.com/tektoncd/pipeline/pkg/resolution/resolver/framework"
"knative.dev/pkg/injection/sharedmain"
pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
)
```

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

// Source is the source reference of the remote data that records where the remote
// file came from including the url, digest and the entrypoint. None atm.
func (*myResolvedResource) Source() *v1beta1.ConfigSource {
func (*myResolvedResource) Source() *pipelinev1beta1.ConfigSource {
return nil
}
```
Expand All @@ -275,8 +275,8 @@ following example.
```go
// Source is the source reference of the remote data that records where the remote
// file came from including the url, digest and the entrypoint.
func (*myResolvedResource) Source() *v1beta1.ConfigSource {
return &v1beta1.ConfigSource{
func (*myResolvedResource) Source() *pipelinev1beta1.ConfigSource {
return &v1alpha1.ConfigSource{
URI: "https://github.com/user/example",
Digest: map[string]string{
"sha1": "example",
Expand Down
Loading

0 comments on commit 8970bdd

Please sign in to comment.