Skip to content

Commit

Permalink
fix: map to kube
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <vladislav@kubeshop.io>
  • Loading branch information
vsukhin committed Dec 11, 2024
1 parent 6b99bc4 commit a7c36c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/mapper/testworkflows/openapi_kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ func MapStepParallelAPIToKube(v testkube.TestWorkflowStepParallel) testworkflows
Setup: common.MapSlice(v.Setup, MapStepAPIToKube),
Steps: common.MapSlice(v.Steps, MapStepAPIToKube),
After: common.MapSlice(v.After, MapStepAPIToKube),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigAPIToKube),
},
StepControl: testworkflowsv1.StepControl{
Paused: v.Paused,
Expand Down Expand Up @@ -995,6 +996,7 @@ func MapIndependentStepParallelAPIToKube(v testkube.TestWorkflowIndependentStepP
Setup: common.MapSlice(v.Setup, MapIndependentStepAPIToKube),
Steps: common.MapSlice(v.Steps, MapIndependentStepAPIToKube),
After: common.MapSlice(v.After, MapIndependentStepAPIToKube),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigAPIToKube),
},
StepControl: testworkflowsv1.StepControl{
Paused: v.Paused,
Expand Down Expand Up @@ -1234,6 +1236,7 @@ func MapSpecAPIToKube(v testkube.TestWorkflowSpec) testworkflowsv1.TestWorkflowS
Setup: common.MapSlice(v.Setup, MapStepAPIToKube),
Steps: common.MapSlice(v.Steps, MapStepAPIToKube),
After: common.MapSlice(v.After, MapStepAPIToKube),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigAPIToKube),
}
}

Expand All @@ -1253,6 +1256,7 @@ func MapTemplateSpecAPIToKube(v testkube.TestWorkflowTemplateSpec) testworkflows
Setup: common.MapSlice(v.Setup, MapIndependentStepAPIToKube),
Steps: common.MapSlice(v.Steps, MapIndependentStepAPIToKube),
After: common.MapSlice(v.After, MapIndependentStepAPIToKube),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigAPIToKube),
}
}

Expand Down Expand Up @@ -1485,3 +1489,14 @@ func MapTestWorkflowTagSchemaAPIToKube(v testkube.TestWorkflowTagSchema) testwor
Tags: v.Tags,
}
}

func MapPvcConfigAPIToKube(v testkube.TestWorkflowPvcConfig) testworkflowsv1.TestWorkflowPvcConfig {
return testworkflowsv1.TestWorkflowPvcConfig{
Shared: v.Shared,
AccessModes: v.AccessModes,
VolumeMode: v.VolumeMode,
Resources: common.MapPtr(v.Resources, MapResourcesAPIToKube),
StorageClassName: v.StorageClassName,
Selector: common.MapPtr(v.Selector, MapLabelSelectorAPIToKube),
}
}

0 comments on commit a7c36c0

Please sign in to comment.