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

Commit

Permalink
Added logic for new context prefix for k8s clusters by context. (#433)
Browse files Browse the repository at this point in the history
* Added logic for new context prefix for k8s clusters by context.

* 2.27.0
  • Loading branch information
novykh authored Jul 28, 2022
1 parent 6dcd525 commit 0e116f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netdata/dashboard",
"version": "2.26.8",
"version": "2.27.0",
"homepage": ".",
"main": "./lib/src/index-npm.js",
"files": [
Expand Down
7 changes: 5 additions & 2 deletions src/domains/charts/getChartMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default (
const clusterName = hasKubernetes && chartLabels?.k8s_cluster_name?.[0]

const [type, typeB, typeC] = id.split(".")

const parts = type.split("_")
const [part1, part2] = parts

Expand Down Expand Up @@ -65,14 +66,16 @@ export default (

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

if (part2 == "container") {
if (!part2 || part2 === "container") {
if (clusterName) return emit({ menu: `Kubernetes Containers ${clusterName}` })
else if (clusterId) return emit({ menu: `Kubernetes Containers ${clusterId}` })
else return emit({ menu: "Kubernetes Containers" })
}

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

0 comments on commit 0e116f0

Please sign in to comment.