MCPcopy
hub / github.com/kubernetes/test-infra / clusterSize

Function clusterSize

kubetest/e2e.go:484–496  ·  view source on GitHub ↗
(deploy deployer)

Source from the content-addressed store, hash-verified

482}
483
484func clusterSize(deploy deployer) (int, error) {
485 if err := deploy.TestSetup(); err != nil {
486 return -1, err
487 }
488 o, err := control.Output(exec.Command("kubectl", "get", "nodes", "--no-headers"))
489 if err != nil {
490 log.Printf("kubectl get nodes failed: %s\n%s", wrapError(err).Error(), string(o))
491 return -1, err
492 }
493 stdout := strings.TrimSpace(string(o))
494 log.Printf("Cluster nodes:\n%s", stdout)
495 return len(strings.Split(stdout, "\n")), nil
496}
497
498// commandError will provide stderr output (if available) from structured
499// exit errors

Callers 1

isUpFunction · 0.85

Calls 4

wrapErrorFunction · 0.85
OutputMethod · 0.80
TestSetupMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected