fix: align opencode workspace event root

This commit is contained in:
UniDesk Codex
2026-06-30 13:56:27 +08:00
parent 6bf9a49f6d
commit 77403faa9a
3 changed files with 113 additions and 12 deletions
+21
View File
@@ -5842,6 +5842,27 @@ function opencodeServerManifest({ profile = "v03", source, deploy = null, catalo
spec: {
serviceAccountName: name,
securityContext: { fsGroup: 1000, fsGroupChangePolicy: "OnRootMismatch" },
initContainers: [{
name: "opencode-workspace-git-init",
image: helperImage,
imagePullPolicy: "IfNotPresent",
command: ["/bin/sh", "-ec"],
args: [
[
"set -eu",
"mkdir -p /workspace",
"if [ ! -d /workspace/.git ]; then",
" git -C /workspace init",
"fi",
"git -C /workspace config user.name 'HWLAB OpenCode' || true",
"git -C /workspace config user.email 'opencode@hwlab.local' || true",
"chgrp -R 1000 /workspace/.git 2>/dev/null || true",
"chmod -R g+rwX /workspace/.git 2>/dev/null || true"
].join("\n")
],
resources: { requests: { cpu: "25m", memory: "64Mi" }, limits: { cpu: "250m", memory: "256Mi" } },
volumeMounts: [{ name: "workspace", mountPath: "/workspace" }]
}],
containers: [{
name,
image: "ghcr.io/anomalyco/opencode:1.17.7",