fix: [nomad-step-3] S3-fix-3 — host-volume dirs need 0777 for non-root containers (#953) #957

Merged
dev-qwen2 merged 1 commit from fix/issue-953 into main 2026-04-17 10:40:33 +00:00
Collaborator

Fixes #953

Changes

Fixes #953 ## Changes
dev-qwen2 added 1 commit 2026-04-17 09:51:52 +00:00
fix: [nomad-step-3] S3-fix-3 — host-volume dirs need 0777 for non-root containers (#953)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/nomad-validate Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/nomad-validate Pipeline was successful
494958f97a
Collaborator

AI Review

Findings

  • blocker lib/init/nomad/cluster-up.sh:278-285: The loop's idempotency gate checks only existence (if [ -d "$d" ]), not permissions. On any host that already ran cluster-up.sh with the old 0755 mode, re-running after this fix will hit the unchanged branch and skip the install -d call, leaving the directory at 0755. The fix only takes effect on freshly-created directories.

    The install -d -m 0777 call in the else branch is unreachable for pre-existing dirs. A chmod (or permission-aware check) is needed to cover the remediation path:

    for d "${HOST_VOLUME_DIRS[@]}"; do
      if [ -d "$d" ]; then
        log "unchanged: ${d}"
      else
        log "creating: ${d}"
        install -d -o root -g root "$d"
      fi
      chmod 0777 "$d"   # ensure correct mode on both create and re-run
    done
    

    The dry-run printf at line 119 is correctly updated — that half of the fix is fine.

Verdict

REQUEST_CHANGES — idempotency check is existence-only; re-running on hosts with pre-existing 0755 dirs skips the permission fix


Reviewed at 494958f | AGENTS.md

## AI Review <!-- reviewed: 494958f97ad07760d606823f940e33f06dc3fe76 --> ### Findings - **blocker** `lib/init/nomad/cluster-up.sh:278-285`: The loop's idempotency gate checks only existence (`if [ -d "$d" ]`), not permissions. On any host that already ran `cluster-up.sh` with the old `0755` mode, re-running after this fix will hit the `unchanged` branch and skip the `install -d` call, leaving the directory at `0755`. The fix only takes effect on freshly-created directories. The `install -d -m 0777` call in the `else` branch is unreachable for pre-existing dirs. A `chmod` (or permission-aware check) is needed to cover the remediation path: ```bash for d "${HOST_VOLUME_DIRS[@]}"; do if [ -d "$d" ]; then log "unchanged: ${d}" else log "creating: ${d}" install -d -o root -g root "$d" fi chmod 0777 "$d" # ensure correct mode on both create and re-run done ``` The dry-run printf at line 119 is correctly updated — that half of the fix is fine. ### Verdict **REQUEST_CHANGES** — idempotency check is existence-only; re-running on hosts with pre-existing 0755 dirs skips the permission fix --- *Reviewed at `494958f` | [AGENTS.md](AGENTS.md)*
review-bot requested changes 2026-04-17 09:58:28 +00:00
Dismissed
review-bot left a comment
Collaborator

AI Review: REQUEST_CHANGES — idempotency check is existence-only; re-running on hosts with pre-existing 0755 dirs skips the permission fix

AI Review: **REQUEST_CHANGES** — idempotency check is existence-only; re-running on hosts with pre-existing 0755 dirs skips the permission fix
dev-qwen2 force-pushed fix/issue-953 from 494958f97a to ec3b51724f 2026-04-17 10:00:24 +00:00 Compare
Collaborator

AI Re-review (round 2)

Previous Findings\n- blocker cluster-up.sh:278-285: idempotency gate existence-only; re-run on pre-existing 0755 dirs skipped permission fix → FIXED: chmod 0777 "$d" now runs unconditionally after the if/else block, so both freshly-created dirs (via install -d -m 0777) and pre-existing dirs (which hit the unchanged branch) get the correct mode applied on every run.

Verdict

APPROVE — chmod 0777 added unconditionally after the if/else block, covering both new and pre-existing dirs


Reviewed at ec3b517 | Previous: 494958f | AGENTS.md

## AI Re-review (round 2) <!-- reviewed: ec3b51724f6dd56a2b4f8fb51eeed6a718f7880b --> ### Previous Findings\n- **blocker** `cluster-up.sh:278-285`: idempotency gate existence-only; re-run on pre-existing 0755 dirs skipped permission fix → **FIXED**: `chmod 0777 "$d"` now runs unconditionally after the if/else block, so both freshly-created dirs (via `install -d -m 0777`) and pre-existing dirs (which hit the `unchanged` branch) get the correct mode applied on every run. ### Verdict **APPROVE** — chmod 0777 added unconditionally after the if/else block, covering both new and pre-existing dirs --- *Reviewed at `ec3b517` | Previous: `494958f` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-17 10:39:35 +00:00
review-bot left a comment
Collaborator

AI Re-review (round 2): APPROVE — chmod 0777 added unconditionally after the if/else block, covering both new and pre-existing dirs

AI Re-review (round 2): **APPROVE** — chmod 0777 added unconditionally after the if/else block, covering both new and pre-existing dirs
dev-qwen2 merged commit 2ef77f4aa3 into main 2026-04-17 10:40:33 +00:00
dev-qwen2 deleted branch fix/issue-953 2026-04-17 10:40:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#957
No description provided.