bug(cli): resource add container-instance missing --mount flag for dual mount support #1078

Closed
opened 2026-03-20 08:22:24 +00:00 by hurui200320 · 3 comments
Member

Metadata

  • Commit Message: fix(cli): implement --mount flag on resource add container-instance
  • Branch: bugfix/m8-container-mount-flag

Background

Specification Workflow Example 17 describes a container-instance resource with two mount specifications:

  • A resource-reference mount (read-write): --mount local/api-repo:/workspace
  • A raw host-path mount (read-only): --mount /var/shared/config:/config:ro

The current resource add container-instance CLI command only supports --image but does not implement --mount flags. This prevents WF17 AC #2 from being satisfied.

Discovered during E2E testing in #763.

Expected Behavior

resource add container-instance should accept one or more --mount flags to specify volume mounts per the specification.

Acceptance Criteria

  • resource add container-instance accepts --mount flag(s)
  • Resource-reference mount format supported: --mount <resource-name>:<container-path>
  • Host-path mount format supported: --mount <host-path>:<container-path>:<mode> (mode = rw/ro)
  • Multiple --mount flags can be specified on a single command
  • Mount information is persisted and retrievable via resource show
  • E2E test in WF17 suite exercises dual-mount registration

Subtasks

  • Implement --mount CLI flag on resource add container-instance
  • Support resource-reference and host-path mount formats
  • Persist mount specs in resource storage
  • Remove @tdd_expected_fail from WF17 dual-mount test case
  • Verify via nox -s e2e_tests

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `fix(cli): implement --mount flag on resource add container-instance` - **Branch**: `bugfix/m8-container-mount-flag` ## Background Specification Workflow Example 17 describes a container-instance resource with two mount specifications: - A resource-reference mount (read-write): `--mount local/api-repo:/workspace` - A raw host-path mount (read-only): `--mount /var/shared/config:/config:ro` The current `resource add container-instance` CLI command only supports `--image` but does not implement `--mount` flags. This prevents WF17 AC #2 from being satisfied. Discovered during E2E testing in #763. ## Expected Behavior `resource add container-instance` should accept one or more `--mount` flags to specify volume mounts per the specification. ## Acceptance Criteria - [ ] `resource add container-instance` accepts `--mount` flag(s) - [ ] Resource-reference mount format supported: `--mount <resource-name>:<container-path>` - [ ] Host-path mount format supported: `--mount <host-path>:<container-path>:<mode>` (mode = rw/ro) - [ ] Multiple `--mount` flags can be specified on a single command - [ ] Mount information is persisted and retrievable via `resource show` - [ ] E2E test in WF17 suite exercises dual-mount registration ## Subtasks - [ ] Implement `--mount` CLI flag on `resource add container-instance` - [ ] Support resource-reference and host-path mount formats - [ ] Persist mount specs in resource storage - [ ] Remove `@tdd_expected_fail` from WF17 dual-mount test case - [ ] Verify via `nox -s e2e_tests` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v3.5.0 milestone 2026-03-22 16:31:10 +00:00
Owner

Assigned to @hamza.khyari for bug fix based on developer expertise (container/resource management — Hamza). Milestone set to v3.5.0. State changed from Unverified to Verified. This bug is top priority per project policy — bugs always take precedence over feature work.

Assigned to @hamza.khyari for bug fix based on developer expertise (container/resource management — Hamza). Milestone set to v3.5.0. State changed from Unverified to Verified. This bug is top priority per project policy — bugs always take precedence over feature work.
Owner

TDD workflow initiated for this bug:

  • Created TDD issue #1099 to write a tagged test that captures this bug.
  • Dependency link added: this issue is blocked by #1099.
  • Once #1099 is merged to master, the bug fix assignee should create the bugfix branch and implement the fix.
  • The fix must remove the @tdd_expected_fail tag from the test so it runs normally.
TDD workflow initiated for this bug: - Created TDD issue #1099 to write a tagged test that captures this bug. - Dependency link added: this issue is blocked by #1099. - Once #1099 is merged to `master`, the bug fix assignee should create the bugfix branch and implement the fix. - The fix must remove the `@tdd_expected_fail` tag from the test so it runs normally.
freemo self-assigned this 2026-04-02 06:13:54 +00:00
Owner

Implementation Status

The --mount flag for resource add container-instance has been fully implemented and merged to master via PR #1134.

What was implemented:

  • _parse_mount_spec() function parses both mount formats:
    • Resource-reference: <resource-name>:<container-path> → type=resource, mode=rw
    • Host-path: <host-path>:<container-path>:<mode> → type=bind, mode=rw/ro
  • --mount flag added to resource add command (repeatable, container-instance only)
  • Mounts stored as JSON in resource.properties['mounts']
  • _format_properties() renders mounts in human-readable format for resource show
  • 8 Behave BDD scenarios in features/container_mount_flag.feature covering all acceptance criteria
  • WF17 robot test WF17 TDD Dual Mount Registration updated (no longer @tdd_expected_fail)

Acceptance Criteria Status:

  • resource add container-instance accepts --mount flag(s)
  • Resource-reference mount format: --mount <resource-name>:<container-path>
  • Host-path mount format: --mount <host-path>:<container-path>:<mode> (mode = rw/ro)
  • Multiple --mount flags can be specified
  • Mount information is persisted and retrievable via resource show

All code passes ruff check and pyright type checking. Closing this issue as the fix is merged.

## Implementation Status The `--mount` flag for `resource add container-instance` has been fully implemented and merged to master via PR #1134. ### What was implemented: - `_parse_mount_spec()` function parses both mount formats: - Resource-reference: `<resource-name>:<container-path>` → type=`resource`, mode=`rw` - Host-path: `<host-path>:<container-path>:<mode>` → type=`bind`, mode=`rw`/`ro` - `--mount` flag added to `resource add` command (repeatable, container-instance only) - Mounts stored as JSON in `resource.properties['mounts']` - `_format_properties()` renders mounts in human-readable format for `resource show` - 8 Behave BDD scenarios in `features/container_mount_flag.feature` covering all acceptance criteria - WF17 robot test `WF17 TDD Dual Mount Registration` updated (no longer `@tdd_expected_fail`) ### Acceptance Criteria Status: - ✅ `resource add container-instance` accepts `--mount` flag(s) - ✅ Resource-reference mount format: `--mount <resource-name>:<container-path>` - ✅ Host-path mount format: `--mount <host-path>:<container-path>:<mode>` (mode = rw/ro) - ✅ Multiple `--mount` flags can be specified - ✅ Mount information is persisted and retrievable via `resource show` All code passes `ruff check` and `pyright` type checking. Closing this issue as the fix is merged.
Sign in to join this conversation.
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.

Reference
cleveragents/cleveragents-core#1078
No description provided.