test: cleanup mock consul service client
Updated to hclog. It exposed fields that required an unexported lock to access. Created a getter methodn instead. Only old allocrunner currently used this feature.
This commit is contained in:
parent
6f92b04226
commit
a977e22028
|
@ -31,7 +31,7 @@ func NewMockConsulOp(op, allocID, task string) MockConsulOp {
|
|||
// MockConsulServiceClient implements the ConsulServiceAPI interface to record
|
||||
// and log task registration/deregistration.
|
||||
type MockConsulServiceClient struct {
|
||||
Ops []MockConsulOp
|
||||
ops []MockConsulOp
|
||||
mu sync.Mutex
|
||||
|
||||
logger log.Logger
|
||||
|
@ -85,3 +85,9 @@ func (m *MockConsulServiceClient) AllocRegistrations(allocID string) (*consul.Al
|
|||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockConsulServiceClient) GetOps() []MockConsulOp {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
return m.ops
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue