Fixes faulty persistent volume claim creation
This commit is contained in:
parent
5241144e99
commit
bc51fc2e30
|
@ -517,7 +517,7 @@ namespace KubernetesWorkflow
|
||||||
private void CreatePersistentVolumeClaimIfNeeded(VolumeMount v)
|
private void CreatePersistentVolumeClaimIfNeeded(VolumeMount v)
|
||||||
{
|
{
|
||||||
var pvcs = client.Run(c => c.ListNamespacedPersistentVolumeClaim(K8sNamespace));
|
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
|
client.Run(c => c.CreateNamespacedPersistentVolumeClaim(new V1PersistentVolumeClaim
|
||||||
{
|
{
|
||||||
|
@ -528,7 +528,6 @@ namespace KubernetesWorkflow
|
||||||
},
|
},
|
||||||
Spec = new V1PersistentVolumeClaimSpec
|
Spec = new V1PersistentVolumeClaimSpec
|
||||||
{
|
{
|
||||||
|
|
||||||
AccessModes = new List<string>
|
AccessModes = new List<string>
|
||||||
{
|
{
|
||||||
"ReadWriteOnce"
|
"ReadWriteOnce"
|
||||||
|
|
Loading…
Reference in New Issue