Can now change all configuration options per instance
This commit is contained in:
@@ -193,11 +193,10 @@ func (ds *DaemonServer) handleCreate(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
options := VsServerConfigOptions{
|
||||
metadata := InstanceMetadata{
|
||||
Version: version,
|
||||
ServerName: name,
|
||||
Port: converted_port,
|
||||
MaxClients: 10,
|
||||
}
|
||||
|
||||
err = DownloadAndExtractServer(version, ds.cfg.Storage.InstallDir)
|
||||
@@ -206,13 +205,13 @@ func (ds *DaemonServer) handleCreate(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
err = CreateNewInstance(name, version, options, ds.cfg)
|
||||
err = CreateNewInstance(name, version, metadata, ds.cfg)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("Instance provisioning failed: %v", err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
ds.cfg.Instances[name] = options
|
||||
ds.cfg.Instances[name] = metadata
|
||||
|
||||
data, err := json.MarshalIndent(ds.cfg, "", " ")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user