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`
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;
}
});
@ -143,23 +143,12 @@ export class DECCManager {
id: deccCluster.metadata.uid,
contextName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
preferences: {
clusterName: `${username}@${clusterPrefix}-${deccCluster.metadata.name}`,
clusterName: `${clusterPrefix}-${deccCluster.metadata.name}`,
httpsProxy: undefined,
},
kubeConfigPath: ClusterStore.embedCustomKubeConfig(deccCluster.metadata.uid, YAML.stringify(jsConfig)),
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);
clusterStore.addCluster(...newClusters);

View File

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