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

Update PipelineRun attestation buildType #568

Merged
merged 2 commits into from
Sep 26, 2022
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
4 changes: 2 additions & 2 deletions pkg/chains/formats/intotoite6/intotoite6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestPipelineRunCreatePayload(t *testing.T) {
Builder: slsa.ProvenanceBuilder{
ID: "test_builder-1",
},
BuildType: "https://tekton.dev/attestations/chains/pipelinerun@v2",
BuildType: "tekton.dev/v1beta1/PipelineRun",
BuildConfig: pipelinerun.BuildConfig{
Tasks: []pipelinerun.TaskAttestation{
{
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestPipelineRunCreatePayloadChildRefs(t *testing.T) {
Builder: slsa.ProvenanceBuilder{
ID: "test_builder-1",
},
BuildType: "https://tekton.dev/attestations/chains/pipelinerun@v2",
BuildType: "tekton.dev/v1beta1/PipelineRun",
BuildConfig: pipelinerun.BuildConfig{
Tasks: []pipelinerun.TaskAttestation{
{
Expand Down
7 changes: 2 additions & 5 deletions pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ limitations under the License.
package pipelinerun

import (
"fmt"
"time"

intoto "github.com/in-toto/in-toto-golang/in_toto"
Expand All @@ -27,10 +28,6 @@ import (
"knative.dev/pkg/apis"
)

const (
TektonPipelineRunID = "https://tekton.dev/attestations/chains/pipelinerun@v2"
)

type BuildConfig struct {
Tasks []TaskAttestation `json:"tasks"`
}
Expand Down Expand Up @@ -60,7 +57,7 @@ func GenerateAttestation(builderID string, pro *objects.PipelineRunObject, logge
Builder: slsa.ProvenanceBuilder{
ID: builderID,
},
BuildType: TektonPipelineRunID,
BuildType: fmt.Sprintf("%s/%s", pro.GetGroupVersionKind().GroupVersion().String(), pro.GetGroupVersionKind().Kind),
Invocation: invocation(pro),
BuildConfig: buildConfig(pro, logger),
Metadata: metadata(pro),
Expand Down
4 changes: 0 additions & 4 deletions pkg/chains/formats/intotoite6/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import (
"go.uber.org/zap"
)

const (
TektonID = "https://tekton.dev/attestations/chains@v2"
)

func GenerateAttestation(builderID string, tro *objects.TaskRunObject, logger *zap.SugaredLogger) (interface{}, error) {
subjects := extract.SubjectDigests(tro, logger)

Expand Down