fix: regex

This commit is contained in:
Neil Hanlon 2024-03-27 13:59:21 -04:00
parent 7b5fc95765
commit c93ee4dcd9
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34

View File

@ -63,7 +63,7 @@ func FindRecentImages(bucketName string, prefix string, version string, imageTyp
log.Fatalf("uh oh: %v", err)
}
pattern := regexp.MustCompile(`(?P<whole>Rocky-(?P<major>[0-9]+)-(?P<type>\w+)(?:-(?P<variant>\w+))?-(?:[0-9]+)\.(?P<minor>[0-9])-(?P<date>[0-9]+)\.(?P<epoch>[0-9]+)\.(?P<architecture>\w+)/(?P<datestamp>[0-9]+)/(?P<file>(.+\.(?P<extension>(box|qcow2|raw|tar\.xz|vhd)))))$`)
pattern := regexp.MustCompile(`(?P<whole>Rocky-(?P<major>[0-9]+)-(?P<type>\w+)(?:-(?P<variant>\w+))?-(?:[0-9]+)\.(?P<minor>[0-9]+)-(?P<date>[0-9]+)\.(?P<epoch>[0-9]+)\.(?P<architecture>\w+)/(?P<datestamp>[0-9]+)/(?P<file>(.+\.(?P<extension>(box|qcow2|raw|tar\.xz|vhd)))))$`)
// Loop through the objects and find the latest one for each file type
latestByTypeVariant := map[string]map[string]*Image{}
for _, obj := range items {