pbacsko commented on code in PR #950:
URL: https://github.com/apache/yunikorn-k8shim/pull/950#discussion_r1950433346
##########
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{}
+ }
+ return client.GetBindStats()
}
func (m *MockedAPIProvider) GetBoundPods(clear bool) []BoundPod {
- return m.clients.KubeClient.(*KubeClientMock).GetBoundPods(clear)
+ client, ok := m.clients.KubeClient.(*KubeClientMock)
+ if !ok {
+ log.Log(log.Test).Error("failed to get KubeClientMock")
+ return []BoundPod{}
+ }
Review Comment:
Let this fail immediately, the test must be fixed if this ever happens. Use
`nolint` to suppress the linter.
--
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]