fix: keep v02 config hashes label-safe
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user