From 783832fc7164f88b4b888e54f2debd6caf14afaf Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 17 Sep 2020 20:20:39 -0700 Subject: [PATCH] Set the docker image correctly when a server is updated; closes pterodactyl/panel#2356 --- environment/docker/environment.go | 6 ++++++ server/server.go | 1 + 2 files changed, 7 insertions(+) diff --git a/environment/docker/environment.go b/environment/docker/environment.go index 9209dc5..7b3d803 100644 --- a/environment/docker/environment.go +++ b/environment/docker/environment.go @@ -176,3 +176,9 @@ func (e *Environment) SetStopConfiguration(c *api.ProcessStopConfiguration) { e.meta.Stop = c e.mu.Unlock() } + +func (e *Environment) SetImage(i string) { + e.mu.Lock() + e.meta.Image = i + e.mu.Unlock() +} diff --git a/server/server.go b/server/server.go index a24e185..c5f9cf3 100644 --- a/server/server.go +++ b/server/server.go @@ -137,6 +137,7 @@ func (s *Server) SyncWithConfiguration(cfg *api.ServerConfigurationResponse) err // the process isn't just terminated when a user requests it be stopped. if e, ok := s.Environment.(*docker.Environment); ok { s.Log().Debug("syncing stop configuration with configured docker environment") + e.SetImage(s.Config().Container.Image) e.SetStopConfiguration(&cfg.ProcessConfiguration.Stop) }