-
Notifications
You must be signed in to change notification settings - Fork 40
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
Code improvements #49
Code improvements #49
Conversation
ingvagabund
commented
Mar 13, 2019
- simplifying the code
- making the code more readable
@@ -117,175 +121,151 @@ func labelMachineSetNodes(client runtimeclient.Client, ms *mapiv1beta1.MachineSe | |||
}) | |||
} | |||
|
|||
// Build default CA resource to allow fast scaling up and down | |||
func clusterAutoscalerResource() *caov1alpha1.ClusterAutoscaler { |
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.
can we move this into utils?
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.
I prefer to keep it in the same file as it is autoscaling specific. Unless it is needed in a different e2e/PACKAGE
suite. The less we expose/export the better.
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.
I think there's a lot to be said in having it scoped locally if it is only used locally, so +1 from me.
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.
I was suggesting pkg/e2e/autoscaler/utils.go so no details are exposed on the ginkgo file, so it's smaller and just reads user stories. Not a blocker for me though
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.
LGTM overall but there is a lot of changes here. I would like other folk on the team to take a pass through, then I'll come back for a second round. One nit is we should safely deref MachineSet.Spec.Replicas using pointer.Int32PtrDerefOr()
throughout.
If a List operation fails, there is no point of retrying as the operation will most likely fail for the second time again. There is a chance the List operation can fail due to infrastructure issues, e.g. network down, apiserver unreachable, etc. In those cases, entire test suite will most likely fail.
If a List operation fails, there is no point of retrying as the operation will most likely fail for the second time again. There is a chance the List operation can fail due to infrastructure issues, e.g. network down, apiserver unreachable, etc. In those cases, entire test suite will most likely fail.
If a List operation fails, there is no point of retrying as the operation will most likely fail for the second time again. There is a chance the List operation can fail due to infrastructure issues, e.g. network down, apiserver unreachable, etc. In those cases, entire test suite will most likely fail.
Delete all objects of a given kind that match labels. To simplify clean up code.
If any of CA/MA is not created right away, they either already exist (which is not expected) or the communication channel between apiserver and the client is broken. Both CA and MA CRDs are already deployed by CVO so the error caused by missing CRDs definitions is excluded.
/retest |
1 similar comment
/retest |
/test k8s-e2e |
/lgtm |
/retest |
/approve |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
We use ginkgo/gomega as a framework to run our tests. There is no plan to spread ginkgo/gomega based language outside of the main execution. In the future, we might switch to a different framework, thus keeping the dependency on ginkgo/gomega as minimal as possible.
Given all such functions are already under utils.go, it's natural to put the remaining two there as well.
Using GetMachineSet allows to force the default machine API namespaces.
Otherwise possibly failing with: Operation cannot be fulfilled on machines.machine.openshift.io \"kubemark-actuator-testing-machineset-****\": the object has been modified; please apply your changes to the latest version and try again
New changes are detected. LGTM label has been removed. |
This obviously is not right:
Just changed back to |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: spangenberg 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 |