Skip to content

[Tech Debt]: WorkloadConfig.Enabled is parsed from YAML but ignored by orchestration #67

Description

@mrhillsman

Category

Code quality / code smell

Description

internal/config/config.WorkloadConfig has an Enabled bool field tagged mapstructure:"enabled", and docs/configuration.md shows enabled: true on every workload in the YAML schema example. The field has no effect today.

The orchestrator in cmd/virtwork/main.go runE determines which workloads to deploy from the --workloads flag (defaulting to AllWorkloadNames()), and unconditionally sets wlCfg.Enabled = true when building each workload's config. Setting workloads.cpu.enabled: false in YAML does not skip cpu.

This is a quiet correctness gap: users who configure enabled: false will assume the workload is skipped and won't notice it ran.

Severity

Medium — increases maintenance burden or risk of future bugs

Affected Files

  • internal/config/config.goWorkloadConfig.Enabled definition
  • cmd/virtwork/main.gorunE iteration that builds wlCfg per workload name
  • docs/configuration.md — YAML schema example currently advertises enabled as a meaningful key

Proposed Fix

Pick one:

Option A — honor it. In runE, after looking up cfg.Workloads[name], skip the workload if fileCfg.Enabled was explicitly set to false. Add an audit event noting the skip. Add tests covering both flag-driven and YAML-driven enable/disable.

Option B — remove it. Drop the field from WorkloadConfig and update docs/configuration.md to stop showing enabled in the YAML schema. The --workloads flag is then the single source of truth for which workloads run.

Option A is more user-friendly for declarative configs; Option B is the smaller change.

Area

CLI / Configuration

Architecture Layer

Layer 4 - Orchestration (cmd, cleanup)

Metadata

Metadata

Assignees

No one assigned

    Labels

    size/MDenotes a PR that changes 30-99 lines, ignoring generated files.tech-debtTechnical debt, code quality, or maintenance concerntriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    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