9
9
10
10
type (
11
11
IRuntimeAPI interface {
12
- Create (ctx context.Context , runtimeName , cluster , runtimeVersion , ingressHost string , componentNames [] string ) (* model.RuntimeCreationResponse , error )
12
+ Create (ctx context.Context , opts * RuntimeCreateOnPlatformOptions ) (* model.RuntimeCreationResponse , error )
13
13
Get (ctx context.Context , name string ) (* model.Runtime , error )
14
14
List (ctx context.Context ) ([]model.Runtime , error )
15
15
Delete (ctx context.Context , runtimeName string ) (int , error )
@@ -46,13 +46,21 @@ type (
46
46
}
47
47
Errors []graphqlError
48
48
}
49
+
50
+ RuntimeCreateOnPlatformOptions struct {
51
+ runtimeName string
52
+ server string
53
+ runtimeVersion string
54
+ ingressHost string
55
+ componentNames []string
56
+ }
49
57
)
50
58
51
59
func newArgoRuntimeAPI (codefresh * codefresh ) IRuntimeAPI {
52
60
return & argoRuntime {codefresh : codefresh }
53
61
}
54
62
55
- func (r * argoRuntime ) Create (ctx context.Context , runtimeName , cluster , runtimeVersion , ingressHost string , componentNames [] string ) (* model.RuntimeCreationResponse , error ) {
63
+ func (r * argoRuntime ) Create (ctx context.Context , opts * RuntimeCreateOnPlatformOptions ) (* model.RuntimeCreationResponse , error ) {
56
64
jsonData := map [string ]interface {}{
57
65
"query" : `
58
66
mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -64,11 +72,11 @@ func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeV
64
72
` ,
65
73
"variables" : map [string ]map [string ]interface {}{
66
74
"installationArgs" : {
67
- "runtimeName" : runtimeName ,
68
- "cluster" : cluster ,
69
- "runtimeVersion" : runtimeVersion ,
70
- "componentNames" : componentNames ,
71
- "ingressHost" : ingressHost ,
75
+ "runtimeName" : opts . runtimeName ,
76
+ "cluster" : opts . server ,
77
+ "runtimeVersion" : opts . runtimeVersion ,
78
+ "componentNames" : opts . componentNames ,
79
+ "ingressHost" : opts . ingressHost ,
72
80
},
73
81
},
74
82
}
0 commit comments