Finish controlplane naming propagation sweep

---
Build: pass | Tests: pass — 122 passed (7 files)
This commit is contained in:
Mevy Assistant 2026-04-24 16:03:47 +02:00
parent b5eeb4bfda
commit 9fea739140
7 changed files with 19 additions and 17 deletions

View file

@ -1,4 +1,4 @@
import { PLATFORM_SERVICE_NAME } from '../src/config.js';
import { CONTROLPLANE_INTERNAL_DOMAIN } from '../src/config.js';
const API_PORT = parseInt(process.env.CONTROLPLANE_PORT ?? '3100', 10);
const API_HOST = process.env.CONTROLPLANE_BIND_HOST ?? '127.0.0.1';
@ -37,10 +37,12 @@ async function main(): Promise<void> {
const msg = err instanceof Error ? err.message : String(err);
if (msg.includes('ECONNREFUSED')) {
console.error(
`${PLATFORM_SERVICE_NAME} controlplane API not reachable at`,
`${CONTROLPLANE_INTERNAL_DOMAIN} controlplane API not reachable at`,
`${API_HOST}:${API_PORT}`,
);
console.error(`Is the ${PLATFORM_SERVICE_NAME} platform service running?`);
console.error(
`Is the operator controlplane at ${CONTROLPLANE_INTERNAL_DOMAIN} running?`,
);
} else {
console.error('Error:', msg);
}

View file

@ -1,4 +1,4 @@
import { PLATFORM_SERVICE_NAME } from '../src/config.js';
import { CONTROLPLANE_INTERNAL_DOMAIN } from '../src/config.js';
const API_PORT = parseInt(process.env.CONTROLPLANE_PORT ?? '3100', 10);
const API_HOST = process.env.CONTROLPLANE_BIND_HOST ?? '127.0.0.1';
@ -68,7 +68,9 @@ async function main(): Promise<void> {
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
if (msg.includes('ECONNREFUSED')) {
console.error(`${PLATFORM_SERVICE_NAME} controlplane API not reachable`);
console.error(
`${CONTROLPLANE_INTERNAL_DOMAIN} controlplane API not reachable`,
);
} else {
console.error('Error:', msg);
}

View file

@ -1,4 +1,4 @@
import { PLATFORM_SERVICE_NAME } from '../src/config.js';
import { CONTROLPLANE_INTERNAL_DOMAIN } from '../src/config.js';
const API_PORT = parseInt(process.env.CONTROLPLANE_PORT ?? '3100', 10);
const API_HOST = process.env.CONTROLPLANE_BIND_HOST ?? '127.0.0.1';
@ -76,7 +76,7 @@ async function main(): Promise<void> {
const msg = err instanceof Error ? err.message : String(err);
if (msg.includes('ECONNREFUSED')) {
console.error(
`${PLATFORM_SERVICE_NAME} controlplane API not reachable at`,
`${CONTROLPLANE_INTERNAL_DOMAIN} controlplane API not reachable at`,
`${API_HOST}:${API_PORT}`,
);
} else {

View file

@ -18,7 +18,7 @@ import http from 'http';
import net from 'net';
import path from 'path';
import { PLATFORM_SERVICE_NAME } from '../src/config.js';
import { SOCKET_PATH as DEFAULT_HOSTD_SOCKET_PATH } from '../src/hostd/types.js';
const ROOT = new URL('..', import.meta.url).pathname.replace(/\/$/, '');
const OUT_DIR =
@ -27,8 +27,7 @@ const OUT_FILE = path.join(OUT_DIR, 'dashboard.html');
const CP_PORT = parseInt(process.env.CONTROLPLANE_PORT ?? '3100', 10);
const CP_HOST = process.env.CONTROLPLANE_BIND_HOST ?? '127.0.0.1';
const SOCKET_PATH =
process.env.HOSTD_SOCKET ?? `/var/run/${PLATFORM_SERVICE_NAME}-hostd.sock`;
const SOCKET_PATH = process.env.HOSTD_SOCKET ?? DEFAULT_HOSTD_SOCKET_PATH;
// ---------------------------------------------------------------------------
// Data fetching

View file

@ -24,8 +24,8 @@ describe('getControlplaneDbRuntimeIdentity', () => {
}),
).toEqual({
id: 'db-jail',
label: 'Jail clawdie-db (platform data service)',
jailName: 'clawdie-db',
label: 'Jail db (platform data service)',
jailName: 'db',
});
});
});

View file

@ -53,8 +53,8 @@ export function getControlplaneDbRuntimeIdentity(opts: {
return {
id: 'db-jail',
label: `Jail ${opts.platformServiceName}-db (platform data service)`,
jailName: `${opts.platformServiceName}-db`,
label: 'Jail db (platform data service)',
jailName: 'db',
};
}

View file

@ -12,7 +12,8 @@
import http from 'http';
import net from 'net';
import { CONTROLPLANE_SHARED_SECRET, PLATFORM_SERVICE_NAME } from './config.js';
import { CONTROLPLANE_SHARED_SECRET } from './config.js';
import { SOCKET_PATH } from './hostd/types.js';
function getControlplaneBearer(): string | null {
const apiKey = process.env.CONTROLPLANE_API_KEY;
@ -87,8 +88,6 @@ export async function getBudgetSnapshot(): Promise<{ used: number | null; limit:
// Hostd helpers
// ---------------------------------------------------------------------------
const SOCKET_PATH =
process.env.HOSTD_SOCKET ?? `/var/run/${PLATFORM_SERVICE_NAME}-hostd.sock`;
const HOSTD_TIMEOUT_MS = 3000;
interface HostdResponse {