From 967addec48a16c523a98a8c83c9ad1b63d9cec32 Mon Sep 17 00:00:00 2001 From: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:34:25 +0100 Subject: [PATCH] stateful deployments: add corrections to API structs and methods (#24700) This changeset includes changes accidentally left out from 24641. --- api/tasks.go | 1 + command/agent/job_endpoint.go | 1 + nomad/structs/diff_test.go | 6 ------ nomad/structs/volumes.go | 3 --- 4 files changed, 2 insertions(+), 9 deletions(-) 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: