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

Remomved userid from cluster name. Turned off keycloak interval for token refresh

This commit is contained in:
Steve Richards 2020-09-24 11:33:20 +01:00
parent 1f36e06cc8
commit 9c2c6b1c71
2 changed files with 9 additions and 20 deletions

View File

@ -114,7 +114,7 @@ export class DECCManager {
const clusterPrefix = `decc` const clusterPrefix = `decc`
clusterStore.getByWorkspaceId(workspace.id).forEach(cluster => { clusterStore.getByWorkspaceId(workspace.id).forEach(cluster => {
if (cluster.preferences.clusterName === `${username}@${clusterPrefix}-${deccCluster.metadata.name}`) { if (cluster.preferences.clusterName === `${clusterPrefix}-${deccCluster.metadata.name}`) {
clusterPresent = true; clusterPresent = true;
} }
}); });
@ -143,23 +143,12 @@ export class DECCManager {
id: deccCluster.metadata.uid, id: deccCluster.metadata.uid,
contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`, contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
preferences: { preferences: {
clusterName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`, clusterName: `${clusterPrefix}-${deccCluster.metadata.name}`,
httpsProxy: undefined, httpsProxy: undefined,
}, },
kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)), kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)),
workspace: workspace.id, workspace: workspace.id,
}; };
// let newCluster = new Cluster({
// id: deccCluster.metadata.uid,
// contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
// preferences: {
// clusterName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
// httpsProxy: undefined,
// },
// kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)),
// workspace: workspace.id,
// });
newClusters.push(newCluster); newClusters.push(newCluster);
clusterStore.addCluster(...newClusters); clusterStore.addCluster(...newClusters);

View File

@ -28,13 +28,13 @@ if(logoutUser){
ipcRenderer.send('keycloak-token', keycloak.idToken, keycloak.refreshToken); ipcRenderer.send('keycloak-token', keycloak.idToken, keycloak.refreshToken);
//TODO: check if token refresh is possible here //TODO: check if token refresh is possible here
setInterval(() => { // setInterval(() => {
let tokenRefreshAt = new Date(); // let tokenRefreshAt = new Date();
console.log(`keycloak interval: ${tokenRefreshAt.toString()}`); // console.log(`keycloak interval: ${tokenRefreshAt.toString()}`);
keycloak.updateToken(10).error(() => keycloak.logout()); // keycloak.updateToken(10).error(() => keycloak.logout());
console.log(keycloak.token); // console.log(keycloak.token);
ipcRenderer.send('keycloak-token-update', keycloak.idToken, keycloak.refreshToken); // ipcRenderer.send('keycloak-token-update', keycloak.idToken, keycloak.refreshToken);
}, 10000); // }, 10000);
} }
}).error(function(error) { }).error(function(error) {
console.log('error: ' + JSON.stringify(error)); console.log('error: ' + JSON.stringify(error));