Fix run package profile and log ingestion
This commit is contained in:
@@ -234,6 +234,7 @@ func (svc *CoreService) runDistributionPackageContext(distribution domain.RunDis
|
||||
} else if !errors.Is(bindingErr, repo.ErrNotFound) {
|
||||
return runDistributionPackageContext{}, bindingErr
|
||||
}
|
||||
profileKey = defaultRunDistributionProfileKey(plugin, profileKey)
|
||||
plan, err := runAutonomousLifecyclePlan(distribution, instance, plugin, profileKey, bindings)
|
||||
if err != nil {
|
||||
return runDistributionPackageContext{}, err
|
||||
@@ -245,6 +246,20 @@ func (svc *CoreService) runDistributionPackageContext(distribution domain.RunDis
|
||||
return runDistributionPackageContext{profileKey: profileKey, workspaceSeed: seed, autonomousLifecycle: plan}, nil
|
||||
}
|
||||
|
||||
func defaultRunDistributionProfileKey(plugin domain.GamePlugin, profileKey string) string {
|
||||
profileKey = strings.TrimSpace(profileKey)
|
||||
if profileKey != "" {
|
||||
if profile, ok := runtimeLifecycleProfileForKey(plugin.RuntimeProfiles, profileKey); ok {
|
||||
return profile.Key
|
||||
}
|
||||
return profileKey
|
||||
}
|
||||
if len(plugin.RuntimeProfiles.LifecycleProfiles) == 0 {
|
||||
return ""
|
||||
}
|
||||
return plugin.RuntimeProfiles.LifecycleProfiles[0].Key
|
||||
}
|
||||
|
||||
func runAutonomousLifecyclePlan(distribution domain.RunDistribution, instance domain.ServerInstance, plugin domain.GamePlugin, profileKey string, bindings map[string]string) (*domain.RunAutonomousLifecyclePlan, error) {
|
||||
plan := &domain.RunAutonomousLifecyclePlan{
|
||||
SchemaVersion: "1",
|
||||
|
||||
Reference in New Issue
Block a user