mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-05 23:13: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,
|
namespace,
|
||||||
labelSelector,
|
labelSelector,
|
||||||
})
|
})
|
||||||
.then((response) => response.body)
|
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
||||||
return null;
|
return null;
|
||||||
|
@ -31,7 +31,6 @@ export default async function handler(req, res) {
|
|||||||
namespace,
|
namespace,
|
||||||
labelSelector,
|
labelSelector,
|
||||||
})
|
})
|
||||||
.then((response) => response)
|
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
||||||
return null;
|
return null;
|
||||||
|
@ -17,14 +17,11 @@ export default async function handler(req, res) {
|
|||||||
const coreApi = kc.makeApiClient(CoreV1Api);
|
const coreApi = kc.makeApiClient(CoreV1Api);
|
||||||
const metricsApi = new Metrics(kc);
|
const metricsApi = new Metrics(kc);
|
||||||
|
|
||||||
const nodes = await coreApi
|
const nodes = await coreApi.listNode().catch((error) => {
|
||||||
.listNode()
|
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
|
||||||
.then((response) => response.body)
|
logger.debug(error);
|
||||||
.catch((error) => {
|
return null;
|
||||||
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
|
});
|
||||||
logger.debug(error);
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
if (!nodes) {
|
if (!nodes) {
|
||||||
return res.status(500).send({
|
return res.status(500).send({
|
||||||
error: "An error occurred while fetching nodes, check logs for more details.",
|
error: "An error occurred while fetching nodes, check logs for more details.",
|
||||||
|
@ -21,7 +21,6 @@ export default async function listTraefikIngress() {
|
|||||||
version: "v1alpha1",
|
version: "v1alpha1",
|
||||||
plural: "ingressroutes",
|
plural: "ingressroutes",
|
||||||
})
|
})
|
||||||
.then((response) => response)
|
|
||||||
.catch(async (error) => {
|
.catch(async (error) => {
|
||||||
if (traefikContainoExists) {
|
if (traefikContainoExists) {
|
||||||
logger.error(
|
logger.error(
|
||||||
@ -42,7 +41,6 @@ export default async function listTraefikIngress() {
|
|||||||
version: "v1alpha1",
|
version: "v1alpha1",
|
||||||
plural: "ingressroutes",
|
plural: "ingressroutes",
|
||||||
})
|
})
|
||||||
.then((response) => response.body)
|
|
||||||
.catch(async (error) => {
|
.catch(async (error) => {
|
||||||
if (traefikExists) {
|
if (traefikExists) {
|
||||||
logger.error(
|
logger.error(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user