mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 20:29:56 +00:00
Fix up e2enode.GetReadySchedulableNodes, replace many uses of framework.GetReadySchedulableNodesOrDie
Remove the "OrDie" from the name (since it doesn't "or die") and add an extra check that there is at least 1 node available, since many callers already did that themselves, and many others should have.
This commit is contained in:
@@ -353,16 +353,6 @@ func SetInstanceTags(cloudConfig framework.CloudConfig, instanceName, zone strin
|
||||
return resTags.Items
|
||||
}
|
||||
|
||||
// GetNodeTags gets k8s node tag from one of the nodes
|
||||
func GetNodeTags(c clientset.Interface, cloudConfig framework.CloudConfig) []string {
|
||||
nodes := framework.GetReadySchedulableNodesOrDie(c)
|
||||
if len(nodes.Items) == 0 {
|
||||
framework.Logf("GetNodeTags: Found 0 node.")
|
||||
return []string{}
|
||||
}
|
||||
return GetInstanceTags(cloudConfig, nodes.Items[0].Name).Items
|
||||
}
|
||||
|
||||
// IsGoogleAPIHTTPErrorCode returns true if the error is a google api
|
||||
// error matching the corresponding HTTP error code.
|
||||
func IsGoogleAPIHTTPErrorCode(err error, code int) bool {
|
||||
|
Reference in New Issue
Block a user