Merge pull request #118486 from testwill/framework

chore: use strings.Contains instead
This commit is contained in:
Kubernetes Prow Robot 2023-06-06 00:39:00 -07:00 committed by GitHub
commit d220ecb415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ func RecreateNodes(c clientset.Interface, nodes []v1.Node) error {
// Find the sole managed instance group name // Find the sole managed instance group name
var instanceGroup string 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) 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 instanceGroup = framework.TestContext.CloudConfig.NodeInstanceGroup