mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
refactor: volume request modes to be generic between DHV/CSI (#24896)
When we implemented CSI, the types of the fields for access mode and attachment mode on volume requests were defined with a prefix "CSI". This gets confusing now that we have dynamic host volumes using the same fields. Fortunately the original was a typedef on string, and the Go API in the `api` package just uses strings directly, so we can change the name of the type without breaking backwards compatibility for the msgpack wire format. Update the names to `VolumeAccessMode` and `VolumeAttachmentMode`. Keep the CSI and DHV specific value constant names for these fields (they aren't currently 1:1), so that we can easily differentiate in a given bit of code which values are valid. Ref: https://github.com/hashicorp/nomad/pull/24881#discussion_r1920702890
This commit is contained in:
@@ -1336,8 +1336,8 @@ func ApiTgToStructsTG(job *structs.Job, taskGroup *api.TaskGroup, tg *structs.Ta
|
||||
ReadOnly: v.ReadOnly,
|
||||
Sticky: v.Sticky,
|
||||
Source: v.Source,
|
||||
AttachmentMode: structs.CSIVolumeAttachmentMode(v.AttachmentMode),
|
||||
AccessMode: structs.CSIVolumeAccessMode(v.AccessMode),
|
||||
AttachmentMode: structs.VolumeAttachmentMode(v.AttachmentMode),
|
||||
AccessMode: structs.VolumeAccessMode(v.AccessMode),
|
||||
PerAlloc: v.PerAlloc,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user