From 56a17823cb2b56ff6c55afb39306b17dfe2fdf51 Mon Sep 17 00:00:00 2001 From: pikastech Date: Tue, 21 Jul 2026 15:43:35 +0200 Subject: [PATCH] =?UTF-8?q?fix(temporal):=20=E7=94=B1=20Argo=20=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E9=80=BB=E8=BE=91=E5=91=BD=E5=90=8D=E7=A9=BA?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/src/platform-infra-temporal.ts | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/scripts/src/platform-infra-temporal.ts b/scripts/src/platform-infra-temporal.ts index 3946b1b1..270cb9ad 100644 --- a/scripts/src/platform-infra-temporal.ts +++ b/scripts/src/platform-infra-temporal.ts @@ -252,6 +252,10 @@ function renderManifest(temporal: TemporalConfig, target: TemporalTarget, materi : material; const encoded = (value: string) => Buffer.from(value, "utf8").toString("base64"); const namespace = target.namespace; + const logicalNamespaceCommands = temporal.runtime.logicalNamespaces.map((item) => ` + if ! temporal operator namespace describe --address ${server.serviceName}:${server.frontendPort} --namespace ${item.name} >/dev/null 2>&1; then + temporal operator namespace create --address ${server.serviceName}:${server.frontendPort} --namespace ${item.name} --retention ${item.retention} + fi`).join(""); const databaseSecret = includeDatabaseSecret ? `--- apiVersion: v1 kind: Secret @@ -463,6 +467,41 @@ spec: - name: web-admin-password secret: secretName: ${ui.auth.secretName} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: temporal-logical-namespaces + namespace: ${namespace} + annotations: + argocd.argoproj.io/hook: PostSync + argocd.argoproj.io/hook-delete-policy: BeforeHookCreation,HookSucceeded + labels: + app.kubernetes.io/name: temporal-logical-namespaces + app.kubernetes.io/part-of: temporal +spec: + backoffLimit: 1 + template: + metadata: + labels: + app.kubernetes.io/name: temporal-logical-namespaces + app.kubernetes.io/part-of: temporal + spec: + restartPolicy: Never + containers: + - name: configure + image: ${temporal.images.server} + imagePullPolicy: ${temporal.images.pullPolicy} + command: + - sh + - -ec + - | + attempts=${Math.max(1, Math.ceil(temporal.runtime.rolloutTimeoutSeconds / 5))} + until temporal operator cluster health --address ${server.serviceName}:${server.frontendPort} >/dev/null 2>&1; do + attempts=$((attempts - 1)) + test "$attempts" -gt 0 + sleep 5 + done${logicalNamespaceCommands} `; }