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

CAPI: Stop panicking in newMachineController #2940

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Mar 18, 2020

Stop panicking in newMachineController

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 18, 2020
@enxebre
Copy link
Member Author

enxebre commented Mar 18, 2020

cc @frobware @JoelSpeed @elmiko

@k8s-ci-robot k8s-ci-robot requested review from detiber and ncdc March 18, 2020 12:18
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the returned error path can actually be reached, other than that seems good

Comment on lines 305 to 307
if CAPIGroup == "" {
return nil, fmt.Errorf("could not get a CAPI group")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCAPIGROUP can't return an empty string, so this check is redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm It does not hurt though, I guess it safe to assume it since getCAPIGROUP is well unit tested. Dropped it.

Copy link
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, although i agree with Joel's comment

@enxebre enxebre force-pushed the set-resources-error branch from d2b08f9 to dfbb049 Compare March 18, 2020 13:13
@elmiko
Copy link
Contributor

elmiko commented Mar 18, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2020
@enxebre
Copy link
Member Author

enxebre commented Mar 18, 2020

/area provider/cluster-api

@k8s-ci-robot k8s-ci-robot added the area/provider/cluster-api Issues or PRs related to Cluster API provider label Mar 18, 2020
@JoelSpeed
Copy link
Contributor

/lgtm

@detiber
Copy link
Member

detiber commented Mar 18, 2020

/lgtm

@elmiko
Copy link
Contributor

elmiko commented Mar 18, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elmiko

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4fe2ca4 into kubernetes:master Mar 18, 2020
k8s-ci-robot added a commit that referenced this pull request Jun 2, 2020
[CA-1.18] #2940 cherry-pick CAPI: Stop panicking in newMachineController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/cluster-api Issues or PRs related to Cluster API provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants