-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check If AWS Mahchine Has a Node #58
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: razo7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
test/e2e/utils/cluster.go
Outdated
// creates map for nodeName and AWS instance ID | ||
for _, machine := range machineList.Items { | ||
if machine.Status.NodeRef == nil || machine.Spec.ProviderID == nil { | ||
if missNodeMachineErr != nil { | ||
missNodeMachineErr = fmt.Errorf("machine %s is not associated with any node or it't provider ID is missing\n%w", string(machine.Spec.Name), missNodeMachineErr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: casting to string is redundant here
test/e2e/utils/cluster.go
Outdated
if missNodeMachineErr != nil { | ||
missNodeMachineErr = fmt.Errorf("machine %s is not associated with any node or it't provider ID is missing\n%w", string(machine.Spec.Name), missNodeMachineErr) | ||
} else { | ||
missNodeMachineErr = fmt.Errorf("machine %s is not associated with any node or it't provider ID is missing", string(machine.Spec.Name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: casting to string is redundant here
test/e2e/utils/cluster.go
Outdated
nodeName := v1alpha1.NodeName(string(machine.Status.NodeRef.Name)) | ||
providerID := string(*machine.Spec.ProviderID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: casting to string is redundant here
/lgtm |
Without it we might get a nil pointer exception
/lgtm |
/unhold |
Check if AWS Mahchine has a node, before trying to access the node's information.