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