Skip to content

Commit bf9f080

Browse files
naming
1 parent ff5944a commit bf9f080

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/codefresh/argo_runtime.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type (
4040
Errors []graphqlError
4141
}
4242

43-
graphQlRuntimeCreationResponseNew struct {
43+
graphQlRuntimeCreationResponseVersion34dot9AndUp struct {
4444
Data struct {
4545
RuntimeNew model.RuntimeCreationResponse
4646
}
@@ -74,11 +74,11 @@ func (r *argoRuntime) Create(ctx context.Context, opts *model.RuntimeInstallatio
7474
},
7575
}
7676

77-
res := &graphQlRuntimeCreationResponseNew{}
77+
res := &graphQlRuntimeCreationResponseVersion34dot9AndUp{}
7878
err := r.codefresh.graphqlAPI(ctx, jsonData, res)
7979

8080
if err != nil {
81-
jsonDataOld := map[string]interface{}{
81+
jsonDataOlderVersion := map[string]interface{}{
8282
"query": `
8383
mutation CreateRuntime(
8484
$runtimeName: String!, $cluster: String!, $runtimeVersion: String!, $ingressHost: String, $componentNames: [String]!
@@ -98,18 +98,18 @@ func (r *argoRuntime) Create(ctx context.Context, opts *model.RuntimeInstallatio
9898
},
9999
}
100100

101-
resOld := &graphQlRuntimeCreationResponse{}
102-
err = r.codefresh.graphqlAPI(ctx, jsonDataOld, resOld)
101+
resOlderVersion := &graphQlRuntimeCreationResponse{}
102+
err = r.codefresh.graphqlAPI(ctx, jsonDataOlderVersion, resOlderVersion)
103103

104104
if err != nil {
105105
return nil, fmt.Errorf("failed making a graphql API call while creating runtime: %w", err)
106106
}
107107

108-
if len(resOld.Errors) > 0 {
109-
return nil, graphqlErrorResponse{errors: res.Errors}
108+
if len(resOlderVersion.Errors) > 0 {
109+
return nil, graphqlErrorResponse{errors: resOlderVersion.Errors}
110110
}
111111

112-
return &resOld.Data.Runtime, nil
112+
return &resOlderVersion.Data.Runtime, nil
113113
}
114114

115115
if len(res.Errors) > 0 {

0 commit comments

Comments
 (0)