Skip to content

Commit

Permalink
Add status of pushing images to registry (#12615)
Browse files Browse the repository at this point in the history
* Add status of pushing images to registry

* Fix whitespaces
  • Loading branch information
KacperMalachowski authored Jan 31, 2025
1 parent 60f0f83 commit 33cb402
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/imagebuilder/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ import (
var reportRegex = regexp.MustCompile(`(?s)---IMAGE BUILD REPORT---\n(.*)\n---END OF IMAGE BUILD REPORT---`)

type BuildReport struct {
Status string `json:"status"`
IsSigned bool `json:"signed"`
IsProduction bool `json:"is_production"`
ImageSpec ImageSpec `json:"image_spec"`
// Status is the overall status of the build including signing and pushing
Status string `json:"status"`
// IsPushed indicates whether the image was pushed to a registry
IsPushed bool `json:"pushed"`
// IsSigned indicates whether the image was signed
IsSigned bool `json:"signed"`
// IsProduction indicates whether the image is a production image
IsProduction bool `json:"is_production"`
// ImageSpec contains the image name, tags, and repository path
ImageSpec ImageSpec `json:"image_spec"`
}

type ImageSpec struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/imagebuilder/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/p
---IMAGE BUILD REPORT---
{
"status": "Succeeded",
"pushed": true,
"signed": true,
"is_production": true,
"image_spec": {
Expand All @@ -38,6 +39,7 @@ Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/p
Finishing: prepare_image_build_report`
expectedReport := &BuildReport{
Status: "Succeeded",
IsPushed: true,
IsSigned: true,
IsProduction: true,
ImageSpec: ImageSpec{
Expand Down

0 comments on commit 33cb402

Please sign in to comment.