mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Show better message for empty contexts
This commit is contained in:
@@ -137,14 +137,20 @@ function getCleanClusterName(rawClusterName){
|
||||
const region = clusterSplit.at(-3)
|
||||
return region + "/" + clusterName + ' [AWS]'
|
||||
}
|
||||
|
||||
if (rawClusterName.indexOf('gke') === 0) {
|
||||
// GKE cluster
|
||||
return rawClusterName.split('_').at(-2) + '/' + rawClusterName.split('_').at(-1) + ' [GKE]'
|
||||
}
|
||||
|
||||
return rawClusterName
|
||||
}
|
||||
|
||||
function fillClusterList(data, context) {
|
||||
if (!data || !data.length) {
|
||||
$("#cluster").append("No clusters listed in kubectl config, please configure some")
|
||||
return
|
||||
}
|
||||
data.forEach(function (elm) {
|
||||
let label = getCleanClusterName(elm.Name)
|
||||
let opt = $('<li><label><input type="radio" name="cluster" class="me-2"/><span></span></label></li>');
|
||||
|
||||
Reference in New Issue
Block a user