mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
shorter kubeconfig-sync file label
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
76d3a4b180
commit
3edcf9cbaa
@ -35,6 +35,7 @@ import { catalogEntityFromCluster } from "../cluster-manager";
|
|||||||
import { UserStore } from "../../common/user-store";
|
import { UserStore } from "../../common/user-store";
|
||||||
import { ClusterStore, UpdateClusterModel } from "../../common/cluster-store";
|
import { ClusterStore, UpdateClusterModel } from "../../common/cluster-store";
|
||||||
import { createHash } from "crypto";
|
import { createHash } from "crypto";
|
||||||
|
import { homedir } from "os";
|
||||||
|
|
||||||
const logPrefix = "[KUBECONFIG-SYNC]:";
|
const logPrefix = "[KUBECONFIG-SYNC]:";
|
||||||
|
|
||||||
@ -187,7 +188,9 @@ export function computeDiff(contents: string, source: RootSource, filePath: stri
|
|||||||
|
|
||||||
const entity = catalogEntityFromCluster(cluster);
|
const entity = catalogEntityFromCluster(cluster);
|
||||||
|
|
||||||
entity.metadata.labels.file = filePath;
|
if (!filePath.startsWith(ClusterStore.storedKubeConfigFolder)) {
|
||||||
|
entity.metadata.labels.file = filePath.replace(homedir(), "~");
|
||||||
|
}
|
||||||
source.set(contextName, [cluster, entity]);
|
source.set(contextName, [cluster, entity]);
|
||||||
|
|
||||||
logger.debug(`${logPrefix} Added new cluster from sync`, { filePath, contextName });
|
logger.debug(`${logPrefix} Added new cluster from sync`, { filePath, contextName });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user