mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Return KubeObject for successfully created unknown resources (#617)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
5670312c47
commit
f958e1c760
@ -18,7 +18,11 @@ export const resourceApplierApi = {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
const items = data.map(obj => {
|
const items = data.map(obj => {
|
||||||
const api = apiManager.getApi(obj.metadata.selfLink);
|
const api = apiManager.getApi(obj.metadata.selfLink);
|
||||||
return new api.objectConstructor(obj);
|
if (api) {
|
||||||
|
return new api.objectConstructor(obj);
|
||||||
|
} else {
|
||||||
|
return new KubeObject(obj)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return items.length === 1 ? items[0] : items;
|
return items.length === 1 ? items[0] : items;
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user