diff --git a/api/tasks.go b/api/tasks.go index 21d99bf4c2c..b39c55ad56b 100644 --- a/api/tasks.go +++ b/api/tasks.go @@ -455,6 +455,7 @@ type VolumeRequest struct { Type string `hcl:"type,optional"` Source string `hcl:"source,optional"` ReadOnly bool `hcl:"read_only,optional"` + Sticky bool `hcl:"sticky,optional"` AccessMode string `hcl:"access_mode,optional"` AttachmentMode string `hcl:"attachment_mode,optional"` MountOptions *CSIMountOptions `hcl:"mount_options,block"` diff --git a/command/agent/job_endpoint.go b/command/agent/job_endpoint.go index fd0c0c03501..5ebe21e1eb3 100644 --- a/command/agent/job_endpoint.go +++ b/command/agent/job_endpoint.go @@ -1334,6 +1334,7 @@ func ApiTgToStructsTG(job *structs.Job, taskGroup *api.TaskGroup, tg *structs.Ta Name: v.Name, Type: v.Type, ReadOnly: v.ReadOnly, + Sticky: v.Sticky, Source: v.Source, AttachmentMode: structs.CSIVolumeAttachmentMode(v.AttachmentMode), AccessMode: structs.CSIVolumeAccessMode(v.AccessMode), diff --git a/nomad/structs/diff_test.go b/nomad/structs/diff_test.go index 45563f23573..e394545ad1d 100644 --- a/nomad/structs/diff_test.go +++ b/nomad/structs/diff_test.go @@ -8376,12 +8376,6 @@ func TestTaskDiff(t *testing.T) { Old: "", New: "Z", }, - { - Type: DiffTypeAdded, - Name: "Sticky", - Old: "", - New: "false", - }, { Type: DiffTypeAdded, Name: "Volume", diff --git a/nomad/structs/volumes.go b/nomad/structs/volumes.go index b8c95fc2862..18d5f39289e 100644 --- a/nomad/structs/volumes.go +++ b/nomad/structs/volumes.go @@ -263,7 +263,6 @@ type VolumeMount struct { Volume string Destination string ReadOnly bool - Sticky bool PropagationMode string SELinuxLabel string } @@ -284,8 +283,6 @@ func (v *VolumeMount) Equal(o *VolumeMount) bool { return false case v.ReadOnly != o.ReadOnly: return false - case v.Sticky != o.Sticky: - return false case v.PropagationMode != o.PropagationMode: return false case v.SELinuxLabel != o.SELinuxLabel: