Skip to content

Commit e2b0c9a

Browse files
committed
bump Nomad to 1.10.4
1 parent 6cebba3 commit e2b0c9a

File tree

5 files changed

+1335
-635
lines changed

5 files changed

+1335
-635
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
# devbuild compiles the binary
55
# -----------------------------------
6-
FROM golang:1.21 AS devbuild
6+
FROM golang:1.24 AS devbuild
77

88
WORKDIR /build
99
COPY . ./
1010
ENV CGO_ENABLED=1
11-
RUN go build -o nomad-nodesim .
11+
RUN go build -tags hashicorpmetrics -o nomad-nodesim .
1212

1313
# dev runs the binary from devbuild
1414
# -----------------------------------

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
Nomad Client Node Simulator
44

5-
To install and use you must have Go 1.19+ and run:
5+
To install and use you must have Go and run:
66

77
```
8-
go install -v github.com/schmichael/nomad-nodesim@latest
8+
go install -v -tags hashicorpmetrics github.com/schmichael/nomad-nodesim@latest
99
1010
nomad-nodesim -help
1111
```

allocrunnersim/allocrunnersim.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ type simulatedAllocRunner struct {
4343
// lastAcknowledgedState is the alloc runner state that was last
4444
// acknowledged by the server. It may lag behind allocState.
4545
lastAcknowledgedState *state.State
46+
47+
pauseState structs.TaskScheduleState
4648
}
4749

4850
func NewEmptyAllocRunnerFunc(conf *config.AllocRunnerConfig) (interfaces.AllocRunner, error) {
@@ -482,7 +484,18 @@ func (ar *simulatedAllocRunner) GetUpdatePriority(alloc *structs.Allocation) cst
482484

483485
func (ar *simulatedAllocRunner) StatsReporter() interfaces.AllocStatsReporter { return ar }
484486
func (ar *simulatedAllocRunner) Listener() *cstructs.AllocListener { return nil }
485-
func (ar *simulatedAllocRunner) GetAllocDir() *allocdir.AllocDir { return nil }
487+
func (ar *simulatedAllocRunner) GetAllocDir() allocdir.Interface { return nil }
488+
func (ar *simulatedAllocRunner) GetTaskPauseState(string) (structs.TaskScheduleState, error) {
489+
ar.allocLock.RLock()
490+
defer ar.allocLock.RUnlock()
491+
return ar.pauseState, nil
492+
}
493+
func (ar *simulatedAllocRunner) SetTaskPauseState(_ string, state structs.TaskScheduleState) error {
494+
ar.allocLock.Lock()
495+
defer ar.allocLock.Unlock()
496+
ar.pauseState = state
497+
return nil
498+
}
486499

487500
// LatestAllocStats lets this empty runner implement AllocStatsReporter
488501
func (ar *simulatedAllocRunner) LatestAllocStats(taskFilter string) (*cstructs.AllocResourceUsage, error) {

0 commit comments

Comments
 (0)