Skip to content
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

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

razo7
Copy link
Member

@razo7 razo7 commented Jun 12, 2023

Check if AWS Mahchine has a node, before trying to access the node's information.

@openshift-ci openshift-ci bot requested review from mshitrit and slintes June 12, 2023 12:33
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 12, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

// 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)
Copy link
Member

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

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))
Copy link
Member

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

Comment on lines 72 to 73
nodeName := v1alpha1.NodeName(string(machine.Status.NodeRef.Name))
providerID := string(*machine.Spec.ProviderID)
Copy link
Member

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

@mshitrit
Copy link
Member

/lgtm
/hold
couple of Nits, feel free to fix/merge/wait for additional review

Without it we might get a nil pointer exception
@mshitrit
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 14, 2023
@razo7
Copy link
Member Author

razo7 commented Jun 14, 2023

/unhold

@openshift-merge-robot openshift-merge-robot merged commit 790fb97 into medik8s:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants