[HOTFIX] Disable Non-clusterrole permissions

This commit is contained in:
dunemask 2023-10-07 12:08:02 -06:00
parent 8fb5b34c77
commit d9ab9486d0

View file

@ -7,6 +7,8 @@ kc.loadFromDefault();
const k8sApi = kc.makeApiClient(k8s.CoreV1Api); const k8sApi = kc.makeApiClient(k8s.CoreV1Api);
// Get Routes // Get Routes
router.get("/available", (req, res) => { router.get("/available", (req, res) => {
return res.json({cpu: 8000, memory: 16000});
// TODO Workaround to detect available
k8sApi.listNode().then((nodeRes) => { k8sApi.listNode().then((nodeRes) => {
const nodeAllocatable = nodeRes.body.items.map((i) => i.status.allocatable); const nodeAllocatable = nodeRes.body.items.map((i) => i.status.allocatable);
const nodeResources = nodeAllocatable.map(({ cpu, memory }) => ({ const nodeResources = nodeAllocatable.map(({ cpu, memory }) => ({