Fixes faulty persistent volume claim creation

This commit is contained in:
benbierens 2023-11-02 11:32:24 +01:00
parent 5241144e99
commit bc51fc2e30
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
1 changed files with 4 additions and 5 deletions

View File

@ -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,7 +528,6 @@ namespace KubernetesWorkflow
},
Spec = new V1PersistentVolumeClaimSpec
{
AccessModes = new List<string>
{
"ReadWriteOnce"