27 lines
970 B
Go
27 lines
970 B
Go
package service
|
|
|
|
import "browser.local/platform/domain"
|
|
|
|
func applyPluginCreateDefaults(plugin domain.GamePlugin, definition domain.ServerDeploymentDefinition) domain.ServerDeploymentDefinition {
|
|
definition = domain.CopyServerDeploymentDefinition(definition)
|
|
if definition.ProfileKey == "" && len(plugin.RuntimeProfiles.LifecycleProfiles) > 0 {
|
|
definition.ProfileKey = plugin.RuntimeProfiles.LifecycleProfiles[0].Key
|
|
}
|
|
if definition.Mode != domain.ServerDeploymentModeGuided {
|
|
return definition
|
|
}
|
|
if definition.CreateInputs == nil {
|
|
definition.CreateInputs = map[string]string{}
|
|
}
|
|
for _, field := range plugin.CreateFields {
|
|
if _, present := definition.CreateInputs[field.Key]; !present && field.DefaultValue != "" {
|
|
definition.CreateInputs[field.Key] = field.DefaultValue
|
|
}
|
|
}
|
|
return definition
|
|
}
|
|
|
|
func deploymentNeedsCompleteRuntimeBinding(_ domain.GamePlugin, definition domain.ServerDeploymentDefinition) bool {
|
|
return definition.Mode == ""
|
|
}
|