99
1010type (
1111 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 )
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,21 @@ type (
4646 }
4747 Errors []graphqlError
4848 }
49+
50+ RuntimeCreateOnPlatformOptions struct {
51+ runtimeName string
52+ server string
53+ runtimeVersion string
54+ ingressHost string
55+ componentNames []string
56+ }
4957)
5058
5159func newArgoRuntimeAPI (codefresh * codefresh ) IRuntimeAPI {
5260 return & argoRuntime {codefresh : codefresh }
5361}
5462
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 ) {
5664 jsonData := map [string ]interface {}{
5765 "query" : `
5866 mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -64,11 +72,11 @@ func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeV
6472 ` ,
6573 "variables" : map [string ]map [string ]interface {}{
6674 "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 ,
7280 },
7381 },
7482 }
0 commit comments