-
Notifications
You must be signed in to change notification settings - Fork 544
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
WIP: stop NaNs from propogating through opencost and kubecost #2069
Conversation
d0fad1d
to
af5308c
Compare
SharedCostBreakdown: SharedCostBreakdowns{"NaN": getMockSharedCostBreakdown(f)}, | ||
LoadBalancers: LbAllocations{"NaN": getMockLbAllocation(f)}, | ||
} | ||
return alloc |
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 would like to convert these mock functions to use reflection (like the check function) if I have any extra time.
} | ||
|
||
func checkAllocation(t *testing.T, tcName string, alloc Allocation) { | ||
v := reflect.ValueOf(alloc) |
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.
There is a lot of use of reflect in here to avoid repetitive code - but only for tests.
c4391f9
to
6b9edb3
Compare
Signed-off-by: saweber <saweber@gmail.com>
6b9edb3
to
41f3de4
Compare
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. Phew, this one makes your eyes bleed! Haha.
Cherry pick of #2069: stop NaNs from propogating through opencost and kubecost
What does this PR change?
Does this PR relate to any other PRs?
How will this PR impact users?
Does this PR address any GitHub or Zendesk issues?
How was this PR tested?
Does this PR require changes to documentation?
Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?