ymal: compose repeated node lane templates
This commit is contained in:
@@ -4,6 +4,7 @@ import { existsSync, readFileSync } from "node:fs";
|
||||
import { rootPath } from "./config";
|
||||
import { readWebProbeSentinelConfigRefTarget, type WebProbeSentinelTemplateContext } from "./hwlab-node-web-sentinel-config-ref";
|
||||
import { HWLAB_WEB_PROBE_SENTINEL_CONFIG_REF_KEYS, type HwlabRuntimeLaneSpec, type HwlabRuntimeWebProbeSentinelConfigRefKey, type HwlabRuntimeWebProbeSentinelRegistryItemSpec } from "./hwlab-node-lanes";
|
||||
import { materializeYamlComposition } from "./yaml-composition";
|
||||
|
||||
export interface ResolvedWebProbeSentinel {
|
||||
readonly id: string;
|
||||
@@ -169,7 +170,7 @@ export function readConfigRefTarget(ref: string, context?: WebProbeSentinelTempl
|
||||
}
|
||||
const absPath = rootPath(file);
|
||||
if (!existsSync(absPath)) throw new Error(`${file} does not exist`);
|
||||
const doc = Bun.YAML.parse(readFileSync(absPath, "utf8")) as unknown;
|
||||
const doc = materializeYamlComposition(Bun.YAML.parse(readFileSync(absPath, "utf8")) as unknown, { label: file }).value;
|
||||
return valueAtPath(doc, path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user