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