Skip to content
Merged
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
19 changes: 11 additions & 8 deletions test/extended/node/node_e2e/node.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package node

import (
"context"
"path/filepath"
"strings"
"time"

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
e2e "k8s.io/kubernetes/test/e2e/framework"

Expand Down Expand Up @@ -115,13 +113,18 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager",
podName := "pod-devfuse"
ns := "devfuse-test"

g.By("Check if the default CRI-O runtime is runc")
ctrcfgList, err := oc.MachineConfigurationClient().MachineconfigurationV1().ContainerRuntimeConfigs().List(context.Background(), metav1.ListOptions{})
// Skip on runc: io.kubernetes.cri-o.Devices annotation is only in crun's allowed_annotations.
// We query crio config directly as ContainerRuntimeConfig API misses platform-default runc.
g.By("Skip if the default runtime is runc")
node, err := oc.AsAdmin().WithoutNamespace().Run("get").Args(
"nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
o.Expect(err).NotTo(o.HaveOccurred())
for _, cfg := range ctrcfgList.Items {
if cfg.Spec.ContainerRuntimeConfig != nil && cfg.Spec.ContainerRuntimeConfig.DefaultRuntime == "runc" {
g.Skip("Skipping: not applicable to runc runtime")
}
o.Expect(node).NotTo(o.BeEmpty())
runtime, err := nodeutils.ExecOnNodeWithChroot(oc, node, "/bin/bash", "-c",
"crio status config 2>/dev/null | awk -F'\"' '/default_runtime/{print $2}'")
o.Expect(err).NotTo(o.HaveOccurred())
if strings.TrimSpace(runtime) == "runc" {
g.Skip("Skipping: not applicable to runc runtime")
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

g.By("Create a test namespace")
Expand Down