Skip to content

Commit 786a5be

Browse files
Merge pull request #33 from codefresh-io/update-runtime-list-query
update-runtime-list-query
2 parents 6415dab + 7ad7b81 commit 786a5be

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.31.0
1+
0.31.1

pkg/codefresh/argo_runtime.go

+17-20
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,23 @@ func (r *argoRuntime) Create(runtimeName, cluster, runtimeVersion string) (*mode
8686

8787
func (r *argoRuntime) List() ([]model.Runtime, error) {
8888
jsonData := map[string]interface{}{
89-
"query": `
90-
{
91-
runtimes
92-
(
93-
pagination: {}
94-
project: ""
95-
) {
96-
edges {
97-
node {
98-
metadata {
99-
name
100-
namespace
101-
}
102-
healthMessage
103-
runtimeVersion
104-
cluster
89+
"query": `{
90+
runtimes {
91+
edges {
92+
node {
93+
metadata {
94+
name
95+
namespace
10596
}
97+
self {
98+
healthStatus
99+
version
100+
}
101+
cluster
106102
}
107103
}
108104
}
105+
}
109106
`,
110107
}
111108

@@ -133,14 +130,14 @@ func (r *argoRuntime) List() ([]model.Runtime, error) {
133130
return nil, err
134131
}
135132

133+
if len(res.Errors) > 0 {
134+
return nil, graphqlErrorResponse{errors: res.Errors}
135+
}
136+
136137
runtimes := make([]model.Runtime, len(res.Data.Runtimes.Edges))
137138
for i := range res.Data.Runtimes.Edges {
138139
runtimes[i] = *res.Data.Runtimes.Edges[i].Node
139140
}
140141

141-
if len(res.Errors) > 0 {
142-
return nil, graphqlErrorResponse{errors: res.Errors}
143-
}
144-
145142
return runtimes, nil
146143
}

0 commit comments

Comments
 (0)