Skip to content

Commit 54cfcf2

Browse files
authored
Merge pull request #2928 from Nordix/lentzi90/backport-flatcar-bucket-release-0.12
🌱 E2E: Use bucket for flatcar production image
2 parents 6825911 + 43e5aec commit 54cfcf2

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

test/e2e/shared/images.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ type DownloadImage struct {
6060
ArtifactPath string
6161
// A hash used to verify the downloaded image
6262
Hash, HashAlgorithm string
63+
// GlanceName overrides the inferred Glance image name if set
64+
GlanceName string
6365
}
6466

6567
func CoreImages(e2eCtx *E2EContext) []DownloadImage {
@@ -128,13 +130,16 @@ func ApplyGlanceImages(ctx context.Context, e2eCtx *E2EContext, images []Downloa
128130
Expect(err).NotTo(HaveOccurred(), "parsing "+url)
129131
d := strings.Split(u.Path, "/")
130132
Expect(len(d)).To(BeNumerically(">", 1), "Not enough path elements in "+url)
131-
glanceName := d[len(d)-1]
132-
133-
// Remove the type suffix
134-
for _, suffix := range []string{".img", ".qcow2"} {
135-
if strings.HasSuffix(glanceName, suffix) {
136-
glanceName = glanceName[:len(glanceName)-len(suffix)]
137-
continue
133+
glanceName := image.GlanceName
134+
if glanceName == "" {
135+
glanceName = d[len(d)-1]
136+
137+
// Remove the type suffix
138+
for _, suffix := range []string{".img", ".qcow2"} {
139+
if strings.HasSuffix(glanceName, suffix) {
140+
glanceName = glanceName[:len(glanceName)-len(suffix)]
141+
continue
142+
}
138143
}
139144
}
140145

test/e2e/suites/e2e/e2e_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ func flatcarImages(e2eCtx *shared.E2EContext) []shared.DownloadImage {
7171
ArtifactPath: "flatcar/" + e2eCtx.E2EConfig.GetVariable("OPENSTACK_FLATCAR_IMAGE_NAME") + ".img",
7272
},
7373
{
74-
Name: "flatcar-openstack",
75-
URL: "https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img",
74+
Name: "flatcar-openstack",
75+
URL: "https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/flatcar/flatcar_production_openstack_image-4459.2.2.img",
76+
GlanceName: "flatcar_production_openstack_image",
7677
},
7778
}
7879
}

0 commit comments

Comments
 (0)