Skip to content

[Bug]: Silent error swallowing in service creation loop #101

Description

@mrhillsman

Bug Description

In cmd/virtwork/main.go, the service creation loop calls registry.Get() and silently discards errors with continue (around line 447). This is inconsistent with the identical call earlier in the same function (around line 280), which properly returns the error. A workload that fails to initialize for service creation is silently skipped — no log message, no audit record, no error returned to the user.

Steps to Reproduce

  1. Configure a workload with invalid parameters that cause registry.Get() to fail
  2. Run virtwork run — the workload's service creation is silently skipped
  3. The VMs may still be created (from the earlier successful registry.Get call) but without their required service
  4. No error or warning is shown to the user

Expected Behavior

The error should either be returned (consistent with the earlier call) or at minimum logged and recorded in the audit trail. If a workload requires a service and the service cannot be created, this should be surfaced to the user.

Actual Behavior

w, err := registry.Get(name, wlCfg, registryOpts...)
if err != nil {
    continue  // silent skip — no log, no audit, no error
}

The error is silently swallowed and the loop continues to the next workload.

Command

virtwork run

Affected Files

  • cmd/virtwork/main.go — service creation loop registry.Get() error handling (around line 447) vs proper error handling at line 280

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    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