Whoops, sync correctly
This commit is contained in:
parent
16467fa7ff
commit
21e58b57a1
|
@ -80,7 +80,7 @@ func New(data []byte) (*Installer, error) {
|
||||||
|
|
||||||
// Create a new server instance using the configuration we wrote to the disk
|
// Create a new server instance using the configuration we wrote to the disk
|
||||||
// so that everything gets instantiated correctly on the struct.
|
// so that everything gets instantiated correctly on the struct.
|
||||||
s, err := server.FromConfiguration(c, true)
|
s, err := server.FromConfiguration(c)
|
||||||
|
|
||||||
return &Installer{
|
return &Installer{
|
||||||
server: s,
|
server: s,
|
||||||
|
|
|
@ -57,7 +57,7 @@ func LoadDirectory() error {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
log.WithField("uuid", uuid).Debug("creating server object from configuration")
|
log.WithField("uuid", uuid).Debug("creating server object from configuration")
|
||||||
s, err := FromConfiguration(data, false)
|
s, err := FromConfiguration(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithField("server", uuid).WithField("error", err).Error("failed to load server, skipping...")
|
log.WithField("server", uuid).WithField("error", err).Error("failed to load server, skipping...")
|
||||||
return
|
return
|
||||||
|
@ -82,7 +82,7 @@ func LoadDirectory() error {
|
||||||
// Initializes a server using a data byte array. This will be marshaled into the
|
// Initializes a server using a data byte array. This will be marshaled into the
|
||||||
// given struct using a YAML marshaler. This will also configure the given environment
|
// given struct using a YAML marshaler. This will also configure the given environment
|
||||||
// for a server.
|
// for a server.
|
||||||
func FromConfiguration(data *api.ServerConfigurationResponse, sync bool) (*Server, error) {
|
func FromConfiguration(data *api.ServerConfigurationResponse) (*Server, error) {
|
||||||
cfg := Configuration{}
|
cfg := Configuration{}
|
||||||
if err := defaults.Set(&cfg); err != nil {
|
if err := defaults.Set(&cfg); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -114,11 +114,9 @@ func FromConfiguration(data *api.ServerConfigurationResponse, sync bool) (*Serve
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forces the configuration to be synced with the panel.
|
// Forces the configuration to be synced with the panel.
|
||||||
if sync {
|
|
||||||
if err := s.SyncWithConfiguration(data); err != nil {
|
if err := s.SyncWithConfiguration(data); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user