Category
Hardcoded values
Description
internal/workloads/chaos_disk.go references /mnt/data in two independent places:
- The shared
diskSetupScript("virtwork-chdisk", "/mnt/data") call — mounts the data disk at /mnt/data.
- The
chaosDiskScript constant — reads ${CHAOS_DISK_MOUNT:-/mnt/data} and writes chaos-disk-fill there.
The script-side env var allows the fill location to be changed (in principle), but the disk is always mounted at /mnt/data. If a user ever sets CHAOS_DISK_MOUNT (or the documented params.mount once it's wired up — see the separate chaos-params issue), the fill script will try to write to a directory that isn't a mountpoint, and df / fallocate behavior will be wrong.
Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
internal/workloads/chaos_disk.go — the diskSetupScript(...) call passes a literal; the chaosDiskScript script uses a separate env var with the same default
Proposed Fix
Plumb a single mountpoint value through ChaosDiskWorkload (sourced from Config.Params["mount"] once that work lands) and pass it to both:
diskSetupScript("virtwork-chdisk", mountpoint)
- The rendered fill script, by sprintf'ing the mountpoint into
chaosDiskScript rather than relying on env defaults
This way the disk is always mounted where the fill script writes, and there is one source of truth for the mountpoint.
Area
Workloads
Architecture Layer
Layer 3 - Workload Definitions (workloads, registry)
Additional Context
Should land alongside or after the broader chaos-params wiring issue, since this consolidation is naturally part of that work.
Category
Hardcoded values
Description
internal/workloads/chaos_disk.goreferences/mnt/datain two independent places:diskSetupScript("virtwork-chdisk", "/mnt/data")call — mounts the data disk at/mnt/data.chaosDiskScriptconstant — reads${CHAOS_DISK_MOUNT:-/mnt/data}and writeschaos-disk-fillthere.The script-side env var allows the fill location to be changed (in principle), but the disk is always mounted at
/mnt/data. If a user ever setsCHAOS_DISK_MOUNT(or the documentedparams.mountonce it's wired up — see the separate chaos-params issue), the fill script will try to write to a directory that isn't a mountpoint, anddf/fallocatebehavior will be wrong.Severity
Medium — increases maintenance burden or risk of future bugs
Affected Files
internal/workloads/chaos_disk.go— thediskSetupScript(...)call passes a literal; thechaosDiskScriptscript uses a separate env var with the same defaultProposed Fix
Plumb a single
mountpointvalue throughChaosDiskWorkload(sourced fromConfig.Params["mount"]once that work lands) and pass it to both:diskSetupScript("virtwork-chdisk", mountpoint)chaosDiskScriptrather than relying on env defaultsThis way the disk is always mounted where the fill script writes, and there is one source of truth for the mountpoint.
Area
Workloads
Architecture Layer
Layer 3 - Workload Definitions (workloads, registry)
Additional Context
Should land alongside or after the broader chaos-params wiring issue, since this consolidation is naturally part of that work.