pbacsko commented on code in PR #839:
URL: https://github.com/apache/yunikorn-k8shim/pull/839#discussion_r1599633331
##########
pkg/client/apifactory_mock.go:
##########
@@ -416,38 +417,80 @@ func (m *MockedAPIProvider) GetBoundPods(clear bool)
[]BoundPod {
}
// MockedPersistentVolumeInformer implements PersistentVolumeInformer interface
-type MockedPersistentVolumeInformer struct{}
+type MockedPersistentVolumeInformer struct {
+ informer cache.SharedIndexInformer
+}
+
+func NewMockedPersistentVolumeInformer() *MockedPersistentVolumeInformer {
+ return &MockedPersistentVolumeInformer{
+ informer: &test.SharedInformerMock{},
+ }
+}
func (m *MockedPersistentVolumeInformer) Informer() cache.SharedIndexInformer {
- return nil
+ return m.informer
}
func (m *MockedPersistentVolumeInformer) Lister()
corev1.PersistentVolumeLister {
return nil
}
// MockedPersistentVolumeClaimInformer implements
PersistentVolumeClaimInformer interface
-type MockedPersistentVolumeClaimInformer struct{}
+type MockedPersistentVolumeClaimInformer struct {
+ informer cache.SharedIndexInformer
+}
+
+func NewMockedPersistentVolumeClaimInformer()
*MockedPersistentVolumeClaimInformer {
+ return &MockedPersistentVolumeClaimInformer{
+ informer: &test.SharedInformerMock{},
+ }
+}
func (m *MockedPersistentVolumeClaimInformer) Informer()
cache.SharedIndexInformer {
- return nil
+ return m.informer
}
func (m *MockedPersistentVolumeClaimInformer) Lister()
corev1.PersistentVolumeClaimLister {
return nil
}
// MockedStorageClassInformer implements StorageClassInformer interface
-type MockedStorageClassInformer struct{}
+type MockedStorageClassInformer struct {
+ informer cache.SharedIndexInformer
+}
+
+func NewMockedStorageClassInformer() *MockedStorageClassInformer {
+ return &MockedStorageClassInformer{
+ informer: &test.SharedInformerMock{},
+ }
+}
func (m *MockedStorageClassInformer) Informer() cache.SharedIndexInformer {
- return nil
+ return m.informer
}
func (m *MockedStorageClassInformer) Lister() storagev1.StorageClassLister {
return nil
}
+type MockedCSINodeInformer struct {
+ informer cache.SharedIndexInformer
+}
+
+func NewMockedCSINodeInformer() *MockedCSINodeInformer {
+ return &MockedCSINodeInformer{
+ informer: &test.SharedInformerMock{},
+ }
+}
+
+func (m *MockedCSINodeInformer) Informer() cache.SharedIndexInformer {
+ return &test.SharedInformerMock{}
Review Comment:
Correct, fixed.
--
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]