9
9
10
10
type (
11
11
IRuntimeAPI interface {
12
- Create (ctx context.Context , opts * model.InstallationArgs ) (* model.RuntimeCreationResponse , error )
12
+ Create (ctx context.Context , opts * model.RuntimeInstallationArgs ) (* 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,22 @@ type (
46
46
}
47
47
Errors []graphqlError
48
48
}
49
+
50
+
51
+ RuntimeCreateOnPlatformOptions struct {
52
+ runtimeName string
53
+ server string
54
+ runtimeVersion string
55
+ ingressHost string
56
+ componentNames []* string
57
+ }
49
58
)
50
59
51
60
func newArgoRuntimeAPI (codefresh * codefresh ) IRuntimeAPI {
52
61
return & argoRuntime {codefresh : codefresh }
53
62
}
54
63
55
- func (r * argoRuntime ) Create (ctx context.Context , opts * model.InstallationArgs ) (* model.RuntimeCreationResponse , error ) {
64
+ func (r * argoRuntime ) Create (ctx context.Context , opts * model.RuntimeInstallationArgs ) (* model.RuntimeCreationResponse , error ) {
56
65
jsonData := map [string ]interface {}{
57
66
"query" : `
58
67
mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -62,14 +71,8 @@ func (r *argoRuntime) Create(ctx context.Context, opts *model.InstallationArgs)
62
71
}
63
72
}
64
73
` ,
65
- "variables" : map [string ]map [string ]interface {}{
66
- "installationArgs" : {
67
- "runtimeName" : opts .RuntimeName ,
68
- "cluster" : opts .Cluster ,
69
- "runtimeVersion" : opts .RuntimeVersion ,
70
- "componentNames" : opts .ComponentNames ,
71
- "ingressHost" : opts .IngressHost ,
72
- },
74
+ "variables" : map [string ]interface {}{
75
+ "installationArgs" : opts ,
73
76
},
74
77
}
75
78
0 commit comments