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:
parent
deea97ec5c
commit
387bc07dbc
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user