Set the docker image correctly when a server is updated; closes pterodactyl/panel#2356

This commit is contained in:
Dane Everitt 2020-09-17 20:20:39 -07:00
parent 815539b3da
commit 783832fc71
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 7 additions and 0 deletions

View File

@ -176,3 +176,9 @@ func (e *Environment) SetStopConfiguration(c *api.ProcessStopConfiguration) {
e.meta.Stop = c e.meta.Stop = c
e.mu.Unlock() e.mu.Unlock()
} }
func (e *Environment) SetImage(i string) {
e.mu.Lock()
e.meta.Image = i
e.mu.Unlock()
}

View File

@ -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. // the process isn't just terminated when a user requests it be stopped.
if e, ok := s.Environment.(*docker.Environment); ok { if e, ok := s.Environment.(*docker.Environment); ok {
s.Log().Debug("syncing stop configuration with configured docker environment") s.Log().Debug("syncing stop configuration with configured docker environment")
e.SetImage(s.Config().Container.Image)
e.SetStopConfiguration(&cfg.ProcessConfiguration.Stop) e.SetStopConfiguration(&cfg.ProcessConfiguration.Stop)
} }