From 923db7bd8e0ef79e3d9b44e57934cb3c593efb6a Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Tue, 6 Jun 2023 14:29:20 +0800 Subject: [PATCH] chore: use strings.Contains instead --- test/e2e/framework/providers/gce/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/framework/providers/gce/util.go b/test/e2e/framework/providers/gce/util.go index 9b31a4cbf9d..c518c703d97 100644 --- a/test/e2e/framework/providers/gce/util.go +++ b/test/e2e/framework/providers/gce/util.go @@ -52,7 +52,7 @@ func RecreateNodes(c clientset.Interface, nodes []v1.Node) error { // Find the sole managed instance group name var instanceGroup string - if strings.Index(framework.TestContext.CloudConfig.NodeInstanceGroup, ",") >= 0 { + if strings.Contains(framework.TestContext.CloudConfig.NodeInstanceGroup, ",") { return fmt.Errorf("Test does not support cluster setup with more than one managed instance group: %s", framework.TestContext.CloudConfig.NodeInstanceGroup) } instanceGroup = framework.TestContext.CloudConfig.NodeInstanceGroup