Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kola/test: update rhcos upgrade test to new s3 dir #3480

Merged
merged 1 commit into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions mantle/kola/tests/rhcos/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,12 @@ func getJson(url string, target interface{}) error {
func downloadLatestReleasedRHCOS(target string) (string, error) {
buildID := kola.CosaBuild.Meta.BuildID
ocpVersion := strings.Split(buildID, ".")[0]
rhelVersion := strings.Split(buildID, ".")[1]
ocpVersionF := fmt.Sprintf("%s.%s", ocpVersion[:1], ocpVersion[1:])
// The stream name isn't anywhere in the build so we can only infer
// the RHEL version from the RHCOS version string. This will break
// on three digit versions like 10.1 or 9.10.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's #3390.

rhelVersionF := fmt.Sprintf("%s.%s", rhelVersion[:1], rhelVersion[1:])
channel := "fast-" + ocpVersionF

type Release struct {
Expand Down Expand Up @@ -392,16 +397,17 @@ func downloadLatestReleasedRHCOS(target string) (string, error) {

var latestOcpRhcosBuild *cosa.Build
rhcosVersion := ocpRelease.DisplayVersions.MachineOS.Version
latestBaseUrl := fmt.Sprintf("https://rhcos.mirror.openshift.com/art/storage/prod/streams/%s/builds/%s/%s",
latestBaseUrl := fmt.Sprintf("https://rhcos.mirror.openshift.com/art/storage/prod/streams/%s-%s/builds/%s/%s",
ocpVersionF,
rhelVersionF,
rhcosVersion,
coreosarch.CurrentRpmArch())
latestRhcosBuildMetaUrl := fmt.Sprintf("%s/meta.json", latestBaseUrl)
if err := getJson(latestRhcosBuildMetaUrl, &latestOcpRhcosBuild); err != nil {
// Try the old bucket layout; ideally we'd only do this if the error
// Try the <ocp version> stream; ideally we'd only do this if the error
// was 403 denied (which is really a 404), but meh this is temporary
// anyway.
latestBaseUrl = fmt.Sprintf("https://rhcos.mirror.openshift.com/art/storage/releases/rhcos-%s/%s/%s",
latestBaseUrl = fmt.Sprintf("https://rhcos.mirror.openshift.com/art/storage/prod/streams/%s/builds/%s/%s",
ocpVersionF,
rhcosVersion,
coreosarch.CurrentRpmArch())
Expand Down