From bc51fc2e309880385714d925aaa9f10391f0ab70 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 2 Nov 2023 11:32:24 +0100 Subject: [PATCH] Fixes faulty persistent volume claim creation --- Framework/KubernetesWorkflow/K8sController.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Framework/KubernetesWorkflow/K8sController.cs b/Framework/KubernetesWorkflow/K8sController.cs index d150198..b9b4386 100644 --- a/Framework/KubernetesWorkflow/K8sController.cs +++ b/Framework/KubernetesWorkflow/K8sController.cs @@ -517,7 +517,7 @@ namespace KubernetesWorkflow private void CreatePersistentVolumeClaimIfNeeded(VolumeMount v) { var pvcs = client.Run(c => c.ListNamespacedPersistentVolumeClaim(K8sNamespace)); - if (pvcs != null && pvcs.Items.Any(i => i.Name() != v.VolumeName)) return; + if (pvcs != null && pvcs.Items.Any(i => i.Name() == v.VolumeName)) return; client.Run(c => c.CreateNamespacedPersistentVolumeClaim(new V1PersistentVolumeClaim { @@ -528,11 +528,10 @@ namespace KubernetesWorkflow }, Spec = new V1PersistentVolumeClaimSpec { - AccessModes = new List - { - "ReadWriteOnce" - }, + { + "ReadWriteOnce" + }, Resources = CreateVolumeResourceRequirements(v), }, }, K8sNamespace));