Skip to content

Commit 8cdb0d9

Browse files
committed
For .NET 9.0, explicitly run the usage script to work around Terminal Logger issues
1 parent 7a1e34a commit 8cdb0d9

File tree

1 file changed

+17
-2
lines changed
  • test/extended/image_ecosystem

1 file changed

+17
-2
lines changed

test/extended/image_ecosystem/scl.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,25 @@ func defineTest(name string, t tc, oc *exutil.CLI) {
5555
}
5656
e2e.Logf("%s:%s passed architecture compatibility", name, t.Tag)
5757
g.By(fmt.Sprintf("creating a sample pod for %q", t.DockerImageReference))
58-
pod := exutil.GetPodForContainer(kapiv1.Container{
58+
container := kapiv1.Container{
5959
Name: "test",
6060
Image: t.DockerImageReference,
61-
})
61+
}
62+
63+
// For .NET 9.0, explicitly run the usage script to work around Terminal Logger issues
64+
// See: https://developers.redhat.com/articles/2024/11/15/net-9-now-available-rhel-and-openshift
65+
if name == "dotnet" && strings.Contains(t.Tag, "9.0") {
66+
e2e.Logf("Setting explicit command for .NET 9.0 to run usage script")
67+
container.Command = []string{"/usr/libexec/s2i/usage"}
68+
}
69+
70+
pod := exutil.GetPodForContainer(container)
71+
72+
// Set restart policy to Never for .NET 9.0 to match the expected behavior
73+
if name == "dotnet" && strings.Contains(t.Tag, "9.0") {
74+
pod.Spec.RestartPolicy = kapiv1.RestartPolicyNever
75+
}
76+
6277
_, err := oc.KubeClient().CoreV1().Pods(oc.Namespace()).Create(context.Background(), pod, metav1.CreateOptions{})
6378
o.Expect(err).NotTo(o.HaveOccurred())
6479

0 commit comments

Comments
 (0)