From 7ddcb3d4e4063ed8d081a9c3337ae882deb48c02 Mon Sep 17 00:00:00 2001 From: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:10:32 +0100 Subject: [PATCH] CSI vols can be sticky too --- nomad/structs/volumes.go | 4 ---- nomad/structs/volumes_test.go | 13 ------------- 2 files changed, 17 deletions(-) diff --git a/nomad/structs/volumes.go b/nomad/structs/volumes.go index c3e5b8d7029..78f96c0eb0e 100644 --- a/nomad/structs/volumes.go +++ b/nomad/structs/volumes.go @@ -168,10 +168,6 @@ func (v *VolumeRequest) Validate(jobType string, taskGroupCount, canaries int) e } case VolumeTypeCSI: - if v.Sticky { - addErr("CSI volumes cannot be set to sticky") - } - switch v.AttachmentMode { case CSIVolumeAttachmentModeUnknown: addErr("CSI volumes must have an attachment mode") diff --git a/nomad/structs/volumes_test.go b/nomad/structs/volumes_test.go index 1b7efc01d7b..58585932d7c 100644 --- a/nomad/structs/volumes_test.go +++ b/nomad/structs/volumes_test.go @@ -85,19 +85,6 @@ func TestVolumeRequest_Validate(t *testing.T) { PerAlloc: true, }, }, - { - name: "Sticky CSI", - expected: []string{ - "CSI volumes cannot be set to sticky", - }, - req: &VolumeRequest{ - Source: "source", - Type: VolumeTypeCSI, - Sticky: true, - AttachmentMode: CSIVolumeAttachmentModeBlockDevice, - AccessMode: CSIVolumeAccessModeMultiNodeMultiWriter, - }, - }, } for _, tc := range testCases {