Skip to content

Commit

Permalink
default to slsa build type
Browse files Browse the repository at this point in the history
  • Loading branch information
joejstuart committed Aug 8, 2023
1 parent 37f309b commit 9cfd86c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package builddefinitions

const (
SlsaBuildType = "https://tekton.dev/chains/v2/slsa"
TektonBuildType = ""
TektonBuildType = "https://tekton.dev/chains/v2/slsa-tekton"
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion pkg/chains/formats/slsa/v2alpha2/internal/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9cfd86c

Please sign in to comment.