-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vladislav Sukhin <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
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,18 @@ | ||
package mapper | ||
|
||
import "github.com/kubeshop/testkube/pkg/api/v1/testkube" | ||
|
||
// MapTestkubeTestWorkflowRunningContextActorToCDEventTiggerType maps OpenAPI spec Test Workflow Running Context Actor to CDEvent Trigger Type | ||
func MapTestkubeTestWorkflowRunningContextActorToCDEventTiggerType(actor testkube.TestWorkflowRunningContextActorType) string { | ||
switch actor { | ||
case testkube.USER_TestWorkflowRunningContextActorType, testkube.PROGRAM_TestWorkflowRunningContextActorType: | ||
return "manual" | ||
case testkube.TESTWORKFLOW_TestWorkflowRunningContextActorType, testkube.TESTWORKFLOWEXECUTION_TestWorkflowRunningContextActorType, | ||
testkube.TESTRIGGER_TestWorkflowRunningContextActorType: | ||
return "event" | ||
case testkube.CRON_TestWorkflowRunningContextActorType: | ||
return "schedule" | ||
} | ||
|
||
return "other" | ||
} |
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,18 @@ | ||
package triggers | ||
|
||
import ( | ||
"github.com/kubeshop/testkube/internal/common" | ||
"github.com/kubeshop/testkube/pkg/api/v1/testkube" | ||
) | ||
|
||
func GetRunningContext(name string) *testkube.TestWorkflowRunningContext { | ||
return &testkube.TestWorkflowRunningContext{ | ||
Interface_: &testkube.TestWorkflowRunningContextInterface{ | ||
Type_: common.Ptr(testkube.INTERNAL_TestWorkflowRunningContextInterfaceType), | ||
}, | ||
Actor: &testkube.TestWorkflowRunningContextActor{ | ||
Name: name, | ||
Type_: common.Ptr(testkube.TESTRIGGER_TestWorkflowRunningContextActorType), | ||
}, | ||
} | ||
} |