Bug Description
`cmd/virtwork/main.go` (lines 254-256) hardcodes `roles := []string{"server", "client"}` when iterating over a `MultiVMWorkload`. The `MultiVMWorkload` interface defines `UserdataForRole(role string, ...)` but provides no method for a workload to declare its supported roles. If a future MultiVMWorkload implementation uses different role names, the orchestrator will silently pass the wrong roles.
Steps to Reproduce
- Implement a new `MultiVMWorkload` with roles other than "server" and "client" (e.g., "primary" and "replica")
- Register the workload and run it via `virtwork run`
- The orchestrator passes "server" and "client" roles regardless of the workload's actual role names
Expected Behavior
`MultiVMWorkload` interface should expose a `Roles() []string` method, and the orchestrator should call it instead of hardcoding role names.
Actual Behavior
Roles are hardcoded as `["server", "client"]` in the orchestrator, silently breaking any multi-VM workload that uses different role names.
Command
virtwork run
Workload Type
network
Go Version
Not provided
Deployment Mode
Not provided
Additional Context
Severity: Medium
Files:
- `cmd/virtwork/main.go:254-256` — hardcoded roles
- `internal/workloads/workload.go:57-60` — `MultiVMWorkload` interface (missing `Roles() []string` or equivalent)
Bug Description
`cmd/virtwork/main.go` (lines 254-256) hardcodes `roles := []string{"server", "client"}` when iterating over a `MultiVMWorkload`. The `MultiVMWorkload` interface defines `UserdataForRole(role string, ...)` but provides no method for a workload to declare its supported roles. If a future MultiVMWorkload implementation uses different role names, the orchestrator will silently pass the wrong roles.
Steps to Reproduce
Expected Behavior
`MultiVMWorkload` interface should expose a `Roles() []string` method, and the orchestrator should call it instead of hardcoding role names.
Actual Behavior
Roles are hardcoded as `["server", "client"]` in the orchestrator, silently breaking any multi-VM workload that uses different role names.
Command
virtwork run
Workload Type
network
Go Version
Not provided
Deployment Mode
Not provided
Additional Context
Severity: Medium
Files: