mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-03 14:03:40 +01:00
Fix: correct k8s node response
This commit is contained in:
parent
277fbe8051
commit
455103a9f1
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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.",
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user