Skip to content

Commit ea7aa40

Browse files
using opts
1 parent 9379424 commit ea7aa40

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.34.6
1+
0.34.6

pkg/codefresh/argo_runtime.go

Lines changed: 15 additions & 7 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, 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

5159
func 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

Comments
 (0)