1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Getting api by kind when editing an object (#1936)

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-01-11 15:43:13 +03:00 committed by Jari Kolehmainen
parent 4843732ad9
commit 4027bbe461

View File

@ -18,7 +18,7 @@ export const resourceApplierApi = {
.post<KubeJsonApiData[]>("/stack", { data: resource }) .post<KubeJsonApiData[]>("/stack", { data: resource })
.then(data => { .then(data => {
const items = data.map(obj => { const items = data.map(obj => {
const api = apiManager.getApi(obj.metadata.selfLink); const api = apiManager.getApiByKind(obj.kind, obj.apiVersion);
if (api) { if (api) {
return new api.objectConstructor(obj); return new api.objectConstructor(obj);