-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deployment unit tests #646
Deployment unit tests #646
Conversation
Hi @enxebre. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -50,7 +50,7 @@ var stateConfirmationInterval = 100 * time.Millisecond | |||
// and Start it when the Manager is Started. | |||
func Add(mgr manager.Manager) error { | |||
r := newReconciler(mgr) | |||
return add(mgr, r, r.MachineSetToMachines) | |||
return add(mgr, r, r.MachineToMachineSets) |
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.
/ok-to-test |
}, | ||
} | ||
controller := true | ||
ms := v1alpha1.MachineSet{ |
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.
Given that we enumerate the other instances (ms2, ms3), why not make this ms1
?
machineDeployment, | ||
}, | ||
} | ||
ms := v1alpha1.MachineSet{ |
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.
Given that we enumerate the others, why not make this ms1
?
543335a
to
4f6c5e6
Compare
/assign @frobware |
@roberthbailey: GitHub didn't allow me to assign the following users: frobware. Note that only kubernetes-sigs members and repo collaborators can be assigned. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
LGTM @roberthbailey |
4f6c5e6
to
2b9bcd1
Compare
/test pull-cluster-api-test |
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.
Only some minor comments.
/lgtm
}, | ||
}, | ||
} | ||
err := r.Client.List(context.Background(), listOptions, machineSets) | ||
if err != nil { |
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.
The above could be simplified with if err := ...; err != nil {
.
}, | ||
}, | ||
} | ||
err := r.Client.List(context.Background(), listOptions, dList) | ||
if err != nil { |
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.
Same here, can be simplified with if err := ...; err != nil {
.
@@ -230,7 +252,7 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach | |||
return nil, err | |||
} | |||
machines := &v1alpha1.MachineList{} | |||
err = r.List(context.Background(), client.InNamespace(d.Namespace).MatchingLabels(selector), machines) | |||
err = r.Client.List(context.Background(), client.InNamespace(d.Namespace).MatchingLabels(selector), machines) | |||
if err != nil { |
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.
Should we use client.ListOptions
here? Mostly to be consistent.
/approve Please remove the hold once all comments have been addressed. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, roberthbailey 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 |
3024092
to
f6010da
Compare
f6010da
to
bcd3145
Compare
thanks all for having a look, all comments addressed now |
bcd3145
to
f2552c9
Compare
/test pull-cluster-api-test |
/lgtm |
/hold cancel |
…st-k8s-versions only document latest Kubernetes patch versions
What this PR does / why we need it:
Initial PR to increase test coverage for machineDeployment controller
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: