Skip to content

Commit

Permalink
Merge pull request #1412 from headlamp-k8s/fix-applying-regular-resource
Browse files Browse the repository at this point in the history
frontend: Fix regression when applying resources
  • Loading branch information
illume authored Sep 28, 2023
2 parents ca3c599 + 0ed873d commit 17bc6ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/lib/k8s/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,12 @@ async function resourceDefToApiFactory(
// this way we always get the right plural name and we also avoid eventually getting
// the wrong "known" resource because e.g. there can be CustomResources with the same
// kind as a known resource.
const apiResult: APIResourceList = await request(`/apis/${resourceDef.apiVersion}`, {}, false);
const apiPrefix = !!apiGroup ? 'apis' : 'api';
const apiResult: APIResourceList = await request(
`/${apiPrefix}/${resourceDef.apiVersion}`,
{},
false
);
if (!apiResult) {
throw new Error(`Unkown apiVersion: ${resourceDef.apiVersion}`);
}
Expand Down

0 comments on commit 17bc6ba

Please sign in to comment.