From e047187376875a24ba0e5f07b2bc4102ee2aea6d Mon Sep 17 00:00:00 2001 From: msau42 Date: Thu, 6 Aug 2026 20:29:09 +0000 Subject: [PATCH] Add check to skip ExternalVolume e2e test in multi-node environment. The mock volume plugin that's used for testing only supports single-node --- internal/e2e/suites/demo/demo_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/internal/e2e/suites/demo/demo_test.go b/internal/e2e/suites/demo/demo_test.go index ca893a8790..3ec5a5917e 100644 --- a/internal/e2e/suites/demo/demo_test.go +++ b/internal/e2e/suites/demo/demo_test.go @@ -30,6 +30,7 @@ import ( "github.com/agent-substrate/substrate/pkg/api/v1alpha1" "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/protobuf/types/known/fieldmaskpb" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -359,6 +360,18 @@ func TestExternalVolumeLifecycle(t *testing.T) { t.Skip("Skipping TestExternalVolumeLifecycle for microVM environment") } + ctx := context.Background() + clients := e2e.GetClients() + + nodes, err := clients.K8s.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) + if err != nil { + t.Fatalf("failed to list nodes: %v", err) + } + + if !isKindCluster(nodes.Items) && len(nodes.Items) > 1 { + t.Skipf("Skipping TestExternalVolumeLifecycle: external volumes with mock driver are not supported in multi-node non-kind environments (node count: %d)", len(nodes.Items)) + } + tests := []struct { name string tc actorLifecycleTestCase @@ -1136,6 +1149,17 @@ func isMicroVMEnvironment() bool { return os.Getenv("E2E_TEMPLATE_NAMESPACE") == "ate-demo-counter-microvm" } +// isKindCluster reports whether the cluster is running on Kind by inspecting +// the providerID of the nodes. +func isKindCluster(nodes []corev1.Node) bool { + for _, node := range nodes { + if strings.HasPrefix(node.Spec.ProviderID, "kind://") { + return true + } + } + return false +} + func TestWorkerPodDeletion(t *testing.T) { // Create namespace nsObj := e2e.CreateNamespace(t)