fix errors

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-05 20:50:06 +03:00
1 parent deea97ec5c
commit 387bc07dbc
2 files changed
+5 -4

No files matched your search

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