Fixed lint issues.

This commit is contained in:
djeinstine
2025-02-11 21:29:51 +00:00
parent e531d7cd15
commit 1c36eb119e
4 changed files with 21 additions and 11 deletions

View File

@@ -32,8 +32,8 @@ export default async function handler(req, res) {
const podsResponse = await coreApi
.listNamespacedPod(
{
namespace: namespace,
labelSelector:labelSelector
namespace,
labelSelector
}
)
.then((response) => response.body)

View File

@@ -29,8 +29,8 @@ export default async function handler(req, res) {
const podsResponse = await coreApi
.listNamespacedPod(
{
namespace: namespace,
labelSelector:labelSelector
namespace,
labelSelector
}
)
.then((response) => response)

View File

@@ -36,7 +36,11 @@ export const getKubeConfig = () => {
export async function checkCRD(name, kc, logger) {
const apiExtensions = kc.makeApiClient(ApiextensionsV1Api);
const exist = await apiExtensions
.readCustomResourceDefinitionStatus({name:name})
.readCustomResourceDefinitionStatus(
{
name
}
)
.then(() => true)
.catch(async (error) => {
if (error.statusCode === 403) {

View File

@@ -1,5 +1,4 @@
import { CustomObjectsApi, CoreV1Api, CustomObjectsApiListNamespacedCustomObjectRequest } from "@kubernetes/client-node";
import { parseAppSegmentConfig } from "next/dist/build/segment-config/app/app-segment-config";
import { CustomObjectsApi, CoreV1Api } from "@kubernetes/client-node";
import { getKubernetes, getKubeConfig, HTTPROUTE_API_GROUP, HTTPROUTE_API_VERSION } from "utils/config/kubernetes";
import createLogger from "utils/logger";
@@ -15,9 +14,16 @@ export default async function listHttpRoute() {
if (gateway) {
// httproutes
const getHttpRoute = async (namespace) => {
return crd
.listNamespacedCustomObject({ group: HTTPROUTE_API_GROUP, version: HTTPROUTE_API_VERSION, namespace: namespace, plural: "httproutes" })
const getHttpRoute = async (namespace) =>
crd
.listNamespacedCustomObject(
{
group: HTTPROUTE_API_GROUP,
version: HTTPROUTE_API_VERSION,
namespace,
plural: "httproutes"
}
)
.then((response) => {
const [httpRoute] = response.items;
return httpRoute;
@@ -26,7 +32,7 @@ export default async function listHttpRoute() {
logger.error("Error getting httproutes: %d %s %s", error.statusCode, error.body, error.response);
logger.debug(error);
return null;
});}
});
// namespaces
const namespaces = await core
.listNamespace()