@k8slens/extensions 5.3.1-git.93a60caf40.0 → 5.3.1-git.9ce91884c2.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/base-store.d.ts +5 -2
- package/dist/src/common/ipc/update-available.ipc.d.ts +2 -0
- package/dist/src/common/k8s-api/api-manager.d.ts +1 -1
- package/dist/src/common/k8s-api/cluster-context.d.ts +1 -0
- package/dist/src/common/k8s-api/endpoints/daemon-set.api.d.ts +2 -5
- package/dist/src/common/k8s-api/endpoints/deployment.api.d.ts +2 -5
- package/dist/src/common/k8s-api/endpoints/job.api.d.ts +2 -5
- package/dist/src/common/k8s-api/endpoints/metrics.api.d.ts +2 -0
- package/dist/src/common/k8s-api/endpoints/network-policy.api.d.ts +72 -32
- package/dist/src/common/k8s-api/endpoints/nodes.api.d.ts +6 -6
- package/dist/src/common/k8s-api/endpoints/persistent-volume-claims.api.d.ts +3 -16
- package/dist/src/common/k8s-api/endpoints/poddisruptionbudget.api.d.ts +2 -6
- package/dist/src/common/k8s-api/endpoints/pods.api.d.ts +2 -0
- package/dist/src/common/k8s-api/endpoints/replica-set.api.d.ts +2 -5
- package/dist/src/common/k8s-api/endpoints/stateful-set.api.d.ts +2 -5
- package/dist/src/common/k8s-api/kube-api.d.ts +26 -25
- package/dist/src/common/k8s-api/kube-object.d.ts +25 -2
- package/dist/src/common/k8s-api/kube-object.store.d.ts +11 -7
- package/dist/src/common/k8s-api/kube-watch-api.d.ts +7 -30
- package/dist/src/extensions/extension-api.js +686 -2126
- package/dist/src/main/cluster.d.ts +3 -7
- package/dist/src/main/context-handler.d.ts +8 -1
- package/dist/src/main/kube-auth-proxy.d.ts +5 -7
- package/dist/src/main/kubeconfig-manager.d.ts +16 -4
- package/dist/src/renderer/bootstrap.d.ts +2 -1
- package/dist/src/renderer/components/+events/kube-event-details.d.ts +1 -1
- package/dist/src/renderer/components/+namespaces/namespace-details.d.ts +0 -1
- package/dist/src/renderer/components/+namespaces/namespace-select.d.ts +0 -1
- package/dist/src/renderer/components/+namespaces/namespace.store.d.ts +5 -3
- package/dist/src/renderer/components/+network-ingresses/ingress-details.d.ts +1 -1
- package/dist/src/renderer/components/+network-policies/__tests__/network-policy-details.test.d.ts +21 -0
- package/dist/src/renderer/components/+network-policies/network-policy-details.d.ts +5 -4
- package/dist/src/renderer/components/+nodes/node-details.d.ts +1 -2
- package/dist/src/renderer/components/+nodes/nodes.d.ts +2 -1
- package/dist/src/renderer/components/+storage-classes/storage-class-details.d.ts +1 -1
- package/dist/src/renderer/components/+storage-volume-claims/volume-claim-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-cronjobs/cronjob-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-daemonsets/daemonset-details.d.ts +0 -1
- package/dist/src/renderer/components/+workloads-deployments/deployment-details.d.ts +0 -1
- package/dist/src/renderer/components/+workloads-jobs/job-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-overview/overview-workload-status.d.ts +2 -7
- package/dist/src/renderer/components/+workloads-overview/overview.d.ts +2 -0
- package/dist/src/renderer/components/+workloads-replicasets/replicaset-details.d.ts +1 -2
- package/dist/src/renderer/components/+workloads-statefulsets/statefulset-details.d.ts +0 -1
- package/dist/src/renderer/components/avatar/__tests__/avatar.test.d.ts +21 -0
- package/dist/src/renderer/components/avatar/avatar.d.ts +7 -8
- package/dist/src/renderer/components/avatar/index.d.ts +21 -0
- package/dist/src/renderer/components/cluster-manager/cluster-status.d.ts +3 -2
- package/dist/src/renderer/components/context.d.ts +8 -1
- package/dist/src/renderer/components/dock/dock.store.d.ts +11 -4
- package/dist/src/renderer/components/drawer/drawer.d.ts +14 -3
- package/dist/src/renderer/components/getDi.d.ts +22 -0
- package/dist/src/renderer/components/getDiForUnitTesting.d.ts +22 -0
- package/dist/src/renderer/components/hotbar/hotbar-entity-icon.d.ts +3 -3
- package/dist/src/renderer/components/hotbar/hotbar-icon.d.ts +3 -10
- package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +3 -0
- package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +2 -0
- package/dist/src/renderer/components/notifications/notifications.d.ts +3 -3
- package/dist/src/renderer/components/resizing-anchor/resizing-anchor.d.ts +3 -1
- package/dist/src/renderer/port-forward/port-forward.store.d.ts +1 -1
- package/package.json +1 -1
|
@@ -20,10 +20,13 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import Config from "conf";
|
|
22
22
|
import type { Options as ConfOptions } from "conf/dist/source/types";
|
|
23
|
-
import {
|
|
23
|
+
import { IEqualsComparer } from "mobx";
|
|
24
24
|
import { Singleton, Disposer } from "./utils";
|
|
25
25
|
export interface BaseStoreParams<T> extends ConfOptions<T> {
|
|
26
|
-
syncOptions?:
|
|
26
|
+
syncOptions?: {
|
|
27
|
+
fireImmediately?: boolean;
|
|
28
|
+
equals?: IEqualsComparer<T>;
|
|
29
|
+
};
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Note: T should only contain base JSON serializable types.
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import type { UpdateInfo } from "electron-updater";
|
|
22
22
|
export declare const UpdateAvailableChannel = "update-available";
|
|
23
|
+
export declare const AutoUpdateChecking = "auto-update:checking";
|
|
24
|
+
export declare const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
|
|
23
25
|
export declare const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
|
|
24
26
|
export declare type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];
|
|
25
27
|
export declare function areArgsUpdateAvailableFromMain(args: unknown[]): args is UpdateAvailableFromMain;
|
|
@@ -33,6 +33,6 @@ export declare class ApiManager {
|
|
|
33
33
|
unregisterApi(api: string | KubeApi<KubeObject>): void;
|
|
34
34
|
registerStore(store: KubeObjectStore<KubeObject>, apis?: KubeApi<KubeObject>[]): void;
|
|
35
35
|
getStore<S extends KubeObjectStore<KubeObject>>(api: string | KubeApi<KubeObject>): S | undefined;
|
|
36
|
-
lookupApiLink(ref: IKubeObjectRef, parentObject
|
|
36
|
+
lookupApiLink(ref: IKubeObjectRef, parentObject?: KubeObject): string;
|
|
37
37
|
}
|
|
38
38
|
export declare const apiManager: ApiManager;
|
|
@@ -22,17 +22,14 @@ import { IAffinity, WorkloadKubeObject } from "../workload-kube-object";
|
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
24
24
|
import type { IPodContainer, IPodMetrics } from "./pods.api";
|
|
25
|
+
import type { LabelSelector } from "../kube-object";
|
|
25
26
|
export declare class DaemonSet extends WorkloadKubeObject {
|
|
26
27
|
static kind: string;
|
|
27
28
|
static namespaced: boolean;
|
|
28
29
|
static apiBase: string;
|
|
29
30
|
constructor(data: KubeJsonApiData);
|
|
30
31
|
spec: {
|
|
31
|
-
selector:
|
|
32
|
-
matchLabels: {
|
|
33
|
-
[name: string]: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
32
|
+
selector: LabelSelector;
|
|
36
33
|
template: {
|
|
37
34
|
metadata: {
|
|
38
35
|
creationTimestamp?: string;
|
|
@@ -22,6 +22,7 @@ import { IAffinity, WorkloadKubeObject } from "../workload-kube-object";
|
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { IPodMetrics } from "./pods.api";
|
|
24
24
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
25
|
+
import type { LabelSelector } from "../kube-object";
|
|
25
26
|
export declare class DeploymentApi extends KubeApi<Deployment> {
|
|
26
27
|
protected getScaleApiUrl(params: {
|
|
27
28
|
namespace: string;
|
|
@@ -67,11 +68,7 @@ export declare class Deployment extends WorkloadKubeObject {
|
|
|
67
68
|
constructor(data: KubeJsonApiData);
|
|
68
69
|
spec: {
|
|
69
70
|
replicas: number;
|
|
70
|
-
selector:
|
|
71
|
-
matchLabels: {
|
|
72
|
-
[app: string]: string;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
71
|
+
selector: LabelSelector;
|
|
75
72
|
template: {
|
|
76
73
|
metadata: {
|
|
77
74
|
creationTimestamp?: string;
|
|
@@ -22,6 +22,7 @@ import { IAffinity, WorkloadKubeObject } from "../workload-kube-object";
|
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
24
24
|
import type { IPodContainer, IPodMetrics } from "./pods.api";
|
|
25
|
+
import type { LabelSelector } from "../kube-object";
|
|
25
26
|
export declare class Job extends WorkloadKubeObject {
|
|
26
27
|
static kind: string;
|
|
27
28
|
static namespaced: boolean;
|
|
@@ -31,11 +32,7 @@ export declare class Job extends WorkloadKubeObject {
|
|
|
31
32
|
parallelism?: number;
|
|
32
33
|
completions?: number;
|
|
33
34
|
backoffLimit?: number;
|
|
34
|
-
selector?:
|
|
35
|
-
matchLabels: {
|
|
36
|
-
[name: string]: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
35
|
+
selector?: LabelSelector;
|
|
39
36
|
template: {
|
|
40
37
|
metadata: {
|
|
41
38
|
creationTimestamp?: string;
|
|
@@ -18,50 +18,90 @@
|
|
|
18
18
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
|
-
import { KubeObject } from "../kube-object";
|
|
21
|
+
import { KubeObject, LabelSelector } from "../kube-object";
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
24
24
|
export interface IPolicyIpBlock {
|
|
25
25
|
cidr: string;
|
|
26
26
|
except?: string[];
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `LabelSelector` instead
|
|
30
|
+
*/
|
|
31
|
+
export declare type IPolicySelector = LabelSelector;
|
|
32
|
+
export interface NetworkPolicyPort {
|
|
33
|
+
/**
|
|
34
|
+
* The protocol which network traffic must match.
|
|
35
|
+
*
|
|
36
|
+
* One of:
|
|
37
|
+
* - `"TCP"`
|
|
38
|
+
* - `"UDP"`
|
|
39
|
+
* - `"SCTP"`
|
|
40
|
+
*
|
|
41
|
+
* @default "TCP"
|
|
42
|
+
*/
|
|
43
|
+
protocol?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The port on the given protocol. This can either be a numerical or named
|
|
46
|
+
* port on a pod. If this field is not provided, this matches all port names and
|
|
47
|
+
* numbers.
|
|
48
|
+
*
|
|
49
|
+
* If present, only traffic on the specified protocol AND port will be matched.
|
|
50
|
+
*/
|
|
51
|
+
port?: number | string;
|
|
52
|
+
/**
|
|
53
|
+
* If set, indicates that the range of ports from port to endPort, inclusive,
|
|
54
|
+
* should be allowed by the policy. This field cannot be defined if the port field
|
|
55
|
+
* is not defined or if the port field is defined as a named (string) port.
|
|
56
|
+
*
|
|
57
|
+
* The endPort must be equal or greater than port.
|
|
58
|
+
*/
|
|
59
|
+
endPort?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface NetworkPolicyPeer {
|
|
62
|
+
/**
|
|
63
|
+
* IPBlock defines policy on a particular IPBlock. If this field is set then
|
|
64
|
+
* neither of the other fields can be.
|
|
65
|
+
*/
|
|
66
|
+
ipBlock?: IPolicyIpBlock;
|
|
67
|
+
/**
|
|
68
|
+
* Selects Namespaces using cluster-scoped labels. This field follows standard label
|
|
69
|
+
* selector semantics; if present but empty, it selects all namespaces.
|
|
70
|
+
*
|
|
71
|
+
* If PodSelector is also set, then the NetworkPolicyPeer as a whole selects
|
|
72
|
+
* the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
|
|
73
|
+
*
|
|
74
|
+
* Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
|
|
75
|
+
*/
|
|
76
|
+
namespaceSelector?: LabelSelector;
|
|
77
|
+
/**
|
|
78
|
+
* This is a label selector which selects Pods. This field follows standard label
|
|
79
|
+
* selector semantics; if present but empty, it selects all pods.
|
|
80
|
+
*
|
|
81
|
+
* If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
|
|
82
|
+
* the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
|
|
83
|
+
*
|
|
84
|
+
* Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
|
|
85
|
+
*/
|
|
86
|
+
podSelector?: LabelSelector;
|
|
32
87
|
}
|
|
33
88
|
export interface IPolicyIngress {
|
|
34
|
-
from
|
|
35
|
-
|
|
36
|
-
namespaceSelector?: IPolicySelector;
|
|
37
|
-
podSelector?: IPolicySelector;
|
|
38
|
-
}[];
|
|
39
|
-
ports: {
|
|
40
|
-
protocol: string;
|
|
41
|
-
port: number;
|
|
42
|
-
}[];
|
|
89
|
+
from?: NetworkPolicyPeer[];
|
|
90
|
+
ports?: NetworkPolicyPort[];
|
|
43
91
|
}
|
|
44
92
|
export interface IPolicyEgress {
|
|
45
|
-
to
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
93
|
+
to?: NetworkPolicyPeer[];
|
|
94
|
+
ports?: NetworkPolicyPort[];
|
|
95
|
+
}
|
|
96
|
+
export declare type PolicyType = "Ingress" | "Egress";
|
|
97
|
+
export interface NetworkPolicySpec {
|
|
98
|
+
podSelector: LabelSelector;
|
|
99
|
+
policyTypes?: PolicyType[];
|
|
100
|
+
ingress?: IPolicyIngress[];
|
|
101
|
+
egress?: IPolicyEgress[];
|
|
52
102
|
}
|
|
53
103
|
export interface NetworkPolicy {
|
|
54
|
-
spec:
|
|
55
|
-
podSelector: {
|
|
56
|
-
matchLabels: {
|
|
57
|
-
[label: string]: string;
|
|
58
|
-
role: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
policyTypes: string[];
|
|
62
|
-
ingress: IPolicyIngress[];
|
|
63
|
-
egress: IPolicyEgress[];
|
|
64
|
-
};
|
|
104
|
+
spec: NetworkPolicySpec;
|
|
65
105
|
}
|
|
66
106
|
export declare class NetworkPolicy extends KubeObject {
|
|
67
107
|
static kind: string;
|
|
@@ -66,17 +66,17 @@ export interface Node {
|
|
|
66
66
|
status: {
|
|
67
67
|
capacity?: {
|
|
68
68
|
cpu: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
"ephemeral-storage": string;
|
|
70
|
+
"hugepages-1Gi": string;
|
|
71
|
+
"hugepages-2Mi": string;
|
|
72
72
|
memory: string;
|
|
73
73
|
pods: string;
|
|
74
74
|
};
|
|
75
75
|
allocatable?: {
|
|
76
76
|
cpu: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
"ephemeral-storage": string;
|
|
78
|
+
"hugepages-1Gi": string;
|
|
79
|
+
"hugepages-2Mi": string;
|
|
80
80
|
memory: string;
|
|
81
81
|
pods: string;
|
|
82
82
|
};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
|
-
import { KubeObject } from "../kube-object";
|
|
21
|
+
import { KubeObject, LabelSelector } from "../kube-object";
|
|
22
22
|
import { IMetrics } from "./metrics.api";
|
|
23
23
|
import type { Pod } from "./pods.api";
|
|
24
24
|
import { KubeApi } from "../kube-api";
|
|
@@ -35,16 +35,7 @@ export interface PersistentVolumeClaim {
|
|
|
35
35
|
spec: {
|
|
36
36
|
accessModes: string[];
|
|
37
37
|
storageClassName: string;
|
|
38
|
-
selector:
|
|
39
|
-
matchLabels: {
|
|
40
|
-
release: string;
|
|
41
|
-
};
|
|
42
|
-
matchExpressions: {
|
|
43
|
-
key: string;
|
|
44
|
-
operator: string;
|
|
45
|
-
values: string[];
|
|
46
|
-
}[];
|
|
47
|
-
};
|
|
38
|
+
selector: LabelSelector;
|
|
48
39
|
resources: {
|
|
49
40
|
requests: {
|
|
50
41
|
storage: string;
|
|
@@ -63,11 +54,7 @@ export declare class PersistentVolumeClaim extends KubeObject {
|
|
|
63
54
|
getPods(allPods: Pod[]): Pod[];
|
|
64
55
|
getStorage(): string;
|
|
65
56
|
getMatchLabels(): string[];
|
|
66
|
-
getMatchExpressions():
|
|
67
|
-
key: string;
|
|
68
|
-
operator: string;
|
|
69
|
-
values: string[];
|
|
70
|
-
}[];
|
|
57
|
+
getMatchExpressions(): import("../kube-object").LabelMatchExpression[];
|
|
71
58
|
getStatus(): string;
|
|
72
59
|
}
|
|
73
60
|
declare let pvcApi: PersistentVolumeClaimsApi;
|
|
@@ -18,18 +18,14 @@
|
|
|
18
18
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
|
-
import { KubeObject } from "../kube-object";
|
|
21
|
+
import { KubeObject, LabelSelector } from "../kube-object";
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
24
24
|
export interface PodDisruptionBudget {
|
|
25
25
|
spec: {
|
|
26
26
|
minAvailable: string;
|
|
27
27
|
maxUnavailable: string;
|
|
28
|
-
selector:
|
|
29
|
-
matchLabels: {
|
|
30
|
-
[app: string]: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
28
|
+
selector: LabelSelector;
|
|
33
29
|
};
|
|
34
30
|
status: {
|
|
35
31
|
currentHealthy: number;
|
|
@@ -22,6 +22,7 @@ import { WorkloadKubeObject } from "../workload-kube-object";
|
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { IPodMetrics, Pod } from "./pods.api";
|
|
24
24
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
25
|
+
import type { LabelSelector } from "../kube-object";
|
|
25
26
|
export declare class ReplicaSetApi extends KubeApi<ReplicaSet> {
|
|
26
27
|
protected getScaleApiUrl(params: {
|
|
27
28
|
namespace: string;
|
|
@@ -44,11 +45,7 @@ export declare class ReplicaSet extends WorkloadKubeObject {
|
|
|
44
45
|
constructor(data: KubeJsonApiData);
|
|
45
46
|
spec: {
|
|
46
47
|
replicas?: number;
|
|
47
|
-
selector:
|
|
48
|
-
matchLabels: {
|
|
49
|
-
[app: string]: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
48
|
+
selector: LabelSelector;
|
|
52
49
|
template?: {
|
|
53
50
|
metadata: {
|
|
54
51
|
labels: {
|
|
@@ -22,6 +22,7 @@ import { IAffinity, WorkloadKubeObject } from "../workload-kube-object";
|
|
|
22
22
|
import { KubeApi } from "../kube-api";
|
|
23
23
|
import type { IPodMetrics } from "./pods.api";
|
|
24
24
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
25
|
+
import type { LabelSelector } from "../kube-object";
|
|
25
26
|
export declare class StatefulSetApi extends KubeApi<StatefulSet> {
|
|
26
27
|
protected getScaleApiUrl(params: {
|
|
27
28
|
namespace: string;
|
|
@@ -45,11 +46,7 @@ export declare class StatefulSet extends WorkloadKubeObject {
|
|
|
45
46
|
spec: {
|
|
46
47
|
serviceName: string;
|
|
47
48
|
replicas: number;
|
|
48
|
-
selector:
|
|
49
|
-
matchLabels: {
|
|
50
|
-
[key: string]: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
49
|
+
selector: LabelSelector;
|
|
53
50
|
template: {
|
|
54
51
|
metadata: {
|
|
55
52
|
labels: {
|
|
@@ -106,6 +106,26 @@ export declare type KubeApiWatchOptions = {
|
|
|
106
106
|
timeout?: number;
|
|
107
107
|
};
|
|
108
108
|
export declare type KubeApiPatchType = "merge" | "json" | "strategic";
|
|
109
|
+
export interface ResourceDescriptor {
|
|
110
|
+
/**
|
|
111
|
+
* The name of the kubernetes resource
|
|
112
|
+
*/
|
|
113
|
+
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* The namespace that the resource lives in (if the resource is namespaced)
|
|
116
|
+
*
|
|
117
|
+
* Note: if not provided and the resource kind is namespaced, then this defaults to `"default"`
|
|
118
|
+
*/
|
|
119
|
+
namespace?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface DeleteResourceDescriptor extends ResourceDescriptor {
|
|
122
|
+
/**
|
|
123
|
+
* This determinines how child resources should be handled by kubernetes
|
|
124
|
+
*
|
|
125
|
+
* @default "Background"
|
|
126
|
+
*/
|
|
127
|
+
propagationPolicy?: PropagationPolicy;
|
|
128
|
+
}
|
|
109
129
|
export declare class KubeApi<T extends KubeObject> {
|
|
110
130
|
protected options: IKubeApiOptions<T>;
|
|
111
131
|
readonly kind: string;
|
|
@@ -136,34 +156,15 @@ export declare class KubeApi<T extends KubeObject> {
|
|
|
136
156
|
setResourceVersion(namespace: string, newVersion: string): void;
|
|
137
157
|
getResourceVersion(namespace?: string): string;
|
|
138
158
|
refreshResourceVersion(params?: KubeApiListOptions): Promise<T[]>;
|
|
139
|
-
getUrl({ name, namespace }?:
|
|
140
|
-
name?: string;
|
|
141
|
-
namespace?: string;
|
|
142
|
-
}, query?: Partial<IKubeApiQueryParams>): string;
|
|
159
|
+
getUrl({ name, namespace }?: Partial<ResourceDescriptor>, query?: Partial<IKubeApiQueryParams>): string;
|
|
143
160
|
protected normalizeQuery(query?: Partial<IKubeApiQueryParams>): Partial<IKubeApiQueryParams>;
|
|
144
161
|
protected parseResponse(data: unknown, namespace?: string): T | T[] | null;
|
|
145
162
|
list({ namespace, reqInit }?: KubeApiListOptions, query?: IKubeApiQueryParams): Promise<T[] | null>;
|
|
146
|
-
get(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
name?: string;
|
|
152
|
-
namespace?: string;
|
|
153
|
-
}, data?: Partial<T>): Promise<T | null>;
|
|
154
|
-
update({ name, namespace }?: {
|
|
155
|
-
name?: string;
|
|
156
|
-
namespace?: string;
|
|
157
|
-
}, data?: Partial<T>): Promise<T | null>;
|
|
158
|
-
patch({ name, namespace }?: {
|
|
159
|
-
name?: string;
|
|
160
|
-
namespace?: string;
|
|
161
|
-
}, data?: Partial<T> | Patch, strategy?: KubeApiPatchType): Promise<T | null>;
|
|
162
|
-
delete({ name, namespace, propagationPolicy }: {
|
|
163
|
-
name: string;
|
|
164
|
-
namespace?: string;
|
|
165
|
-
propagationPolicy?: PropagationPolicy;
|
|
166
|
-
}): Promise<KubeJsonApiData>;
|
|
163
|
+
get(desc: ResourceDescriptor, query?: IKubeApiQueryParams): Promise<T | null>;
|
|
164
|
+
create({ name, namespace }: Partial<ResourceDescriptor>, data?: Partial<T>): Promise<T | null>;
|
|
165
|
+
update({ name, namespace }: ResourceDescriptor, data: Partial<T>): Promise<T | null>;
|
|
166
|
+
patch(desc: ResourceDescriptor, data?: Partial<T> | Patch, strategy?: KubeApiPatchType): Promise<T | null>;
|
|
167
|
+
delete({ propagationPolicy, ...desc }: DeleteResourceDescriptor): Promise<KubeJsonApiData>;
|
|
167
168
|
getWatchUrl(namespace?: string, query?: IKubeApiQueryParams): string;
|
|
168
169
|
watch(opts?: KubeApiWatchOptions): () => void;
|
|
169
170
|
protected modifyWatchEvent(event: IKubeWatchEvent<KubeJsonApiData>): void;
|
|
@@ -81,9 +81,32 @@ export declare class KubeCreationError extends Error {
|
|
|
81
81
|
data: any;
|
|
82
82
|
constructor(message: string, data: any);
|
|
83
83
|
}
|
|
84
|
+
export declare type LabelMatchExpression = {
|
|
85
|
+
/**
|
|
86
|
+
* The label key that the selector applies to.
|
|
87
|
+
*/
|
|
88
|
+
key: string;
|
|
89
|
+
} & ({
|
|
90
|
+
/**
|
|
91
|
+
* This represents the key's relationship to a set of values.
|
|
92
|
+
*/
|
|
93
|
+
operator: "Exists" | "DoesNotExist";
|
|
94
|
+
values?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
operator: "In" | "NotIn";
|
|
97
|
+
/**
|
|
98
|
+
* The set of values for to match according to the operator for the label.
|
|
99
|
+
*/
|
|
100
|
+
values: string[];
|
|
101
|
+
});
|
|
102
|
+
export interface LabelSelector {
|
|
103
|
+
matchLabels?: Record<string, string | undefined>;
|
|
104
|
+
matchExpressions?: LabelMatchExpression[];
|
|
105
|
+
}
|
|
84
106
|
export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata, Status = any, Spec = any> implements ItemObject {
|
|
85
|
-
static readonly kind
|
|
86
|
-
static readonly namespaced
|
|
107
|
+
static readonly kind?: string;
|
|
108
|
+
static readonly namespaced?: boolean;
|
|
109
|
+
static readonly apiBase?: string;
|
|
87
110
|
apiVersion: string;
|
|
88
111
|
kind: string;
|
|
89
112
|
metadata: Metadata;
|
|
@@ -25,10 +25,10 @@ import { ItemStore } from "../item.store";
|
|
|
25
25
|
import { IKubeApiQueryParams, KubeApi } from "./kube-api";
|
|
26
26
|
import type { KubeJsonApiData } from "./kube-json-api";
|
|
27
27
|
import type { RequestInit } from "node-fetch";
|
|
28
|
+
import AbortController from "abort-controller";
|
|
28
29
|
import type { Patch } from "rfc6902";
|
|
29
|
-
export interface KubeObjectStoreLoadingParams
|
|
30
|
+
export interface KubeObjectStoreLoadingParams {
|
|
30
31
|
namespaces: string[];
|
|
31
|
-
api?: KubeApi<K>;
|
|
32
32
|
reqInit?: RequestInit;
|
|
33
33
|
/**
|
|
34
34
|
* A function that is called when listing fails. If set then blocks errors
|
|
@@ -52,6 +52,10 @@ export interface KubeObjectStoreSubscribeParams {
|
|
|
52
52
|
* being rejected with
|
|
53
53
|
*/
|
|
54
54
|
onLoadFailure?: (err: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* An optional parent abort controller
|
|
57
|
+
*/
|
|
58
|
+
abortController?: AbortController;
|
|
55
59
|
}
|
|
56
60
|
export declare abstract class KubeObjectStore<T extends KubeObject> extends ItemStore<T> {
|
|
57
61
|
static defaultContext: import("mobx").IObservableValue<ClusterContext>;
|
|
@@ -78,16 +82,16 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
78
82
|
getByLabel(labels: string[] | {
|
|
79
83
|
[label: string]: string;
|
|
80
84
|
}): T[];
|
|
81
|
-
protected loadItems({ namespaces,
|
|
85
|
+
protected loadItems({ namespaces, reqInit, onLoadFailure }: KubeObjectStoreLoadingParams): Promise<T[]>;
|
|
82
86
|
protected filterItemsOnLoad(items: T[]): T[];
|
|
83
|
-
loadAll(
|
|
87
|
+
loadAll({ namespaces, merge, reqInit, onLoadFailure }?: KubeObjectStoreLoadAllParams): Promise<void | T[]>;
|
|
84
88
|
reloadAll(opts?: {
|
|
85
89
|
force?: boolean;
|
|
86
90
|
namespaces?: string[];
|
|
87
91
|
merge?: boolean;
|
|
88
92
|
}): Promise<void | T[]>;
|
|
89
|
-
protected mergeItems(partialItems: T[], {
|
|
90
|
-
|
|
93
|
+
protected mergeItems(partialItems: T[], { merge, updateStore, sort, filter }?: {
|
|
94
|
+
merge?: boolean;
|
|
91
95
|
updateStore?: boolean;
|
|
92
96
|
sort?: boolean;
|
|
93
97
|
filter?: boolean;
|
|
@@ -117,7 +121,7 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
117
121
|
removeSelectedItems(): Promise<void[]>;
|
|
118
122
|
protected eventsBuffer: import("mobx").IObservableArray<IKubeWatchEvent<KubeJsonApiData>>;
|
|
119
123
|
protected bindWatchEventsUpdater(delay?: number): void;
|
|
120
|
-
subscribe(
|
|
124
|
+
subscribe({ onLoadFailure, abortController }?: KubeObjectStoreSubscribeParams): () => void;
|
|
121
125
|
private watchNamespace;
|
|
122
126
|
protected updateFromEventsBuffer(): void;
|
|
123
127
|
}
|
|
@@ -21,57 +21,34 @@
|
|
|
21
21
|
import type { KubeObjectStore } from "./kube-object.store";
|
|
22
22
|
import type { ClusterContext } from "./cluster-context";
|
|
23
23
|
import { Disposer } from "../utils";
|
|
24
|
-
import type { KubeApi } from "./kube-api";
|
|
25
24
|
import type { KubeJsonApiData } from "./kube-json-api";
|
|
26
25
|
import type { KubeObject } from "./kube-object";
|
|
27
26
|
export interface IKubeWatchEvent<T extends KubeJsonApiData> {
|
|
28
27
|
type: "ADDED" | "MODIFIED" | "DELETED" | "ERROR";
|
|
29
28
|
object?: T;
|
|
30
29
|
}
|
|
31
|
-
interface
|
|
30
|
+
export interface KubeWatchSubscribeStoreOptions {
|
|
32
31
|
/**
|
|
33
32
|
* The namespaces to watch
|
|
34
|
-
* @default all
|
|
33
|
+
* @default all selected namespaces
|
|
35
34
|
*/
|
|
36
35
|
namespaces?: string[];
|
|
37
|
-
/**
|
|
38
|
-
* Whether to skip loading if the store is already loaded
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
loadOnce?: boolean;
|
|
42
36
|
/**
|
|
43
37
|
* A function that is called when listing fails. If set then blocks errors
|
|
44
38
|
* being rejected with
|
|
45
39
|
*/
|
|
46
40
|
onLoadFailure?: (err: any) => void;
|
|
47
41
|
}
|
|
48
|
-
export interface KubeWatchSubscribeStoreOptions extends KubeWatchPreloadOptions {
|
|
49
|
-
/**
|
|
50
|
-
* Whether to subscribe only after loading all stores
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
waitUntilLoaded?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Whether to preload the stores before watching
|
|
56
|
-
* @default true
|
|
57
|
-
*/
|
|
58
|
-
preload?: boolean;
|
|
59
|
-
}
|
|
60
42
|
export interface IKubeWatchLog {
|
|
61
43
|
message: string | string[] | Error;
|
|
62
44
|
meta?: object;
|
|
63
45
|
cssStyle?: string;
|
|
64
46
|
}
|
|
65
47
|
export declare class KubeWatchApi {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
cancelLoading: () => void;
|
|
72
|
-
};
|
|
73
|
-
subscribeStores(stores: KubeObjectStore<KubeObject>[], opts?: KubeWatchSubscribeStoreOptions): Disposer;
|
|
74
|
-
protected log({ message, cssStyle, meta }: IKubeWatchLog): void;
|
|
48
|
+
#private;
|
|
49
|
+
static context: ClusterContext;
|
|
50
|
+
private subscribeStore;
|
|
51
|
+
subscribeStores(stores: KubeObjectStore<KubeObject>[], { namespaces, onLoadFailure }?: KubeWatchSubscribeStoreOptions): Disposer;
|
|
52
|
+
protected log(message: any, meta: any): void;
|
|
75
53
|
}
|
|
76
54
|
export declare const kubeWatchApi: KubeWatchApi;
|
|
77
|
-
export {};
|