Fix SCUM generated run deployment flow

This commit is contained in:
npc0-hue
2026-07-31 14:10:30 +08:00
parent 6d71d8d232
commit f23d18ea57
11 changed files with 291 additions and 35 deletions
+3 -3
View File
@@ -129,7 +129,7 @@ func (svc *CoreService) RegisterRunHello(hello domain.RunControlHello) (domain.R
}
// queueManagedGuidedDeploymentAfterRegistration advances only a newly-created,
// target-bound guided server. Selecting guided-install is the owner's prior
// dedicated guided server. Selecting guided-install is the owner's prior
// authorization for this bounded write; reconnects remain idempotent.
func (svc *CoreService) queueManagedGuidedDeploymentAfterRegistration(hello domain.RunControlHello) error {
if hello.ComponentKind != domain.DistributionComponentRun || strings.TrimSpace(hello.ServerInstanceID) == "" {
@@ -139,7 +139,7 @@ func (svc *CoreService) queueManagedGuidedDeploymentAfterRegistration(hello doma
if err != nil {
return err
}
if strings.TrimSpace(instance.DeploymentTargetID) == "" || instance.RunEndpointID != hello.RunEndpointID || instance.State != domain.ServerInstanceStateDraft || instance.Deployment.Mode != domain.ServerDeploymentModeGuided {
if instance.RunEndpointID != hello.RunEndpointID || instance.RunEndpointID != dedicatedRunEndpointID(instance.ID) || instance.State != domain.ServerInstanceStateDraft || instance.Deployment.Mode != domain.ServerDeploymentModeGuided {
return nil
}
_, err = svc.deployServerInstance(domain.ServerLifecycleCommand{
@@ -158,7 +158,7 @@ func (svc *CoreService) validateDedicatedRunHello(hello domain.RunControlHello)
if err != nil {
return err
}
if strings.TrimSpace(instance.DeploymentTargetID) == "" {
if strings.TrimSpace(instance.DeploymentTargetID) == "" && instance.RunEndpointID != dedicatedRunEndpointID(instance.ID) {
return nil // legacy Run registrations keep their historical endpoint contract.
}
if hello.PluginID != instance.PluginID || hello.RunEndpointID != instance.RunEndpointID {