@k8slens/extensions 6.3.0-git.95cee3bcc8.0 → 6.3.0-git.aedc47551a.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common/ipc/cluster.d.ts +0 -2
- package/dist/src/common/k8s/create-resource-stack.injectable.d.ts +5 -0
- package/dist/src/common/k8s/resource-stack.d.ts +25 -6
- package/dist/src/common/kube-helpers/channels.d.ts +25 -0
- package/dist/src/extensions/common-api/k8s-api.d.ts +12 -1
- package/dist/src/extensions/extension-api.js +76 -898
- package/dist/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.d.ts +1 -3
- package/dist/src/main/kubectl/apply-all-handler.injectable.d.ts +5 -0
- package/dist/src/main/kubectl/delete-all-handler.injectable.d.ts +5 -0
- package/dist/src/main/kubectl/kubectl-apply-all.injectable.d.ts +2 -0
- package/dist/src/main/kubectl/kubectl-delete-all.injectable.d.ts +2 -0
- package/dist/src/main/resource-applier/resource-applier.d.ts +6 -5
- package/dist/src/main/routes/resource-applier/create-resource-route.injectable.d.ts +13 -1
- package/dist/src/renderer/ipc/index.d.ts +0 -8
- package/dist/src/renderer/kubectl/apply-all.injectable.d.ts +2 -0
- package/dist/src/renderer/kubectl/delete-all.injectable.d.ts +2 -0
- package/package.json +1 -1
@@ -6,8 +6,6 @@ export declare const clusterActivateHandler = "cluster:activate";
|
|
6
6
|
export declare const clusterSetFrameIdHandler = "cluster:set-frame-id";
|
7
7
|
export declare const clusterVisibilityHandler = "cluster:visibility";
|
8
8
|
export declare const clusterDisconnectHandler = "cluster:disconnect";
|
9
|
-
export declare const clusterKubectlApplyAllHandler = "cluster:kubectl-apply-all";
|
10
|
-
export declare const clusterKubectlDeleteAllHandler = "cluster:kubectl-delete-all";
|
11
9
|
export declare const clusterStates = "cluster:states";
|
12
10
|
/**
|
13
11
|
* This channel is broadcast on whenever the cluster fails to list namespaces
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { KubernetesCluster } from "../catalog-entities";
|
2
|
+
import type { ResourceApplyingStack } from "./resource-stack";
|
3
|
+
export type CreateResourceStack = (cluster: KubernetesCluster, name: string) => ResourceApplyingStack;
|
4
|
+
declare const createResourceStackInjectable: import("@ogre-tools/injectable").Injectable<CreateResourceStack, unknown, void>;
|
5
|
+
export default createResourceStackInjectable;
|
@@ -1,8 +1,27 @@
|
|
1
1
|
import type { KubernetesCluster } from "../catalog-entities";
|
2
|
+
import type { AsyncResult } from "../utils/async-result";
|
3
|
+
import type { Logger } from "../logger";
|
4
|
+
import type { KubectlApplyAll, KubectlDeleteAll } from "../kube-helpers/channels";
|
5
|
+
import type { ReadDirectory } from "../fs/read-directory.injectable";
|
6
|
+
import type { JoinPaths } from "../path/join-paths.injectable";
|
7
|
+
import type { ReadFile } from "../fs/read-file.injectable";
|
8
|
+
export interface ResourceApplyingStack {
|
9
|
+
kubectlApplyFolder(folderPath: string, templateContext?: any, extraArgs?: string[]): Promise<string>;
|
10
|
+
kubectlDeleteFolder(folderPath: string, templateContext?: any, extraArgs?: string[]): Promise<string>;
|
11
|
+
}
|
12
|
+
export interface ResourceStackDependencies {
|
13
|
+
readonly logger: Logger;
|
14
|
+
kubectlApplyAll: KubectlApplyAll;
|
15
|
+
kubectlDeleteAll: KubectlDeleteAll;
|
16
|
+
readDirectory: ReadDirectory;
|
17
|
+
joinPaths: JoinPaths;
|
18
|
+
readFile: ReadFile;
|
19
|
+
}
|
2
20
|
export declare class ResourceStack {
|
3
|
-
protected
|
4
|
-
protected
|
5
|
-
|
21
|
+
protected readonly dependencies: ResourceStackDependencies;
|
22
|
+
protected readonly cluster: KubernetesCluster;
|
23
|
+
protected readonly name: string;
|
24
|
+
constructor(dependencies: ResourceStackDependencies, cluster: KubernetesCluster, name: string);
|
6
25
|
/**
|
7
26
|
*
|
8
27
|
* @param folderPath folder path that is searched for files defining kubernetes resources.
|
@@ -15,8 +34,8 @@ export declare class ResourceStack {
|
|
15
34
|
* @param templateContext sets the template parameters that are to be applied to any templated kubernetes resources that are to be applied.
|
16
35
|
*/
|
17
36
|
kubectlDeleteFolder(folderPath: string, templateContext?: any, extraArgs?: string[]): Promise<string>;
|
18
|
-
protected applyResources(resources: string[], extraArgs?: string[]): Promise<string
|
19
|
-
protected deleteResources(resources: string[], extraArgs?: string[]): Promise<string
|
20
|
-
protected
|
37
|
+
protected applyResources(resources: string[], extraArgs?: string[]): Promise<AsyncResult<string, string>>;
|
38
|
+
protected deleteResources(resources: string[], extraArgs?: string[]): Promise<AsyncResult<string, string>>;
|
39
|
+
protected getAdditionalArgs(kubectlArgs: string[]): string[];
|
21
40
|
protected renderTemplates(folderPath: string, templateContext: any): Promise<string[]>;
|
22
41
|
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
import type { Asyncify } from "type-fest";
|
6
|
+
import type { RequestChannelHandler } from "../../main/utils/channel/channel-listeners/listener-tokens";
|
7
|
+
import type { ClusterId } from "../cluster-types";
|
8
|
+
import type { AsyncResult } from "../utils/async-result";
|
9
|
+
import type { RequestChannel } from "../utils/channel/request-channel-listener-injection-token";
|
10
|
+
export interface KubectlApplyAllArgs {
|
11
|
+
clusterId: ClusterId;
|
12
|
+
resources: string[];
|
13
|
+
extraArgs: string[];
|
14
|
+
}
|
15
|
+
export declare const kubectlApplyAllChannel: RequestChannel<KubectlApplyAllArgs, AsyncResult<string, string>>;
|
16
|
+
export type KubectlApplyAll = Asyncify<RequestChannelHandler<typeof kubectlApplyAllChannel>>;
|
17
|
+
export declare const kubectlApplyAllInjectionToken: import("@ogre-tools/injectable").InjectionToken<(req: KubectlApplyAllArgs) => Promise<AsyncResult<string, string>>, void>;
|
18
|
+
export interface KubectlDeleteAllArgs {
|
19
|
+
clusterId: ClusterId;
|
20
|
+
resources: string[];
|
21
|
+
extraArgs: string[];
|
22
|
+
}
|
23
|
+
export declare const kubectlDeleteAllChannel: RequestChannel<KubectlDeleteAllArgs, AsyncResult<string, string>>;
|
24
|
+
export type KubectlDeleteAll = Asyncify<RequestChannelHandler<typeof kubectlDeleteAllChannel>>;
|
25
|
+
export declare const kubectlDeleteAllInjectionToken: import("@ogre-tools/injectable").InjectionToken<(req: KubectlDeleteAllArgs) => Promise<AsyncResult<string, string>>, void>;
|
@@ -2,11 +2,22 @@
|
|
2
2
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
|
-
|
5
|
+
import type { ResourceApplyingStack } from "../../common/k8s/resource-stack";
|
6
|
+
import type { KubernetesCluster } from "./catalog";
|
6
7
|
export declare const apiManager: import("../../common/k8s-api/api-manager").ApiManager;
|
7
8
|
export declare const forCluster: import("../../common/k8s-api/create-kube-api-for-cluster.injectable").CreateKubeApiForCluster;
|
8
9
|
export declare const forRemoteCluster: import("../../common/k8s-api/create-kube-api-for-remote-cluster.injectable").CreateKubeApiForRemoteCluster;
|
9
10
|
export { KubeApi } from "../../common/k8s-api/kube-api";
|
11
|
+
export declare const createResourceStack: import("../../common/k8s/create-resource-stack.injectable").CreateResourceStack;
|
12
|
+
/**
|
13
|
+
* @deprecated Switch to using `Common.createResourceStack` instead
|
14
|
+
*/
|
15
|
+
export declare class ResourceStack implements ResourceApplyingStack {
|
16
|
+
private readonly impl;
|
17
|
+
constructor(cluster: KubernetesCluster, name: string);
|
18
|
+
kubectlApplyFolder(folderPath: string, templateContext?: any, extraArgs?: string[] | undefined): Promise<string>;
|
19
|
+
kubectlDeleteFolder(folderPath: string, templateContext?: any, extraArgs?: string[] | undefined): Promise<string>;
|
20
|
+
}
|
10
21
|
/**
|
11
22
|
* @deprecated This type is unused
|
12
23
|
*/
|