refactor: 移除顶层 defaults 配置段,简化为 target 显式字段 > 代码内置默认值
- 移除 DefaultsConfig 类型、ProbeConfig.defaults 字段 - 移除 CheckerSchemas.defaults、ResolveContext.defaults、CheckerValidationInput.defaults - 更新所有 checker schema/resolve/validate 删除 defaults 合并逻辑 - 更新 config-loader 不再读取传递 defaults - 更新测试、README、DEVELOPMENT、probes.example.yaml - 重新生成 probe-config.schema.json(不含 defaults) - 同步 delta specs 到主规范 - 归档 openspec change
This commit is contained in:
@@ -124,7 +124,7 @@ describe("IcmpChecker resolve", () => {
|
||||
test("解析默认值", () => {
|
||||
const target = checker.resolve(
|
||||
{ icmp: { host: "10.0.0.1" }, id: "ping", type: "icmp" },
|
||||
{ configDir: "/tmp", defaultIntervalMs: 30000, defaults: {}, defaultTimeoutMs: 10000 },
|
||||
{ configDir: "/tmp", defaultIntervalMs: 30000, defaultTimeoutMs: 10000 },
|
||||
);
|
||||
expect(target.icmp).toEqual({ count: 3, host: "10.0.0.1", packetSize: 56 });
|
||||
expect(target.group).toBe("default");
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { RawTargetConfig } from "../../../../../src/server/checker/types";
|
||||
import { validatePingConfig } from "../../../../../src/server/checker/runner/icmp/validate";
|
||||
|
||||
function validate(target: RawTargetConfig) {
|
||||
return validatePingConfig({ defaults: {}, targets: [target] });
|
||||
return validatePingConfig({ targets: [target] });
|
||||
}
|
||||
|
||||
describe("validatePingConfig", () => {
|
||||
|
||||
Reference in New Issue
Block a user