Skip to content

feat: implement cmd management for targets, LUNs, and TPGTs#129

Merged
carmark merged 1 commit into
masterfrom
feat/cmd-manage-targets-luns-tpgt
Mar 14, 2026
Merged

feat: implement cmd management for targets, LUNs, and TPGTs#129
carmark merged 1 commit into
masterfrom
feat/cmd-manage-targets-luns-tpgt

Conversation

@carmark
Copy link
Copy Markdown
Contributor

@carmark carmark commented Mar 14, 2026

Summary

Closes #36

  • Fix target delete URL path bug: client sent DELETE to /targets/<name> but server route was /target/{name}
  • Implement target create/delete server handlers: previously no-op stubs, now fully functional with validation and proper HTTP status codes
  • Add DeleteTarget to SCSI service: with force flag support and mutex locking for thread safety
  • Implement full LU management: create/list/delete through all layers (CLI -> API client -> server -> SCSI service)
  • Add TPGT list command: gotgt list tpgt --target <name> to show target portal group tags
  • Add unit tests: 14 new tests covering target router handlers, LU router handlers, and SCSI service DeleteTarget

New CLI commands

gotgt create lu --target <name> --lun <n> --device-id <id> --path <path> [--block-shift <n>]
gotgt list lu --target <name>
gotgt list tpgt --target <name>
gotgt rm lu --target <name> --lun <n>

Test plan

  • go build ./... passes
  • go vet ./... passes
  • gofmt -l . clean
  • go test -v ./pkg/... ./mock/... - all 47 tests pass
  • CI pipeline (build + unit tests + libiscsi functional tests)

🤖 Generated with Claude Code

- Fix target delete URL path mismatch (/targets/ -> /target/)
- Implement target create/delete server handlers with proper validation
- Add DeleteTarget method with force flag and mutex locking to SCSITargetService
- Implement full LU management: create/list/delete through CLI, client, and server
- Add TPGT list command to show target portal group tags
- Add unit tests for target/LU router handlers and SCSI service

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@carmark carmark merged commit d0ec4ba into master Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add more commands or options

1 participant