Applied pnpm prettier rules to code.

This commit is contained in:
djeinstine 2024-11-11 09:31:18 +00:00
parent ac997ea841
commit 94a934ec65

View File

@ -38,16 +38,10 @@ export async function checkCRD(name) {
}
const getSchemaFromGateway = async (gatewayRef) => {
const schema = await crd.getNamespacedCustomObject(
apiGroup,
version,
gatewayRef.namespace,
"gateways",
gatewayRef.name,
)
const schema = await crd
.getNamespacedCustomObject(apiGroup, version, gatewayRef.namespace, "gateways", gatewayRef.name)
.then((response) => {
const listner = response.body.spec.listeners.filter((listener) => listener.name === gatewayRef.sectionName)[0]
const listner = response.body.spec.listeners.filter((listener) => listener.name === gatewayRef.sectionName)[0];
return listner.protocol.toLowerCase();
})
.catch((error) => {
@ -73,16 +67,10 @@ function getUrlFromIngress(ingress) {
}
async function getHttpRouteList() {
// httproutes
const getHttpRoute = (async (namespace) =>
const getHttpRoute = async (namespace) =>
crd
.listNamespacedCustomObject(
apiGroup,
version,
namespace,
"httproutes"
)
.listNamespacedCustomObject(apiGroup, version, namespace, "httproutes")
.then((response) => {
const [httpRoute] = response.body.items;
return httpRoute;
@ -91,8 +79,7 @@ async function getHttpRouteList() {
logger.error("Error getting httproutes: %d %s %s", error.statusCode, error.body, error.response);
logger.debug(error);
return null;
})
)
});
// namespaces
const namespaces = await core
@ -106,18 +93,14 @@ async function getHttpRouteList() {
let httpRouteList = [];
if (namespaces) {
const httpRouteListUnfiltered = await Promise.all(
namespaces
.map( async(namespace) => {
namespaces.map(async (namespace) => {
const httpRoute = await getHttpRoute(namespace);
return httpRoute;
})
)
httpRouteList = httpRouteListUnfiltered
.filter((httpRoute) => httpRoute !== undefined)
}),
);
httpRouteList = httpRouteListUnfiltered.filter((httpRoute) => httpRoute !== undefined);
}
return httpRouteList;
}