Skip to content

Commit 4e443fe

Browse files
committed
photon: reconstruct URL from release string
Using the raw release string wasn't yielding the correct updater URL, this change converts the release into the correct photon OVAL URL format. Signed-off-by: crozzy <joseph.crosland@gmail.com>
1 parent c4c726d commit 4e443fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

photon/photon.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package photon
33
import (
44
"fmt"
55
"net/url"
6+
"strings"
67

78
"github.com/quay/claircore/libvuln/driver"
89
"github.com/quay/claircore/pkg/ovalutil"
@@ -44,7 +45,7 @@ func NewUpdater(r Release, opts ...Option) (*Updater, error) {
4445
}
4546
if u.Fetcher.URL == nil {
4647
var err error
47-
u.Fetcher.URL, err = upstreamBase.Parse("com.vmware.phsa-" + string(u.release) + ".xml")
48+
u.Fetcher.URL, err = upstreamBase.Parse("com.vmware.phsa-photon" + strings.TrimSuffix(string(u.release), ".0") + ".xml")
4849
if err != nil {
4950
return nil, err
5051
}

photon/updaterset.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var photonReleases = []Release{
1111
Photon1,
1212
Photon2,
1313
Photon3,
14+
Photon4,
15+
Photon5,
1416
}
1517

1618
func UpdaterSet(_ context.Context) (driver.UpdaterSet, error) {

0 commit comments

Comments
 (0)