99
1010type (
1111 IRuntimeAPI interface {
12- Create (ctx context.Context , opts * model.InstallationArgs ) (* model.RuntimeCreationResponse , error )
12+ Create (ctx context.Context , opts * model.RuntimeInstallationArgs ) (* model.RuntimeCreationResponse , error )
1313 Get (ctx context.Context , name string ) (* model.Runtime , error )
1414 List (ctx context.Context ) ([]model.Runtime , error )
1515 Delete (ctx context.Context , runtimeName string ) (int , error )
@@ -46,13 +46,22 @@ type (
4646 }
4747 Errors []graphqlError
4848 }
49+
50+
51+ RuntimeCreateOnPlatformOptions struct {
52+ runtimeName string
53+ server string
54+ runtimeVersion string
55+ ingressHost string
56+ componentNames []* string
57+ }
4958)
5059
5160func newArgoRuntimeAPI (codefresh * codefresh ) IRuntimeAPI {
5261 return & argoRuntime {codefresh : codefresh }
5362}
5463
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 ) {
5665 jsonData := map [string ]interface {}{
5766 "query" : `
5867 mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -62,14 +71,8 @@ func (r *argoRuntime) Create(ctx context.Context, opts *model.InstallationArgs)
6271 }
6372 }
6473 ` ,
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 ,
7376 },
7477 }
7578
0 commit comments