Obliterate mappings/env variables if passed through, since we want to completely replace those arrays
This commit is contained in:
parent
69aa559bcf
commit
c684410722
|
@ -44,10 +44,20 @@ func (s *Server) UpdateDataStructure(data []byte) error {
|
||||||
s.Container.OomDisabled = v
|
s.Container.OomDisabled = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Environment and Mappings should be treated as a full update at all times, never a
|
||||||
|
// true patch, otherwise we can't know what we're passing along.
|
||||||
|
if len(src.EnvVars) > 0 {
|
||||||
|
s.EnvVars = src.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(src.Allocations.Mappings) > 0 {
|
||||||
|
s.Allocations.Mappings = src.Allocations.Mappings
|
||||||
|
}
|
||||||
|
|
||||||
s.Container.RebuildRequired = true
|
s.Container.RebuildRequired = true
|
||||||
if _, err := s.WriteConfigurationToDisk(); err != nil {
|
if _, err := s.WriteConfigurationToDisk(); err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.Environment.InSituUpdate()
|
return s.Environment.InSituUpdate()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user