fix: keep v02 config hashes label-safe

This commit is contained in:
Codex
2026-05-31 12:37:46 +08:00
parent 794bea65e8
commit 15294ee30d
3 changed files with 21 additions and 4 deletions
+7 -2
View File
@@ -76,6 +76,11 @@ const codexApiForwarderPort = process.env.HWLAB_G14_CODEX_API_FORWARDER_PORT ||
const codexApiForwarderUpstreamBaseUrl = process.env.HWLAB_G14_CODEX_API_UPSTREAM_BASE_URL || "https://hyueapi.com";
const sourceCommitPattern = /^[a-f0-9]{7,40}$/u;
const v02EnvReuseRuntimeMode = "env-reuse-git-mirror-checkout";
function k8sLabelHash(value) {
return String(value || "").slice(0, 16);
}
const primitiveValidationTasks = Object.freeze([
{
name: "repo-reports-guard",
@@ -3580,7 +3585,7 @@ localPort = 6667
remotePort = ${edgeRemotePort}
`;
const configSha256 = createHash("sha256").update(configText).digest("hex");
const templateLabels = { ...labels, "hwlab.pikastech.local/config-sha256": configSha256 };
const templateLabels = { ...labels, "hwlab.pikastech.local/config-sha256": k8sLabelHash(configSha256) };
const templateAnnotations = { "hwlab.pikastech.local/config-sha256": configSha256 };
return {
apiVersion: "v1",
@@ -4036,7 +4041,7 @@ function v02PostgresManifest({ migrationSql, source }) {
"hwlab.pikastech.local/environment": "v02",
"hwlab.pikastech.local/gitops-target": "v02",
"hwlab.pikastech.local/profile": "v02",
"hwlab.pikastech.local/migration-sha256": migrationSha256
"hwlab.pikastech.local/migration-sha256": k8sLabelHash(migrationSha256)
};
const templateAnnotations = { "hwlab.pikastech.local/migration-sha256": migrationSha256 };
return {