From 57b6ef6e750731c872f9e861b0b23d3fab499bfb Mon Sep 17 00:00:00 2001 From: Hamideh Amini Khezrabad Date: Fri, 24 Apr 2026 11:13:48 +0200 Subject: [PATCH] Fix stemcell URL parsing to support Noble (no -go_agent suffix) --- task-libs/bosh/stemcell.go | 2 +- tasks/update-base-manifest-stemcell/concourseio/runner.go | 2 +- tasks/update-stemcell/concourseio/runner.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/task-libs/bosh/stemcell.go b/task-libs/bosh/stemcell.go index 65befaf43..73373f0e9 100644 --- a/task-libs/bosh/stemcell.go +++ b/task-libs/bosh/stemcell.go @@ -40,7 +40,7 @@ func NewStemcellFromInput(stemcellDir string) (Stemcell, error) { } func parseOSfromURL(url string) (string, error) { - versionRegex := regexp.MustCompile(`(ubuntu-.*)-go_agent.tgz`) + versionRegex := regexp.MustCompile(`(ubuntu-[a-z]+(?:-[a-z]+)*?)(?:-go_agent)?\.tgz`) allMatches := versionRegex.FindAllStringSubmatch(url, 1) diff --git a/tasks/update-base-manifest-stemcell/concourseio/runner.go b/tasks/update-base-manifest-stemcell/concourseio/runner.go index 17b753e0c..4172f7f5a 100644 --- a/tasks/update-base-manifest-stemcell/concourseio/runner.go +++ b/tasks/update-base-manifest-stemcell/concourseio/runner.go @@ -104,7 +104,7 @@ func readFile(path string) (string, error) { } func parseOSfromURL(url string) (string, error) { - versionRegex := regexp.MustCompile(`(ubuntu-.*)-go_agent.tgz`) + versionRegex := regexp.MustCompile(`(ubuntu-[a-z]+(?:-[a-z]+)*?)(?:-go_agent)?\.tgz`) allMatches := versionRegex.FindAllStringSubmatch(url, 1) diff --git a/tasks/update-stemcell/concourseio/runner.go b/tasks/update-stemcell/concourseio/runner.go index aec58f5f0..8fd7549d3 100644 --- a/tasks/update-stemcell/concourseio/runner.go +++ b/tasks/update-stemcell/concourseio/runner.go @@ -134,7 +134,7 @@ func readFile(path string) (string, error) { } func parseOSfromURL(url string) (string, error) { - versionRegex := regexp.MustCompile(`(ubuntu-.*)-go_agent.tgz`) + versionRegex := regexp.MustCompile(`(ubuntu-[a-z]+(?:-[a-z]+)*?)(?:-go_agent)?\.tgz`) allMatches := versionRegex.FindAllStringSubmatch(url, 1)