mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
lint
This commit is contained in:
@@ -30,12 +30,10 @@ export default async function handler(req, res) {
|
||||
const coreApi = kc.makeApiClient(CoreV1Api);
|
||||
const metricsApi = new Metrics(kc);
|
||||
const podsResponse = await coreApi
|
||||
.listNamespacedPod(
|
||||
{
|
||||
namespace,
|
||||
labelSelector
|
||||
}
|
||||
)
|
||||
.listNamespacedPod({
|
||||
namespace,
|
||||
labelSelector,
|
||||
})
|
||||
.then((response) => response.body)
|
||||
.catch((err) => {
|
||||
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
||||
|
||||
@@ -27,12 +27,10 @@ export default async function handler(req, res) {
|
||||
}
|
||||
const coreApi = kc.makeApiClient(CoreV1Api);
|
||||
const podsResponse = await coreApi
|
||||
.listNamespacedPod(
|
||||
{
|
||||
namespace,
|
||||
labelSelector
|
||||
}
|
||||
)
|
||||
.listNamespacedPod({
|
||||
namespace,
|
||||
labelSelector,
|
||||
})
|
||||
.then((response) => response)
|
||||
.catch((err) => {
|
||||
logger.error("Error getting pods: %d %s %s", err.statusCode, err.body, err.response);
|
||||
|
||||
@@ -36,11 +36,9 @@ export const getKubeConfig = () => {
|
||||
export async function checkCRD(name, kc, logger) {
|
||||
const apiExtensions = kc.makeApiClient(ApiextensionsV1Api);
|
||||
const exist = await apiExtensions
|
||||
.readCustomResourceDefinitionStatus(
|
||||
{
|
||||
name
|
||||
}
|
||||
)
|
||||
.readCustomResourceDefinitionStatus({
|
||||
name,
|
||||
})
|
||||
.then(() => true)
|
||||
.catch(async (error) => {
|
||||
if (error.statusCode === 403) {
|
||||
|
||||
@@ -14,16 +14,14 @@ export default async function listHttpRoute() {
|
||||
|
||||
if (gateway) {
|
||||
// httproutes
|
||||
const getHttpRoute = async (namespace) =>
|
||||
const getHttpRoute = async (namespace) =>
|
||||
crd
|
||||
.listNamespacedCustomObject(
|
||||
{
|
||||
group: HTTPROUTE_API_GROUP,
|
||||
version: HTTPROUTE_API_VERSION,
|
||||
namespace,
|
||||
plural: "httproutes"
|
||||
}
|
||||
)
|
||||
.listNamespacedCustomObject({
|
||||
group: HTTPROUTE_API_GROUP,
|
||||
version: HTTPROUTE_API_VERSION,
|
||||
namespace,
|
||||
plural: "httproutes",
|
||||
})
|
||||
.then((response) => {
|
||||
const [httpRoute] = response.items;
|
||||
return httpRoute;
|
||||
|
||||
@@ -17,15 +17,13 @@ const kc = getKubeConfig();
|
||||
const getSchemaFromGateway = async (gatewayRef) => {
|
||||
const crd = kc.makeApiClient(CustomObjectsApi);
|
||||
const schema = await crd
|
||||
.getNamespacedCustomObject(
|
||||
{
|
||||
group: HTTPROUTE_API_GROUP,
|
||||
version: HTTPROUTE_API_VERSION,
|
||||
namespace: gatewayRef.namespace,
|
||||
plural: "gateways",
|
||||
name: gatewayRef.name
|
||||
}
|
||||
)
|
||||
.getNamespacedCustomObject({
|
||||
group: HTTPROUTE_API_GROUP,
|
||||
version: HTTPROUTE_API_VERSION,
|
||||
namespace: gatewayRef.namespace,
|
||||
plural: "gateways",
|
||||
name: gatewayRef.name,
|
||||
})
|
||||
.then((response) => {
|
||||
const listner = response.spec.listeners.filter((listener) => listener.name === gatewayRef.sectionName)[0];
|
||||
return listner.protocol.toLowerCase();
|
||||
|
||||
@@ -16,13 +16,11 @@ export default async function listTraefikIngress() {
|
||||
const traefikExists = await checkCRD("ingressroutes.traefik.io", kc, logger);
|
||||
|
||||
const traefikIngressListContaino = await crd
|
||||
.listClusterCustomObject(
|
||||
{
|
||||
group: "traefik.containo.us",
|
||||
version: "v1alpha1",
|
||||
plural: "ingressroutes"
|
||||
}
|
||||
)
|
||||
.listClusterCustomObject({
|
||||
group: "traefik.containo.us",
|
||||
version: "v1alpha1",
|
||||
plural: "ingressroutes",
|
||||
})
|
||||
.then((response) => response)
|
||||
.catch(async (error) => {
|
||||
if (traefikContainoExists) {
|
||||
@@ -39,13 +37,11 @@ export default async function listTraefikIngress() {
|
||||
});
|
||||
|
||||
const traefikIngressListIo = await crd
|
||||
.listClusterCustomObject(
|
||||
{
|
||||
group: "traefik.io",
|
||||
version: "v1alpha1",
|
||||
plural:"ingressroutes"
|
||||
}
|
||||
)
|
||||
.listClusterCustomObject({
|
||||
group: "traefik.io",
|
||||
version: "v1alpha1",
|
||||
plural: "ingressroutes",
|
||||
})
|
||||
.then((response) => response.body)
|
||||
.catch(async (error) => {
|
||||
if (traefikExists) {
|
||||
|
||||
Reference in New Issue
Block a user