1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix errors

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-07-05 20:32:00 +03:00
parent deea97ec5c
commit 387bc07dbc
2 changed files with 5 additions and 4 deletions

View File

@ -1,14 +1,14 @@
export default {
computed: {
clusters: function() {
clusters: function () {
return this.$store.getters.clusters
},
newContexts: function() {
const seenContexts = this.seenContexts || this.$store.getters.seenContexts
newContexts: function () {
const seenContexts = this.seenContexts ? Array.from(this.seenContexts) : this.$store.getters.seenContexts
const contextNamesFromKubeconfig = this.availableContexts.map(item => item.currentContext)
return contextNamesFromKubeconfig.filter((item) => seenContexts.indexOf(item) < 0)
},
availableContexts: function() {
availableContexts: function () {
// read available kubeconfigs from store on filter out configs already found in added clusters
return this.$store.getters.availableKubeContexts.filter(item => !this.clusters.find((cluster) => cluster.contextName == item.currentContext));
},

View File

@ -7,6 +7,7 @@ const state = {
const actions = {
reloadAvailableKubeContexts({commit}, file) {
if(!file) return;
let kc = new k8s.KubeConfig();
try {
kc.loadFromFile(file);