client: Migrate DriverStats optout to drivers/shared/structs

This commit is contained in:
Danielle Tomlinson
2018-11-29 00:23:07 +01:00
parent c36bc2ce9b
commit bacd6175f5
5 changed files with 11 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ import (
hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/client/allocrunner/interfaces"
"github.com/hashicorp/nomad/client/driver"
cstructs "github.com/hashicorp/nomad/client/structs"
dstructs "github.com/hashicorp/nomad/drivers/shared/structs"
)
// StatsUpdater is the interface required by the StatsHook to update stats.
@@ -95,7 +95,7 @@ func (h *statsHook) collectResourceUsageStats(handle interfaces.DriverStats, sto
ru, err := handle.Stats()
if err != nil {
// Check if the driver doesn't implement stats
if err.Error() == driver.DriverStatsNotImplemented.Error() {
if err.Error() == dstructs.DriverStatsNotImplemented.Error() {
h.logger.Debug("driver does not support stats")
return
}

View File

@@ -6,8 +6,8 @@ import (
"time"
"github.com/hashicorp/nomad/client/allocrunner/interfaces"
"github.com/hashicorp/nomad/client/driver"
cstructs "github.com/hashicorp/nomad/client/structs"
dstructs "github.com/hashicorp/nomad/drivers/shared/structs"
"github.com/hashicorp/nomad/helper/testlog"
"github.com/stretchr/testify/require"
)
@@ -160,7 +160,7 @@ func TestTaskRunner_StatsHook_NotImplemented(t *testing.T) {
logger := testlog.HCLogger(t)
su := newMockStatsUpdater()
ds := &mockDriverStats{
err: driver.DriverStatsNotImplemented,
err: dstructs.DriverStatsNotImplemented,
}
poststartReq := &interfaces.TaskPoststartRequest{DriverStats: ds}