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

OCPBUGS-29183: Enable crun as runtime only if missing #937

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,8 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance
})
})

When("updates the default runtime to crun", func() {
It("should run high-performance runtimes class with crun as container-runtime", func() {
When("updates the default runtime to crun", Ordered, func() {
BeforeAll(func() {
const ContainerRuntimeConfigName = "ctrcfg-test"

key := types.NamespacedName{
Expand All @@ -1190,26 +1190,28 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance
By("checking if ContainerRuntimeConfig object already exists")
ctrcfg, err := getContainerRuntimeConfigFrom(context.TODO(), profile, mcp)
Expect(err).ToNot(HaveOccurred(), "failed to get ContainerRuntimeConfig from profile %q mcp %q", profile.Name, mcp.Name)
if ctrcfg == nil {
Copy link
Contributor

@Tal-or Tal-or Feb 7, 2024

Choose a reason for hiding this comment

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

Can we set the When in line 1180 to Ordered and add this code in BeforeAll() closure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in the latest commit

testlog.Infof("ContainerRuntimeConfig not exist")
ctrcfg = newContainerRuntimeConfig(ContainerRuntimeConfigName, profile, mcp)
By(fmt.Sprintf("creating ContainerRuntimeConfig %q", ctrcfg.Name))
Expect(testclient.Client.Create(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to create ctrcfg %#v", ctrcfg)

DeferCleanup(func() {
Expect(testclient.Client.Delete(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to delete ctfcfg %#v", ctrcfg)
By(fmt.Sprintf("waiting for mcp %q transition to UPDATING state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdating, corev1.ConditionTrue, getMCPConditionStatus)
By(fmt.Sprintf("waiting for mcp %q transition to UPDATED state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdated, corev1.ConditionTrue, getMCPConditionStatus)
})

Expect(ctrcfg).To(BeNil(), "unexpected ContainerRuntimeConfig: %#v", ctrcfg)
testlog.Infof("ContainerRuntimeConfig not exist")
ctrcfg = newContainerRuntimeConfig(ContainerRuntimeConfigName, profile, mcp)
By(fmt.Sprintf("creating ContainerRuntimeConfig %q", ctrcfg.Name))
Expect(testclient.Client.Create(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to create ctrcfg %#v", ctrcfg)

DeferCleanup(func() {
Expect(testclient.Client.Delete(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to delete ctfcfg %#v", ctrcfg)
By(fmt.Sprintf("waiting for mcp %q transition to UPDATING state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdating, corev1.ConditionTrue, getMCPConditionStatus)
By(fmt.Sprintf("waiting for mcp %q transition to UPDATED state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdated, corev1.ConditionTrue, getMCPConditionStatus)
})

By(fmt.Sprintf("waiting for mcp %q transition to UPDATING state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdating, corev1.ConditionTrue, getMCPConditionStatus)
By(fmt.Sprintf("waiting for mcp %q transition to UPDATED state", performanceMCP))
mcps.WaitForConditionFunc(performanceMCP, machineconfigv1.MachineConfigPoolUpdated, corev1.ConditionTrue, getMCPConditionStatus)

}
Expect(ctrcfg.Spec.ContainerRuntimeConfig.DefaultRuntime == machineconfigv1.ContainerRuntimeDefaultRuntimeCrun).To(BeTrue())
})
It("should run high-performance runtimes class with crun as container-runtime", func() {
cmd := []string{"cat", "/rootfs/etc/crio/crio.conf.d/99-runtimes.conf"}
for i := 0; i < len(workerRTNodes); i++ {
out, err := nodes.ExecCommandOnNode(context.TODO(), cmd, &workerRTNodes[i])
Expand Down