From de92c2fb008a6a1e244af15e5574e087520b4c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Ma=C5=82achowski?= Date: Fri, 31 Jan 2025 08:17:18 +0100 Subject: [PATCH 1/2] Add status of pushing images to registry --- pkg/imagebuilder/report.go | 14 ++++++++++---- pkg/imagebuilder/report_test.go | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/imagebuilder/report.go b/pkg/imagebuilder/report.go index 2b20102d8f0e..c251e8dba591 100644 --- a/pkg/imagebuilder/report.go +++ b/pkg/imagebuilder/report.go @@ -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 { diff --git a/pkg/imagebuilder/report_test.go b/pkg/imagebuilder/report_test.go index 076a8e0edb07..520645e57d20 100644 --- a/pkg/imagebuilder/report_test.go +++ b/pkg/imagebuilder/report_test.go @@ -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": { @@ -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{ From c099815d22729b4d6aead7f17be251afe1be98f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Ma=C5=82achowski?= Date: Fri, 31 Jan 2025 08:36:04 +0100 Subject: [PATCH 2/2] Fix whitespaces --- pkg/imagebuilder/report_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/imagebuilder/report_test.go b/pkg/imagebuilder/report_test.go index 520645e57d20..7aaeefa36b69 100644 --- a/pkg/imagebuilder/report_test.go +++ b/pkg/imagebuilder/report_test.go @@ -19,7 +19,7 @@ Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/p ---IMAGE BUILD REPORT--- { "status": "Succeeded", - "pushed": true, + "pushed": true, "signed": true, "is_production": true, "image_spec": {