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)