Skip to content

Commit

Permalink
fix: map pvc to api
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 76ea394 commit 6b99bc4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/mapper/testworkflows/kube_openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ func MapStepParallelKubeToAPI(v testworkflowsv1.StepParallel) testkube.TestWorkf
Run: common.MapPtr(v.Run, MapStepRunKubeToAPI),
Execute: common.MapPtr(v.Execute, MapStepExecuteKubeToAPI),
Artifacts: common.MapPtr(v.Artifacts, MapStepArtifactsKubeToAPI),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigKubeToAPI),
}
}

Expand Down Expand Up @@ -948,6 +949,7 @@ func MapIndependentStepParallelKubeToAPI(v testworkflowsv1.IndependentStepParall
Run: common.MapPtr(v.Run, MapStepRunKubeToAPI),
Execute: common.MapPtr(v.Execute, MapStepExecuteKubeToAPI),
Artifacts: common.MapPtr(v.Artifacts, MapStepArtifactsKubeToAPI),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigKubeToAPI),
}
}

Expand Down Expand Up @@ -1134,6 +1136,7 @@ func MapSpecKubeToAPI(v testworkflowsv1.TestWorkflowSpec) testkube.TestWorkflowS
After: common.MapSlice(v.After, MapStepKubeToAPI),
Events: common.MapSlice(v.Events, MapEventKubeToAPI),
Execution: common.MapPtr(v.Execution, MapTestWorkflowTagSchemaKubeToAPI),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigKubeToAPI),
}
}

Expand All @@ -1150,6 +1153,7 @@ func MapTemplateSpecKubeToAPI(v testworkflowsv1.TestWorkflowTemplateSpec) testku
After: common.MapSlice(v.After, MapIndependentStepKubeToAPI),
Events: common.MapSlice(v.Events, MapEventKubeToAPI),
Execution: common.MapPtr(v.Execution, MapTestWorkflowTagSchemaKubeToAPI),
Pvcs: common.MapMap(v.Pvcs, MapPvcConfigKubeToAPI),
}
}

Expand Down Expand Up @@ -1206,3 +1210,14 @@ func MapTestWorkflowTagSchemaKubeToAPI(v testworkflowsv1.TestWorkflowTagSchema)
Tags: v.Tags,
}
}

func MapPvcConfigKubeToAPI(v testworkflowsv1.TestWorkflowPvcConfig) testkube.TestWorkflowPvcConfig {
return testkube.TestWorkflowPvcConfig{
Shared: v.Shared,
AccessModes: v.AccessModes,
VolumeMode: v.VolumeMode,
Resources: common.MapPtr(v.Resources, MapResourcesKubeToAPI),
StorageClassName: v.StorageClassName,
Selector: common.MapPtr(v.Selector, MapSelectorToAPI),
}
}

0 comments on commit 6b99bc4

Please sign in to comment.