test: extend deploy json drift contract to decision center
This commit is contained in:
@@ -1396,7 +1396,7 @@ function deployRefFor(options: ArtifactRegistryOptions, spec: ArtifactConsumerSp
|
||||
function deployJsonServiceForOptions(options: ArtifactRegistryOptions, spec: ArtifactConsumerSpec, environment: ArtifactDeployEnvironment): DeployJsonServiceContract | null {
|
||||
if (!options.dryRun) return null;
|
||||
if (options.deployJsonService !== null) return options.deployJsonService;
|
||||
if (environment === "dev" && spec.serviceId === "mdtodo") {
|
||||
if (environment === "dev" && (spec.serviceId === "decision-center" || spec.serviceId === "mdtodo")) {
|
||||
return readDeployJsonServiceContractFromFile(environment, spec.serviceId);
|
||||
}
|
||||
return null;
|
||||
@@ -1444,6 +1444,9 @@ function artifactRegistryDeployJsonMirrors(
|
||||
containerPort: target.k3s.servicePort,
|
||||
servicePort: target.k3s.servicePort,
|
||||
healthPath: target.k3s.healthPath,
|
||||
health: options.deployJsonService?.runtime?.health === undefined ? undefined : {
|
||||
deployMetadataRequired: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -78,6 +78,9 @@ export interface DeployJsonExecutorMirror {
|
||||
request?: string;
|
||||
limit?: string;
|
||||
};
|
||||
health?: {
|
||||
deployMetadataRequired?: boolean;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -295,6 +298,9 @@ export function compareDeployJsonExecutorMirrors(
|
||||
pushDrift(items, mirror, "runtime.healthPath", service.runtime.healthPath, mirror.runtime.healthPath);
|
||||
pushDrift(items, mirror, "runtime.memory.request", service.runtime.memory.request, mirror.runtime.memory?.request);
|
||||
pushDrift(items, mirror, "runtime.memory.limit", service.runtime.memory.limit, mirror.runtime.memory?.limit);
|
||||
if (service.runtime.health !== undefined) {
|
||||
pushDrift(items, mirror, "runtime.health.deployMetadataRequired", service.runtime.health.deployMetadataRequired, mirror.runtime.health?.deployMetadataRequired);
|
||||
}
|
||||
}
|
||||
}
|
||||
return items;
|
||||
@@ -366,6 +372,14 @@ export function k3sManifestExecutorMirror(service: DeployJsonServiceContract): D
|
||||
request: firstRegex(container, /^\s+requests:\s*$[\s\S]*?^\s+memory:\s*([^\s#"]+)\s*$/mu),
|
||||
limit: firstRegex(container, /^\s+limits:\s*$[\s\S]*?^\s+memory:\s*([^\s#"]+)\s*$/mu),
|
||||
},
|
||||
health: {
|
||||
deployMetadataRequired: [
|
||||
"UNIDESK_DEPLOY_SERVICE_ID",
|
||||
"UNIDESK_DEPLOY_REPO",
|
||||
"UNIDESK_DEPLOY_COMMIT",
|
||||
"UNIDESK_DEPLOY_REQUESTED_COMMIT",
|
||||
].every((name) => container.includes(`name: ${name}`)),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1042,6 +1042,9 @@ function deployJsonExecutorMirrors(
|
||||
containerPort: serviceConfig.backend.nodePort,
|
||||
servicePort: serviceConfig.backend.nodePort,
|
||||
healthPath: serviceConfig.backend.healthPath,
|
||||
health: service.runtime?.health === undefined ? undefined : {
|
||||
deployMetadataRequired: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
const manifestMirror = k3sManifestExecutorMirror(service);
|
||||
|
||||
Reference in New Issue
Block a user