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 * model. InstallationArgs ) (* 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 )
@@ -52,7 +52,8 @@ func newArgoRuntimeAPI(codefresh *codefresh) IRuntimeAPI {
52
52
return & argoRuntime {codefresh : codefresh }
53
53
}
54
54
55
- func (r * argoRuntime ) Create (ctx context.Context , runtimeName , cluster , runtimeVersion , ingressHost string , componentNames []string ) (* model.RuntimeCreationResponse , error ) {
55
+ // func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeVersion, ingressHost string, componentNames []string) (*model.RuntimeCreationResponse, error) {
56
+ func (r * argoRuntime ) Create (ctx context.Context , opts * model.InstallationArgs ) (* model.RuntimeCreationResponse , error ) {
56
57
jsonData := map [string ]interface {}{
57
58
"query" : `
58
59
mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -64,11 +65,11 @@ func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeV
64
65
` ,
65
66
"variables" : map [string ]map [string ]interface {}{
66
67
"installationArgs" : {
67
- "runtimeName" : runtimeName ,
68
- "cluster" : cluster ,
69
- "runtimeVersion" : runtimeVersion ,
70
- "componentNames" : componentNames ,
71
- "ingressHost" : ingressHost ,
68
+ "runtimeName" : opts . RuntimeName ,
69
+ "cluster" : opts . Cluster ,
70
+ "runtimeVersion" : opts . RuntimeVersion ,
71
+ "componentNames" : opts . ComponentNames ,
72
+ "ingressHost" : opts . IngressHost ,
72
73
},
73
74
},
74
75
}
0 commit comments