package host import ( "context" "log" "github.com/carlosframework/platform/internal/activator" "github.com/carlosframework/platform/internal/registry" "github.com/carlosframework/platform/internal/release" ) func (n namedUnitRecovery) passOption(reg *registry.Registry, checks rootRestartChecks, getenv func(string) string) release.PassOption { remainingNamed := false return release.WithRecovery(func(ctx context.Context, rt registry.Route) (bool, error) { done, err := n.recover(ctx, rt.Host, checks, getenv, reg) if err != nil { log.Printf("adopt: %v", err) return true, nil } if !done && (release.Adoptable(rt) || release.SidecarAdoptable(rt)) && rt.Unit != "" && rt.Unit != activator.UnitName(rt.Host) { remainingNamed = true } return done, nil }, func() (bool, error) { named := remainingNamed remainingNamed = false if !named { return true, nil } return checks.allowLegacy() }) }