Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions openshift-hack/cmd/k8s-tests-ext/k8s-tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,16 @@ func main() {
Qualifiers: []string{withExcludedTestsFilter(`name.contains('[Serial]')`)},
})

for k, v := range image.GetOriginalImageConfigs() {
image := convertToImage(v)
image.Index = int(k)
mirror := "quay.io/openshift/community-e2e-images"
if v := os.Getenv("TEST_IMAGE_MIRROR"); len(v) > 0 {
mirror = v
}
originals := image.GetOriginalImageConfigs()
mapped := image.GetMappedImageConfigs(originals, mirror)
for k, v := range originals {
image := convertToImage(v, int(k))
mappedImage := convertToImage(mapped[k], int(k))
image.Mapped = &mappedImage
Copy link
Member

Choose a reason for hiding this comment

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

LGTM, we just need to merge the OTE changes first.

Copy link
Member Author

Choose a reason for hiding this comment

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

The OTE PR is ready for merge. openshift-eng/openshift-tests-extension#40

kubeTestsExtension.RegisterImage(image)
}

Expand Down Expand Up @@ -158,10 +165,10 @@ func main() {
}
}

// convertToImages converts an image.Config to an extension.Image, which
// convertToImage converts an image.Config to an extension.Image, which
// can easily be serialized to JSON. Since image.Config has unexported fields,
// reflection is used to read its values.
func convertToImage(obj interface{}) e.Image {
func convertToImage(obj interface{}, index int) e.Image {
image := e.Image{}
val := reflect.ValueOf(obj)
typ := reflect.TypeOf(obj)
Expand All @@ -177,6 +184,7 @@ func convertToImage(obj interface{}) e.Image {
image.Version = fieldValue.String()
}
}
image.Index = index
return image
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.