From 71a5516e0b18293976ad075aeb17149dec9f5715 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Tue, 1 Dec 2020 13:03:00 +0200 Subject: [PATCH] back to public Signed-off-by: Jari Kolehmainen --- src/main/cluster.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/cluster.ts b/src/main/cluster.ts index ce5abb0602..cfd0f77bd9 100644 --- a/src/main/cluster.ts +++ b/src/main/cluster.ts @@ -393,8 +393,10 @@ export class Cluster implements ClusterModel, ClusterState { this.pushState(); } - @action - protected async refreshMetadata() { + /** + * @internal + */ + @action async refreshMetadata() { logger.info(`[CLUSTER]: refreshMetadata`, this.getMeta()); const metadata = await detectorRegistry.detectForCluster(this); const existingMetadata = this.metadata; @@ -410,8 +412,10 @@ export class Cluster implements ClusterModel, ClusterState { this.accessible = connectionStatus == ClusterStatus.AccessGranted; } - @action - protected async refreshAllowedResources() { + /** + * @internal + */ + @action async refreshAllowedResources() { this.allowedNamespaces = await this.getAllowedNamespaces(); this.allowedResources = await this.getAllowedResources(); } @@ -490,7 +494,11 @@ export class Cluster implements ClusterModel, ClusterState { } } - protected async canI(resourceAttributes: V1ResourceAttributes): Promise { + /** + * @internal + * @param resourceAttributes resource attributes + */ + async canI(resourceAttributes: V1ResourceAttributes): Promise { const authApi = this.getProxyKubeconfig().makeApiClient(AuthorizationV1Api); try { const accessReview = await authApi.createSelfSubjectAccessReview({ @@ -505,7 +513,10 @@ export class Cluster implements ClusterModel, ClusterState { } } - protected async isClusterAdmin(): Promise { + /** + * @internal + */ + async isClusterAdmin(): Promise { return this.canI({ namespace: "kube-system", resource: "*",