Skip to content

Commit 1eb6055

Browse files
committed
Bumps Imposter version.
1 parent e0ab538 commit 1eb6055

3 files changed

Lines changed: 18 additions & 14 deletions

File tree

cmd/mock.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"os"
2929
"os/signal"
3030
"path/filepath"
31+
"sync"
3132
"syscall"
3233
)
3334

@@ -57,14 +58,17 @@ by this tool.`,
5758
bundleSpecs(stagingDir, manifestPath, manifest, flagForceOverwrite)
5859

5960
mockEngine := docker.BuildEngine(stagingDir, engine.StartOptions{
60-
Port: 8080,
61-
ImageTag: "latest",
62-
ImagePullPolicy: engine.ImagePullIfNotPresent,
63-
LogLevel: "DEBUG",
61+
Port: 8080,
62+
Version: "latest",
63+
PullPolicy: engine.PullIfNotPresent,
64+
LogLevel: "DEBUG",
65+
ReplaceRunning: true,
6466
})
65-
mockEngine.Start()
66-
trapExit(mockEngine)
67-
mockEngine.BlockUntilStopped()
67+
wg := &sync.WaitGroup{}
68+
mockEngine.Start(wg)
69+
70+
trapExit(wg, mockEngine)
71+
wg.Wait()
6872
},
6973
}
7074

@@ -163,12 +167,12 @@ func writeMockConfig(specFilePath string, resources []impostermodel.Resource, fo
163167
}
164168

165169
// listen for an interrupt from the OS, then attempt engine cleanup
166-
func trapExit(mockEngine engine.MockEngine) {
170+
func trapExit(wg *sync.WaitGroup, mockEngine engine.MockEngine) {
167171
c := make(chan os.Signal)
168172
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
169173
go func() {
170174
<-c
171-
mockEngine.Stop()
172-
os.Exit(0)
175+
println()
176+
mockEngine.Stop(wg)
173177
}()
174178
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module opendeps.org/opendeps
22

33
go 1.17
44

5-
replace gatehill.io/imposter => github.com/gatehill/imposter-cli v0.4.5
5+
replace gatehill.io/imposter => github.com/gatehill/imposter-cli v0.6.7
66

77
require (
8-
gatehill.io/imposter v0.4.5
8+
gatehill.io/imposter v0.6.7
99
github.com/fsnotify/fsnotify v1.5.1 // indirect
1010
github.com/hashicorp/hcl v1.0.0 // indirect
1111
github.com/inconshreveable/mousetrap v1.0.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWp
279279
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
280280
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
281281
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
282-
github.com/gatehill/imposter-cli v0.4.5 h1:F7WifoC/oZql390jtJS5KM1H1atSBePvet0ht3PCZWs=
283-
github.com/gatehill/imposter-cli v0.4.5/go.mod h1:1cvFX7e8yvBhldJKnIMFV276eLsbtO6LmrHGx4bN+IQ=
282+
github.com/gatehill/imposter-cli v0.6.7 h1:zdJupU6tdRrpQAFATRBLRjj8JnGs3FbYFDSronqZDsM=
283+
github.com/gatehill/imposter-cli v0.6.7/go.mod h1:xSgU6ap03w66qq8EnP//1OpX8GUZwJr9tmW+X7yHZfw=
284284
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
285285
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
286286
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=

0 commit comments

Comments
 (0)