Skip to content

[Tech Debt]: Simplify unset of VIRTWORK_ env vars #26

Description

@mrhillsman

Category

Code quality / code smell

Description

Reported by: @OchiengEd
Original issue: #25

The if statement to find env vars prefixed with VIRTWORK_ and to unset them is unnecessarily complex, confusing, and potential maintenance problem in the config test setup.

Severity

Medium — increases maintenance burden or risk of future bugs

Affected Files

  • internal/config/config_test.go - L42-L49

Proposed Fix

Edmund proposes using strings.HasPrefix and strings.Cut to find env vars prefixed with VIRTWORK_ env vars and the entire env var key to unset

Area

Testing

Architecture Layer

Layer 1 - Infrastructure (config, cluster, cloudinit, audit)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    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