From a7cb7ea51ef68265ba9eaa89508c8bec9f55b521 Mon Sep 17 00:00:00 2001 From: adwait-godbole Date: Sat, 1 Feb 2025 02:48:47 +0530 Subject: [PATCH] fix comment Signed-off-by: adwait-godbole --- frontend/src/lib/docs.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/docs.ts b/frontend/src/lib/docs.ts index 11861541595..6fe057b32bf 100644 --- a/frontend/src/lib/docs.ts +++ b/frontend/src/lib/docs.ts @@ -6,17 +6,14 @@ import Swagger from '@apidevtools/swagger-parser'; import { OpenAPIV2 } from 'openapi-types'; import { request } from './k8s/apiProxy'; -let docsPromise: ReturnType; - export async function getDocs() { const docs = await request('/openapi/v2'); return Swagger.dereference(docs); } export async function getDocDefinitions(apiVersion: string, kind: string) { - docsPromise = getDocs(); // reset the cache each time for testing purposes - - const { definitions = {} } = (await docsPromise) as OpenAPIV2.Document; + // We want a fresh call to getDocs() each time to ensure we get the latest mock data during testing + const { definitions = {} } = (await getDocs()) as OpenAPIV2.Document; let [group, version] = apiVersion.split('/'); if (!version) {