Avoid triggering crash detection on container destroy
This commit is contained in:
1
http.go
1
http.go
@@ -501,6 +501,7 @@ func (rt *Router) routeServerDelete(w http.ResponseWriter, r *http.Request, ps h
|
|||||||
// to start it while this process is running.
|
// to start it while this process is running.
|
||||||
s.Suspended = true
|
s.Suspended = true
|
||||||
|
|
||||||
|
zap.S().Infow("processing server deletion request", zap.String("server", s.Uuid))
|
||||||
// Destroy the environment; in Docker this will handle a running container and
|
// Destroy the environment; in Docker this will handle a running container and
|
||||||
// forcibly terminate it before removing the container, so we do not need to handle
|
// forcibly terminate it before removing the container, so we do not need to handle
|
||||||
// that here.
|
// that here.
|
||||||
|
|||||||
@@ -292,6 +292,9 @@ func (d *DockerEnvironment) Terminate(signal os.Signal) error {
|
|||||||
func (d *DockerEnvironment) Destroy() error {
|
func (d *DockerEnvironment) Destroy() error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Avoid crash detection firing off.
|
||||||
|
d.Server.SetState(ProcessStoppingState)
|
||||||
|
|
||||||
return d.Client.ContainerRemove(ctx, d.Server.Uuid, types.ContainerRemoveOptions{
|
return d.Client.ContainerRemove(ctx, d.Server.Uuid, types.ContainerRemoveOptions{
|
||||||
RemoveVolumes: true,
|
RemoveVolumes: true,
|
||||||
RemoveLinks: false,
|
RemoveLinks: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user