Skip to content

Commit

Permalink
Merge pull request #912 from stuartwdouglas/store-verification-results
Browse files Browse the repository at this point in the history
Store verification results
  • Loading branch information
stuartwdouglas authored Nov 9, 2023
2 parents fd24877 + 071c1a2 commit de5ce77
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
2 changes: 2 additions & 0 deletions deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ spec:
result:
type: string
type: object
verificationFailures:
type: string
verified:
description: If the resulting image was verified
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ spec:
result:
type: string
type: object
verificationFailures:
type: string
verified:
description: If the resulting image was verified
type: boolean
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ type BuildPipelineRunResults struct {
Image string `json:"image,omitempty"`
ImageDigest string `json:"imageDigest"`
//If the resulting image was verified
Verified bool `json:"verified,omitempty"`
Verified bool `json:"verified,omitempty"`
VerificationResults string `json:"verificationFailures,omitempty"`
// The produced GAVs
Gavs []string `json:"gavs,omitempty"`
// The hermetic build image produced by the build
Expand Down
34 changes: 34 additions & 0 deletions pkg/apis/jvmbuildservice/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions pkg/reconciler/dependencybuild/dependencybuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co
var image string
var digest string
var passedVerification bool
var verificationResults string
var gavs []string
var hermeticBuildImage string
for _, i := range pr.Status.Results {
Expand All @@ -695,14 +696,17 @@ func (r *ReconcileDependencyBuild) handleBuildPipelineRunReceived(ctx context.Co
} else if i.Name == artifactbuild.PipelineResultGavs {
deployed := strings.Split(i.Value.StringVal, ",")
db.Status.DeployedArtifacts = deployed
} else if i.Name == artifactbuild.PipelineResultVerificationResult {
verificationResults = i.Value.StringVal
}
}
run.Results = &v1alpha1.BuildPipelineRunResults{
Image: image,
ImageDigest: digest,
Verified: passedVerification,
Gavs: gavs,
HermeticBuildImage: hermeticBuildImage,
Image: image,
ImageDigest: digest,
Verified: passedVerification,
VerificationResults: verificationResults,
Gavs: gavs,
HermeticBuildImage: hermeticBuildImage,
}

for _, i := range pr.Status.Results {
Expand Down

0 comments on commit de5ce77

Please sign in to comment.