Skip to content

Commit 8294094

Browse files
back to separate args
1 parent ea7aa40 commit 8294094

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

pkg/codefresh/argo_runtime.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
type (
1111
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)
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,21 +46,13 @@ 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-
}
5749
)
5850

5951
func newArgoRuntimeAPI(codefresh *codefresh) IRuntimeAPI {
6052
return &argoRuntime{codefresh: codefresh}
6153
}
6254

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) {
6456
jsonData := map[string]interface{}{
6557
"query": `
6658
mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -72,11 +64,11 @@ func (r *argoRuntime) Create(ctx context.Context, opts *RuntimeCreateOnPlatformO
7264
`,
7365
"variables": map[string]map[string]interface{}{
7466
"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,
8072
},
8173
},
8274
}

0 commit comments

Comments
 (0)