Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export const RegistryConfigSchema = z
engineHost: z
.string()
.optional()
.default(() => getRivetRunEngineHost() ?? ENGINE_HOST),
.transform((value) => value ?? getRivetRunEngineHost()),
/**
* @experimental
*
Expand All @@ -237,7 +237,7 @@ export const RegistryConfigSchema = z
.min(1)
.max(65_535)
.optional()
.default(() => getRivetRunEnginePort() ?? ENGINE_PORT),
.transform((value) => value ?? getRivetRunEnginePort()),
/** @experimental */
engineVersion: z
.string()
Expand Down Expand Up @@ -347,8 +347,8 @@ export const RegistryConfigSchema = z

// Flatten the endpoint and apply defaults for namespace/token.
const localEngineEndpoint = buildEngineEndpoint(
config.engineHost,
config.enginePort,
config.engineHost ?? ENGINE_HOST,
config.enginePort ?? ENGINE_PORT,
);
const endpoint = config.startEngine
? localEngineEndpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ describe("Registry constructor", () => {
expect(config.publicEndpoint).toBe("http://127.0.0.1:7655");
});

test("does not override the bind address for an explicit engine endpoint", async () => {
const config = RegistryConfigSchema.parse({
use: {
test: testActor,
},
startEngine: false,
endpoint: "http://127.0.0.1:7656",
});

const serveConfig = await buildServeConfig(config);

expect(new URL(serveConfig.endpoint).origin).toBe(
"http://127.0.0.1:7656",
);
expect(serveConfig.engineHost).toBeUndefined();
expect(serveConfig.enginePort).toBeUndefined();
});

test("keeps endpoint separate from spawned local engine config", () => {
const result = RegistryConfigSchema.safeParse({
use: {
Expand Down