mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* First grab the pods matching the selector Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Use channel instead of slice Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Update pkg/kclient/all.go Co-authored-by: Parthvi Vala <pvala@redhat.com> * Use errgroup instead of WaitGroup Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> An errgroup returns immediately if any of the go routines in the group return an error. This way, error is propogated sooner rather than later. * Shadow loop variable for go vet Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Close the channel being looped over Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Use `select` instead of ranging the channel When ranging the channel, it is critical to close it so that the go routine doesn't hang around infinitely. This caused an issue wherein `odo delete component` would not be able to show all the resources that would get deleted because the channel got closed a little too soon. Using `select` and an explicit error chanel should help mitigate this. Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Close the channels to prevent leaking goroutine Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> * Goroutine to wait for goroutines Signed-off-by: Dharmit Shah <shahdharmit@gmail.com> Co-authored-by: Parthvi Vala <pvala@redhat.com>
78 lines
2.1 KiB
Go
Generated
78 lines
2.1 KiB
Go
Generated
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: pkg/storage/storage.go
|
|
|
|
// Package storage is a generated GoMock package.
|
|
package storage
|
|
|
|
import (
|
|
reflect "reflect"
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
)
|
|
|
|
// MockClient is a mock of Client interface.
|
|
type MockClient struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockClientMockRecorder
|
|
}
|
|
|
|
// MockClientMockRecorder is the mock recorder for MockClient.
|
|
type MockClientMockRecorder struct {
|
|
mock *MockClient
|
|
}
|
|
|
|
// NewMockClient creates a new mock instance.
|
|
func NewMockClient(ctrl *gomock.Controller) *MockClient {
|
|
mock := &MockClient{ctrl: ctrl}
|
|
mock.recorder = &MockClientMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockClient) EXPECT() *MockClientMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Create mocks base method.
|
|
func (m *MockClient) Create(arg0 Storage) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Create", arg0)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Create indicates an expected call of Create.
|
|
func (mr *MockClientMockRecorder) Create(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockClient)(nil).Create), arg0)
|
|
}
|
|
|
|
// Delete mocks base method.
|
|
func (m *MockClient) Delete(arg0 string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Delete", arg0)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Delete indicates an expected call of Delete.
|
|
func (mr *MockClientMockRecorder) Delete(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), arg0)
|
|
}
|
|
|
|
// List mocks base method.
|
|
func (m *MockClient) List() (StorageList, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "List")
|
|
ret0, _ := ret[0].(StorageList)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// List indicates an expected call of List.
|
|
func (mr *MockClientMockRecorder) List() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockClient)(nil).List))
|
|
}
|