Skip to content

Commit 0694fda

Browse files
updated Create
1 parent 8294094 commit 0694fda

File tree

2 files changed

+260
-43
lines changed

2 files changed

+260
-43
lines changed

pkg/codefresh/argo_runtime.go

Lines changed: 8 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 *model.InstallationArgs) (*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)
@@ -52,7 +52,8 @@ func newArgoRuntimeAPI(codefresh *codefresh) IRuntimeAPI {
5252
return &argoRuntime{codefresh: codefresh}
5353
}
5454

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) {
5657
jsonData := map[string]interface{}{
5758
"query": `
5859
mutation CreateRuntime($installationArgs: InstallationArgs!) {
@@ -64,11 +65,11 @@ func (r *argoRuntime) Create(ctx context.Context, runtimeName, cluster, runtimeV
6465
`,
6566
"variables": map[string]map[string]interface{}{
6667
"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,
7273
},
7374
},
7475
}

0 commit comments

Comments
 (0)