Skip to content

Commit

Permalink
Build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebt3 committed Mar 27, 2024
1 parent 0821d51 commit fda2cd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion back/resolvers/k8slibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ function deleteByPath(obj,path) {
const opts = {} as request.Options;
kc.applyToRequest(opts);
export const rawQuery = async (path:string) => {
return new Promise((resolve,reject) => request.get(kc.getCurrentCluster().server + path, opts, (error, response, body) => {
const current=kc.getCurrentCluster()
if (current==null) return new Promise((_,reject) => reject(`No known cluster`))
return new Promise((resolve,reject) => request.get(current.server + path, opts, (error, response, body) => {
if (error) reject(error);
if (response === undefined || response==null) { reject('no response from API'); return }
if (response.statusCode != 200) { reject(`Query failed, ${response.statusCode}`); return }
Expand Down

0 comments on commit fda2cd0

Please sign in to comment.