Skip to content

[Bug]: MultiVMWorkload roles are hardcoded in orchestrator #4

Description

@mrhillsman

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

  1. Implement a new `MultiVMWorkload` with roles other than "server" and "client" (e.g., "primary" and "replica")
  2. Register the workload and run it via `virtwork run`
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.size/MDenotes a PR that changes 30-99 lines, ignoring generated files.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions