Skip to content

fix(config): honor WorkloadConfig.Enabled field in orchestration#80

Merged
mrhillsman merged 1 commit into
mainfrom
fix/honor-workload-enabled-field
May 23, 2026
Merged

fix(config): honor WorkloadConfig.Enabled field in orchestration#80
mrhillsman merged 1 commit into
mainfrom
fix/honor-workload-enabled-field

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Changes WorkloadConfig.Enabled from bool to *bool to distinguish between:

  • nil (field not set in YAML, defaults to enabled)
  • &true (explicitly enabled in YAML)
  • &false (explicitly disabled in YAML)

Updates orchestration in cmd/virtwork/main.go runE to:

  • Skip workloads where Enabled is explicitly set to false
  • Record audit event when skipping disabled workloads
  • Log skip reason at INFO level

Adds config.BoolPtr() helper for creating bool pointers in tests and code.

Updates all tests to use config.BoolPtr(true) instead of bare true for Enabled field.

Adds comprehensive test coverage for Enabled field behavior:

  • Tests for explicitly disabled workloads
  • Tests for explicitly enabled workloads
  • Tests for nil/default enabled behavior
  • Tests for BoolPtr helper function

Updates docs/configuration.md to:

  • Document enabled field behavior and precedence
  • Show examples of enabled: true, enabled: false, and omitted
  • Explain audit event recording for skipped workloads

Fixes #67

Signed-off-by: Melvin Hillsman mhillsma@redhat.com

@exe-prow-github-app
exe-prow-github-app Bot requested a review from OchiengEd May 23, 2026 07:07
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2026
@mrhillsman
mrhillsman removed the request for review from OchiengEd May 23, 2026 07:07
Changes WorkloadConfig.Enabled from bool to *bool to distinguish between:
- nil (field not set in YAML, defaults to enabled)
- &true (explicitly enabled in YAML)
- &false (explicitly disabled in YAML)

Updates orchestration in cmd/virtwork/main.go runE to:
- Skip workloads where Enabled is explicitly set to false
- Record audit event when skipping disabled workloads
- Log skip reason at INFO level

Adds config.BoolPtr() helper for creating bool pointers in tests and code.

Updates all tests to use config.BoolPtr(true) instead of bare true for Enabled field.

Adds comprehensive test coverage for Enabled field behavior:
- Tests for explicitly disabled workloads
- Tests for explicitly enabled workloads
- Tests for nil/default enabled behavior
- Tests for BoolPtr helper function

Updates docs/configuration.md to:
- Document enabled field behavior and precedence
- Show examples of enabled: true, enabled: false, and omitted
- Explain audit event recording for skipped workloads

Fixes #67

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@mrhillsman
mrhillsman force-pushed the fix/honor-workload-enabled-field branch from 955b7ac to 604e195 Compare May 23, 2026 15:06
@mrhillsman
mrhillsman merged commit bd81b59 into main May 23, 2026
3 of 4 checks passed
@mrhillsman
mrhillsman deleted the fix/honor-workload-enabled-field branch May 24, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant