wilfred-s commented on code in PR #950:
URL: https://github.com/apache/yunikorn-k8shim/pull/950#discussion_r1951889362
##########
pkg/client/apifactory_mock.go:
##########
@@ -398,11 +398,21 @@ func (m *MockedAPIProvider) UpdatePriorityClass(oldObj
*schedv1.PriorityClass, n
}
func (m *MockedAPIProvider) GetPodBindStats() BindStats {
- return m.clients.KubeClient.(*KubeClientMock).GetBindStats()
+ client, ok := m.clients.KubeClient.(*KubeClientMock)
+ if !ok {
+ log.Log(log.Test).Error("failed to get KubeClientMock")
+ return BindStats{}
+ }
Review Comment:
Failing immediately would need a panic here which could have side effects
and may not allow us to collect all data.
Returning a nil here will cause a failure in the caller which is nicely
handled as a failure without the side effects of a panic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]