From 9cfd86c4a90a7bfc63a058a203cdd632b9b15fec Mon Sep 17 00:00:00 2001 From: Joe Stuart Date: Mon, 7 Aug 2023 21:58:08 -0500 Subject: [PATCH] default to slsa build type --- .../v2alpha2/internal/build_definitions/build_definitions.go | 2 +- .../formats/slsa/v2alpha2/internal/pipelinerun/pipelinerun.go | 3 ++- pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/chains/formats/slsa/v2alpha2/internal/build_definitions/build_definitions.go b/pkg/chains/formats/slsa/v2alpha2/internal/build_definitions/build_definitions.go index 02766e1f46..7510b0a18a 100644 --- a/pkg/chains/formats/slsa/v2alpha2/internal/build_definitions/build_definitions.go +++ b/pkg/chains/formats/slsa/v2alpha2/internal/build_definitions/build_definitions.go @@ -2,5 +2,5 @@ package builddefinitions const ( SlsaBuildType = "https://tekton.dev/chains/v2/slsa" - TektonBuildType = "" + TektonBuildType = "https://tekton.dev/chains/v2/slsa-tekton" ) diff --git a/pkg/chains/formats/slsa/v2alpha2/internal/pipelinerun/pipelinerun.go b/pkg/chains/formats/slsa/v2alpha2/internal/pipelinerun/pipelinerun.go index e50ab4573a..7c892ac6ab 100644 --- a/pkg/chains/formats/slsa/v2alpha2/internal/pipelinerun/pipelinerun.go +++ b/pkg/chains/formats/slsa/v2alpha2/internal/pipelinerun/pipelinerun.go @@ -109,7 +109,8 @@ func byproducts(pro *objects.PipelineRunObject) ([]slsa.ResourceDescriptor, erro func getBuildDefinition(buildType string, pro *objects.PipelineRunObject) (builddefinitions.PipelineBuildType, error) { switch buildType { - case builddefinitions.SlsaBuildType: + // if buildType is not set in the chains-config, default to slsa build type + case builddefinitions.SlsaBuildType, "": return builddefinitions.PipelineBuildType{ BuildType: buildType, Pro: pro, diff --git a/pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go b/pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go index 5689622bea..fbbc4b2bac 100644 --- a/pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go +++ b/pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go @@ -105,7 +105,8 @@ func byproducts(tro *objects.TaskRunObject) ([]slsa.ResourceDescriptor, error) { func getBuildDefinition(buildType string, tro *objects.TaskRunObject) (builddefinitions.TaskBuildType, error) { switch buildType { - case builddefinitions.SlsaBuildType: + // if buildType is not set in the chains-config, default to slsa build type + case builddefinitions.SlsaBuildType, "": return builddefinitions.TaskBuildType{ BuildType: buildType, Tro: tro,