mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
client: Migrate DriverStats optout to drivers/shared/structs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user