-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add tcl for testworkflow mapper
Signed-off-by: Vladislav Sukhin <[email protected]>
- Loading branch information
Showing
4 changed files
with
61 additions
and
84 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
pkg/api/v1/testkube/model_test_workflow_running_context_caller.go
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
pkg/api/v1/testkube/model_test_workflow_running_context_caller_resource_type.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2024 Testkube. | ||
// | ||
// Licensed as a Testkube Pro file under the Testkube Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/kubeshop/testkube/blob/main/licenses/TCL.txt | ||
|
||
package testworkflows | ||
|
||
import ( | ||
testworkflowsv1 "github.com/kubeshop/testkube-operator/api/testworkflows/v1" | ||
"github.com/kubeshop/testkube/internal/common" | ||
"github.com/kubeshop/testkube/pkg/api/v1/testkube" | ||
) | ||
|
||
func MapTestWorkflowRunningContextInterfaceTypeAPIToKube(v testkube.TestWorkflowRunningContextInterfaceType) testworkflowsv1.TestWorkflowRunningContextInterfaceType { | ||
return testworkflowsv1.TestWorkflowRunningContextInterfaceType(v) | ||
} | ||
|
||
func MapTestWorkflowRunningContextInterfaceAPIToKube(v testkube.TestWorkflowRunningContextInterface) testworkflowsv1.TestWorkflowRunningContextInterface { | ||
return testworkflowsv1.TestWorkflowRunningContextInterface{ | ||
Name: v.Name, | ||
Type_: common.MapPtr(v.Type_, MapTestWorkflowRunningContextInterfaceTypeAPIToKube), | ||
} | ||
} | ||
|
||
func MapTestWorkflowRunningContextActorTypeAPIToKube(v testkube.TestWorkflowRunningContextActorType) testworkflowsv1.TestWorkflowRunningContextActorType { | ||
return testworkflowsv1.TestWorkflowRunningContextActorType(v) | ||
} | ||
|
||
func MapTestWorkflowRunningContextActorAPIToKube(v testkube.TestWorkflowRunningContextActor) testworkflowsv1.TestWorkflowRunningContextActor { | ||
return testworkflowsv1.TestWorkflowRunningContextActor{ | ||
Name: v.Name, | ||
Username: v.Username, | ||
Email: v.Email, | ||
ExecutionId: v.ExecutionId, | ||
ExecutionPath: v.ExecutionPath, | ||
Type_: common.MapPtr(v.Type_, MapTestWorkflowRunningContextActorTypeAPIToKube), | ||
} | ||
} | ||
|
||
func MapTestWorkflowRunningContextAPIToKube(v testkube.TestWorkflowRunningContext) testworkflowsv1.TestWorkflowRunningContext { | ||
return testworkflowsv1.TestWorkflowRunningContext{ | ||
Interface_: common.MapPtr(v.Interface_, MapTestWorkflowRunningContextInterfaceAPIToKube), | ||
Actor: common.MapPtr(v.Actor, MapTestWorkflowRunningContextActorAPIToKube), | ||
} | ||
} |