@@ -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
6567func 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
0 commit comments