Skip to content

feat: add --params CLI flag for per-workload params#192

Merged
mrhillsman merged 2 commits into
mainfrom
feat/cli-params-flag
Jun 13, 2026
Merged

feat: add --params CLI flag for per-workload params#192
mrhillsman merged 2 commits into
mainfrom
feat/cli-params-flag

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Summary

  • Add --params CLI flag accepting comma-separated workload.key=value pairs (e.g., --params cpu.cpu-load-percent=50,cpu.cpu-method=matrixprod)
  • Add VIRTWORK_PARAMS environment variable using the same format
  • CLI params merge with YAML config params — individual CLI keys override matching YAML keys, unmentioned YAML keys are preserved
  • Priority chain: --params flag > VIRTWORK_PARAMS env var > YAML params: block > schema defaults

Details

Adds ParseParams() to split the raw comma-separated string into a map[string]map[string]string keyed by workload name. Wires it into LoadConfig via resolveRawParams() (same pattern as resolveSSHKeys). Validation happens downstream in the orchestrator via registry.ValidateParams.

Test plan

  • ParseParams unit tests: single pair, multiple pairs same workload, multiple workloads, empty string, values containing =, whitespace trimming
  • ParseParams error tests: missing dot, empty workload name, missing =, empty key
  • --params flag integration: flag parsing, VIRTWORK_PARAMS env var, flag-over-env priority, CLI-overrides-YAML merge, CLI params for workloads absent from YAML
  • Full test suite passes (14 packages), zero lint issues

Resolves #187

Introduce ParseParams function that splits comma-separated
"workload.key=value" strings into a per-workload param map.
Add Ginkgo tests for happy paths and error cases.
Include failing integration tests for --params flag (TDD red).

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
Add --params CLI flag to BindRunFlags accepting comma-separated
workload.key=value pairs. LoadConfig resolves the raw string from
CLI flag or VIRTWORK_PARAMS env var, parses it via ParseParams, and
merges into WorkloadConfig.Params (CLI keys override YAML keys).

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@exe-prow-github-app exe-prow-github-app Bot requested a review from OchiengEd June 13, 2026 00:31
@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 Jun 13, 2026
@mrhillsman mrhillsman removed the request for review from OchiengEd June 13, 2026 00:38
@mrhillsman mrhillsman merged commit 1f09177 into main Jun 13, 2026
3 of 4 checks passed
@mrhillsman mrhillsman deleted the feat/cli-params-flag branch June 15, 2026 03:34
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.

[Feature]: CLI flag for per-workload params

1 participant