-
Notifications
You must be signed in to change notification settings - Fork 542
/
admin.go
36 lines (31 loc) · 1.4 KB
/
admin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package compiler
import (
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)
// This object is meant to satisfy github.com/flyteorg/flytepropeller/pkg/compiler/common.InterfaceProvider
// This file is pretty much copied from Admin, (sorry for the link, a real link made go mod import admin)
// github-dot-com/flyteorg/flyteadmin/blob/1acce744b8c7839ab77a0eb1ed922905af15baa5/pkg/workflowengine/impl/interface_provider.go
// but that implementation relies on the internal Admin Gorm model. We should consider deprecating that one in favor
// of this one as Admin already has a dependency on the Propeller compiler.
type LaunchPlanInterfaceProvider struct {
expectedInputs core.ParameterMap
expectedOutputs core.VariableMap
identifier *core.Identifier
}
func (p *LaunchPlanInterfaceProvider) GetID() *core.Identifier {
return p.identifier
}
func (p *LaunchPlanInterfaceProvider) GetExpectedInputs() *core.ParameterMap {
return &p.expectedInputs
}
func (p *LaunchPlanInterfaceProvider) GetExpectedOutputs() *core.VariableMap {
return &p.expectedOutputs
}
func NewLaunchPlanInterfaceProvider(launchPlan admin.LaunchPlan) *LaunchPlanInterfaceProvider {
return &LaunchPlanInterfaceProvider{
expectedInputs: *launchPlan.Closure.ExpectedInputs,
expectedOutputs: *launchPlan.Closure.ExpectedOutputs,
identifier: launchPlan.Id,
}
}