diff --git a/cmd/image-builder/main.go b/cmd/image-builder/main.go index 0f468502b50b..1dae3f5ea71e 100644 --- a/cmd/image-builder/main.go +++ b/cmd/image-builder/main.go @@ -378,6 +378,7 @@ func buildInADO(o options) error { fmt.Printf("ADO pipeline image build logs:\n%s", logs) } + fmt.Println("Getting build report.") // Parse the build report from the ADO pipeline run logs. buildReport, err = imagebuilder.NewBuildReportFromLogs(logs) if err != nil { diff --git a/pkg/imagebuilder/report.go b/pkg/imagebuilder/report.go index 6f51d5ca6a4d..fc8b36ae9408 100644 --- a/pkg/imagebuilder/report.go +++ b/pkg/imagebuilder/report.go @@ -9,7 +9,7 @@ import ( // reportRegex is a regular expression that matches the image build report var ( - reportRegex = regexp.MustCompile(`(?s)---IMAGE BUILD REPORT---\n(.*)\n---END OF IMAGE BUILD REPORT---`) + reportRegex = regexp.MustCompile(`(?s)---IMAGE BUILD REPORT---(.*)---END OF IMAGE BUILD REPORT---`) timestampRegex = regexp.MustCompile(`\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s`) ) @@ -50,7 +50,7 @@ func NewBuildReportFromLogs(log string) (*BuildReport, error) { // Find the report in the log matches := reportRegex.FindStringSubmatch(log) if len(matches) < 2 { - return nil, fmt.Errorf("no image build report found in log") + return nil, fmt.Errorf("failed to find image build report in log") } // Parse the report data