Fix: correct k8s node response

This commit is contained in:
shamoon 2025-02-13 09:42:08 -08:00
parent 277fbe8051
commit 455103a9f1
No known key found for this signature in database
4 changed files with 5 additions and 12 deletions

View File

@ -34,7 +34,6 @@ export default async function handler(req, res) {
namespace,
labelSelector,
})
.then((response) => response.body)
.catch((err) => {
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
return null;

View File

@ -31,7 +31,6 @@ export default async function handler(req, res) {
namespace,
labelSelector,
})
.then((response) => response)
.catch((err) => {
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
return null;

View File

@ -17,14 +17,11 @@ export default async function handler(req, res) {
const coreApi = kc.makeApiClient(CoreV1Api);
const metricsApi = new Metrics(kc);
const nodes = await coreApi
.listNode()
.then((response) => response.body)
.catch((error) => {
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
logger.debug(error);
return null;
});
const nodes = await coreApi.listNode().catch((error) => {
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
logger.debug(error);
return null;
});
if (!nodes) {
return res.status(500).send({
error: "An error occurred while fetching nodes, check logs for more details.",

View File

@ -21,7 +21,6 @@ export default async function listTraefikIngress() {
version: "v1alpha1",
plural: "ingressroutes",
})
.then((response) => response)
.catch(async (error) => {
if (traefikContainoExists) {
logger.error(
@ -42,7 +41,6 @@ export default async function listTraefikIngress() {
version: "v1alpha1",
plural: "ingressroutes",
})
.then((response) => response.body)
.catch(async (error) => {
if (traefikExists) {
logger.error(