Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
move the check for the cluster name into cgroup (#413)
Browse files Browse the repository at this point in the history
* move the check for the cluster name into cgroup

* change k8s case
  • Loading branch information
jjtsou authored Jun 14, 2022
1 parent 3c121e2 commit 7157ec2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/domains/charts/getChartMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export default (
return emit({ menuPattern })
}

if (clusterName) return emit({ menu: `Kubernetes ${clusterName}` })
else if (clusterId) return emit({ menu: `Kubernetes ${clusterId}` })

switch (part1) {
case "ap":
case "net":
Expand Down Expand Up @@ -66,7 +63,19 @@ export default (
return emit({ menu: part1 })
}

case "k8s": {
if (part2 == "state") {
if (clusterName) return emit({ menu: `Kubernetes State ${clusterName}` })
else if (clusterId) return emit({ menu: `Kubernetes State ${clusterId}` })
}

return emit({ menu: `Kubernetes ${part2}` })
}

case "cgroup": {
if (clusterName) return emit({ menu: `Kubernetes Containers ${clusterName}` })
else if (clusterId) return emit({ menu: `Kubernetes Containers ${clusterId}` })

const menuPattern =
id.match(/.*[._/-:]qemu[._/-:]*/) || id.match(/.*[._/-:]kvm[._/-:]*/) ? "cgqemu" : "cgroup"
const sectionTitle = parts.length === 1 ? "cgroups" : undefined
Expand Down

0 comments on commit 7157ec2

Please sign in to comment.