mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into page_registry_issue_1258
This commit is contained in:
commit
bc3a659735
@ -9,13 +9,20 @@ export interface KubeObjectDetailRegistration {
|
|||||||
kind: string;
|
kind: string;
|
||||||
apiVersions: string[];
|
apiVersions: string[];
|
||||||
components: KubeObjectDetailComponents;
|
components: KubeObjectDetailComponents;
|
||||||
|
priority?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class KubeObjectDetailRegistry extends BaseRegistry<KubeObjectDetailRegistration> {
|
export class KubeObjectDetailRegistry extends BaseRegistry<KubeObjectDetailRegistration> {
|
||||||
getItemsForKind(kind: string, apiVersion: string) {
|
getItemsForKind(kind: string, apiVersion: string) {
|
||||||
return this.getItems().filter((item) => {
|
const items = this.getItems().filter((item) => {
|
||||||
return item.kind === kind && item.apiVersions.includes(apiVersion)
|
return item.kind === kind && item.apiVersions.includes(apiVersion)
|
||||||
|
}).map((item) => {
|
||||||
|
if (item.priority === null) {
|
||||||
|
item.priority = 50
|
||||||
|
}
|
||||||
|
return item
|
||||||
})
|
})
|
||||||
|
return items.sort((a, b) => b.priority - a.priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ export { isAllowedResource } from "../../common/rbac"
|
|||||||
export { apiManager } from "../../renderer/api/api-manager";
|
export { apiManager } from "../../renderer/api/api-manager";
|
||||||
export { KubeObjectStore } from "../../renderer/kube-object.store"
|
export { KubeObjectStore } from "../../renderer/kube-object.store"
|
||||||
export { KubeApi, forCluster, IKubeApiCluster } from "../../renderer/api/kube-api";
|
export { KubeApi, forCluster, IKubeApiCluster } from "../../renderer/api/kube-api";
|
||||||
export { VersionedKubeApi } from "../../renderer/api/kube-api-versioned";
|
|
||||||
export { KubeObject } from "../../renderer/api/kube-object";
|
export { KubeObject } from "../../renderer/api/kube-object";
|
||||||
export { Pod, podsApi, PodsApi, IPodContainer, IPodContainerStatus } from "../../renderer/api/endpoints";
|
export { Pod, podsApi, PodsApi, IPodContainer, IPodContainerStatus } from "../../renderer/api/endpoints";
|
||||||
export { Node, nodesApi, NodesApi } from "../../renderer/api/endpoints";
|
export { Node, nodesApi, NodesApi } from "../../renderer/api/endpoints";
|
||||||
@ -32,10 +31,10 @@ export { RoleBinding, roleBindingApi } from "../../renderer/api/endpoints";
|
|||||||
export { ClusterRole, clusterRoleApi } from "../../renderer/api/endpoints";
|
export { ClusterRole, clusterRoleApi } from "../../renderer/api/endpoints";
|
||||||
export { ClusterRoleBinding, clusterRoleBindingApi } from "../../renderer/api/endpoints";
|
export { ClusterRoleBinding, clusterRoleBindingApi } from "../../renderer/api/endpoints";
|
||||||
export { CustomResourceDefinition, crdApi } from "../../renderer/api/endpoints";
|
export { CustomResourceDefinition, crdApi } from "../../renderer/api/endpoints";
|
||||||
export { KubeObjectStatus, KubeObjectStatusLevel} from "./kube-object-status"
|
export { KubeObjectStatus, KubeObjectStatusLevel } from "./kube-object-status"
|
||||||
|
|
||||||
// stores
|
// stores
|
||||||
export type { EventStore } from "../../renderer/components/+events/event.store"
|
export type { EventStore } from "../../renderer/components/+events/event.store"
|
||||||
export type { PodsStore } from "../../renderer/components/+workloads-pods/pods.store"
|
export type { PodsStore } from "../../renderer/components/+workloads-pods/pods.store"
|
||||||
export type { NodesStore } from "../../renderer/components/+nodes/nodes.store"
|
export type { NodesStore } from "../../renderer/components/+nodes/nodes.store"
|
||||||
export type { DeploymentStore } from "../../renderer/components/+workloads-deployments/deployments.store"
|
export type { DeploymentStore } from "../../renderer/components/+workloads-deployments/deployments.store"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { KubeObject } from "../kube-object";
|
import { KubeObject } from "../kube-object";
|
||||||
import { VersionedKubeApi } from "../kube-api-versioned";
|
|
||||||
import { crdResourcesURL } from "../../components/+custom-resources/crd.route";
|
import { crdResourcesURL } from "../../components/+custom-resources/crd.route";
|
||||||
|
import { KubeApi } from "../kube-api";
|
||||||
|
|
||||||
type AdditionalPrinterColumnsCommon = {
|
type AdditionalPrinterColumnsCommon = {
|
||||||
name: string;
|
name: string;
|
||||||
@ -146,6 +146,7 @@ export class CustomResourceDefinition extends KubeObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const crdApi = new VersionedKubeApi<CustomResourceDefinition>({
|
export const crdApi = new KubeApi<CustomResourceDefinition>({
|
||||||
objectConstructor: CustomResourceDefinition
|
objectConstructor: CustomResourceDefinition,
|
||||||
|
checkPreferredVersion: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,56 +0,0 @@
|
|||||||
import { stringify } from "querystring";
|
|
||||||
import { KubeObject } from "./kube-object";
|
|
||||||
import { createKubeApiURL } from "./kube-api-parse";
|
|
||||||
import { KubeApi, IKubeApiQueryParams, IKubeApiOptions } from "./kube-api";
|
|
||||||
import { apiManager } from "./api-manager";
|
|
||||||
|
|
||||||
export class VersionedKubeApi<T extends KubeObject = any> extends KubeApi<T> {
|
|
||||||
private preferredVersion?: string;
|
|
||||||
|
|
||||||
constructor(opts: IKubeApiOptions<T>) {
|
|
||||||
super(opts);
|
|
||||||
|
|
||||||
this.getPreferredVersion().then(() => {
|
|
||||||
if (this.apiBase != opts.apiBase)
|
|
||||||
apiManager.registerApi(this.apiBase, this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// override this property to make read-write
|
|
||||||
apiBase: string
|
|
||||||
|
|
||||||
async getPreferredVersion() {
|
|
||||||
if (this.preferredVersion) return;
|
|
||||||
|
|
||||||
const apiGroupVersion = await this.request.get<{ preferredVersion?: { version: string; }; }>(`${this.apiPrefix}/${this.apiGroup}`);
|
|
||||||
|
|
||||||
if (!apiGroupVersion?.preferredVersion) return;
|
|
||||||
|
|
||||||
this.preferredVersion = apiGroupVersion.preferredVersion.version;
|
|
||||||
|
|
||||||
// update apiBase
|
|
||||||
this.apiBase = this.getUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
async list({ namespace = "" } = {}, query?: IKubeApiQueryParams): Promise<T[]> {
|
|
||||||
await this.getPreferredVersion();
|
|
||||||
return await super.list({namespace}, query);
|
|
||||||
}
|
|
||||||
async get({ name = "", namespace = "default" } = {}, query?: IKubeApiQueryParams): Promise<T> {
|
|
||||||
await this.getPreferredVersion();
|
|
||||||
return super.get({ name, namespace }, query);
|
|
||||||
}
|
|
||||||
|
|
||||||
getUrl({ name = "", namespace = "" } = {}, query?: Partial<IKubeApiQueryParams>) {
|
|
||||||
const { apiPrefix, apiGroup, apiVersion, apiResource, preferredVersion, isNamespaced } = this;
|
|
||||||
|
|
||||||
const resourcePath = createKubeApiURL({
|
|
||||||
apiPrefix: apiPrefix,
|
|
||||||
apiVersion: `${apiGroup}/${preferredVersion ?? apiVersion}`,
|
|
||||||
resource: apiResource,
|
|
||||||
namespace: isNamespaced ? namespace : undefined,
|
|
||||||
name: name,
|
|
||||||
});
|
|
||||||
return resourcePath + (query ? `?` + stringify(this.normalizeQuery(query)) : "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -16,6 +16,7 @@ export interface IKubeApiOptions<T extends KubeObject> {
|
|||||||
request?: KubeJsonApi;
|
request?: KubeJsonApi;
|
||||||
isNamespaced?: boolean;
|
isNamespaced?: boolean;
|
||||||
kind?: string;
|
kind?: string;
|
||||||
|
checkPreferredVersion?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IKubeApiQueryParams {
|
export interface IKubeApiQueryParams {
|
||||||
@ -28,6 +29,12 @@ export interface IKubeApiQueryParams {
|
|||||||
fieldSelector?: string | string[]; // restrict list of objects by their fields, e.g. fieldSelector: "field=name"
|
fieldSelector?: string | string[]; // restrict list of objects by their fields, e.g. fieldSelector: "field=name"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IKubePreferredVersion {
|
||||||
|
preferredVersion?: {
|
||||||
|
version: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface IKubeApiCluster {
|
export interface IKubeApiCluster {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
@ -60,7 +67,7 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
readonly apiPrefix: string
|
readonly apiPrefix: string
|
||||||
readonly apiGroup: string
|
readonly apiGroup: string
|
||||||
readonly apiVersion: string
|
readonly apiVersion: string
|
||||||
readonly apiVersionWithGroup: string
|
readonly apiVersionPreferred?: string;
|
||||||
readonly apiResource: string
|
readonly apiResource: string
|
||||||
readonly isNamespaced: boolean
|
readonly isNamespaced: boolean
|
||||||
|
|
||||||
@ -86,15 +93,35 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
this.apiPrefix = apiPrefix;
|
this.apiPrefix = apiPrefix;
|
||||||
this.apiGroup = apiGroup;
|
this.apiGroup = apiGroup;
|
||||||
this.apiVersion = apiVersion;
|
this.apiVersion = apiVersion;
|
||||||
this.apiVersionWithGroup = apiVersionWithGroup;
|
|
||||||
this.apiResource = resource;
|
this.apiResource = resource;
|
||||||
this.request = request;
|
this.request = request;
|
||||||
this.objectConstructor = objectConstructor;
|
this.objectConstructor = objectConstructor;
|
||||||
|
|
||||||
|
this.checkPreferredVersion();
|
||||||
this.parseResponse = this.parseResponse.bind(this);
|
this.parseResponse = this.parseResponse.bind(this);
|
||||||
apiManager.registerApi(apiBase, this);
|
apiManager.registerApi(apiBase, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get apiVersionWithGroup() {
|
||||||
|
return [this.apiGroup, this.apiVersionPreferred ?? this.apiVersion]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join("/")
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async checkPreferredVersion() {
|
||||||
|
if (this.options.checkPreferredVersion && this.apiVersionPreferred === undefined) {
|
||||||
|
const res = await this.request.get<IKubePreferredVersion>(`${this.apiPrefix}/${this.apiGroup}`);
|
||||||
|
Object.defineProperty(this, "apiVersionPreferred", {
|
||||||
|
value: res?.preferredVersion?.version ?? null,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.apiVersionPreferred) {
|
||||||
|
Object.defineProperty(this, "apiBase", { value: this.getUrl() })
|
||||||
|
apiManager.registerApi(this.apiBase, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setResourceVersion(namespace = "", newVersion: string) {
|
setResourceVersion(namespace = "", newVersion: string) {
|
||||||
this.resourceVersions.set(namespace, newVersion);
|
this.resourceVersions.set(namespace, newVersion);
|
||||||
}
|
}
|
||||||
@ -108,11 +135,10 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getUrl({ name = "", namespace = "" } = {}, query?: Partial<IKubeApiQueryParams>) {
|
getUrl({ name = "", namespace = "" } = {}, query?: Partial<IKubeApiQueryParams>) {
|
||||||
const { apiPrefix, apiVersionWithGroup, apiResource } = this;
|
|
||||||
const resourcePath = createKubeApiURL({
|
const resourcePath = createKubeApiURL({
|
||||||
apiPrefix: apiPrefix,
|
apiPrefix: this.apiPrefix,
|
||||||
apiVersion: apiVersionWithGroup,
|
apiVersion: this.apiVersionWithGroup,
|
||||||
resource: apiResource,
|
resource: this.apiResource,
|
||||||
namespace: this.isNamespaced ? namespace : undefined,
|
namespace: this.isNamespaced ? namespace : undefined,
|
||||||
name: name,
|
name: name,
|
||||||
});
|
});
|
||||||
@ -156,18 +182,21 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async list({ namespace = "" } = {}, query?: IKubeApiQueryParams): Promise<T[]> {
|
async list({ namespace = "" } = {}, query?: IKubeApiQueryParams): Promise<T[]> {
|
||||||
|
await this.checkPreferredVersion();
|
||||||
return this.request
|
return this.request
|
||||||
.get(this.getUrl({ namespace }), { query })
|
.get(this.getUrl({ namespace }), { query })
|
||||||
.then(data => this.parseResponse(data, namespace));
|
.then(data => this.parseResponse(data, namespace));
|
||||||
}
|
}
|
||||||
|
|
||||||
async get({ name = "", namespace = "default" } = {}, query?: IKubeApiQueryParams): Promise<T> {
|
async get({ name = "", namespace = "default" } = {}, query?: IKubeApiQueryParams): Promise<T> {
|
||||||
|
await this.checkPreferredVersion();
|
||||||
return this.request
|
return this.request
|
||||||
.get(this.getUrl({ namespace, name }), { query })
|
.get(this.getUrl({ namespace, name }), { query })
|
||||||
.then(this.parseResponse);
|
.then(this.parseResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
async create({ name = "", namespace = "default" } = {}, data?: Partial<T>): Promise<T> {
|
async create({ name = "", namespace = "default" } = {}, data?: Partial<T>): Promise<T> {
|
||||||
|
await this.checkPreferredVersion();
|
||||||
const apiUrl = this.getUrl({ namespace });
|
const apiUrl = this.getUrl({ namespace });
|
||||||
|
|
||||||
return this.request
|
return this.request
|
||||||
@ -185,6 +214,7 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update({ name = "", namespace = "default" } = {}, data?: Partial<T>): Promise<T> {
|
async update({ name = "", namespace = "default" } = {}, data?: Partial<T>): Promise<T> {
|
||||||
|
await this.checkPreferredVersion();
|
||||||
const apiUrl = this.getUrl({ namespace, name });
|
const apiUrl = this.getUrl({ namespace, name });
|
||||||
return this.request
|
return this.request
|
||||||
.put(apiUrl, { data })
|
.put(apiUrl, { data })
|
||||||
@ -192,6 +222,7 @@ export class KubeApi<T extends KubeObject = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async delete({ name = "", namespace = "default" }) {
|
async delete({ name = "", namespace = "default" }) {
|
||||||
|
await this.checkPreferredVersion();
|
||||||
const apiUrl = this.getUrl({ namespace, name });
|
const apiUrl = this.getUrl({ namespace, name });
|
||||||
return this.request.del(apiUrl)
|
return this.request.del(apiUrl)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,8 +121,6 @@ export class HpaDetails extends React.Component<Props> {
|
|||||||
<div className="metrics">
|
<div className="metrics">
|
||||||
{this.renderMetrics()}
|
{this.renderMetrics()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<KubeEventDetails object={hpa}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -135,3 +133,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <HpaDetails {...props} />
|
Details: (props) => <HpaDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "HorizontalPodAutoscaler",
|
||||||
|
apiVersions: ["autoscaling/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -87,8 +87,6 @@ export class ConfigMapDetails extends React.Component<Props> {
|
|||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
<KubeEventDetails object={configMap}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -101,3 +99,14 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <ConfigMapDetails {...props} />
|
Details: (props) => <ConfigMapDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ConfigMap",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<div>
|
||||||
<DrawerTitle className="flex gaps align-center">
|
<DrawerTitle className="flex gaps align-center">
|
||||||
<span><Trans>Events</Trans></span>
|
<span><Trans>Events</Trans></span>
|
||||||
</DrawerTitle>
|
</DrawerTitle>
|
||||||
@ -57,7 +57,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,8 +31,6 @@ export class EndpointDetails extends React.Component<Props> {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
<KubeEventDetails object={endpoint}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -45,3 +43,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <EndpointDetails {...props} />
|
Details: (props) => <EndpointDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Endpoints",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -127,8 +127,6 @@ export class IngressDetails extends React.Component<Props> {
|
|||||||
|
|
||||||
<DrawerTitle title={<Trans>Load-Balancer Ingress Points</Trans>}/>
|
<DrawerTitle title={<Trans>Load-Balancer Ingress Points</Trans>}/>
|
||||||
{this.renderIngressPoints(ingressPoints)}
|
{this.renderIngressPoints(ingressPoints)}
|
||||||
|
|
||||||
<KubeEventDetails object={ingress}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -141,3 +139,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <IngressDetails {...props} />
|
Details: (props) => <IngressDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Ingress",
|
||||||
|
apiVersions: ["extensions/v1beta1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -137,8 +137,6 @@ export class NetworkPolicyDetails extends React.Component<Props> {
|
|||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<KubeEventDetails object={policy}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -151,3 +149,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <NetworkPolicyDetails {...props} />
|
Details: (props) => <NetworkPolicyDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "NetworkPolicy",
|
||||||
|
apiVersions: ["networking.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -78,8 +78,6 @@ export class ServiceDetails extends React.Component<Props> {
|
|||||||
<DrawerTitle title={_i18n._(t`Endpoint`)}/>
|
<DrawerTitle title={_i18n._(t`Endpoint`)}/>
|
||||||
|
|
||||||
<ServiceDetailsEndpoint endpoint={endpoint} />
|
<ServiceDetailsEndpoint endpoint={endpoint} />
|
||||||
|
|
||||||
<KubeEventDetails object={service}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -92,3 +90,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <ServiceDetails {...props} />
|
Details: (props) => <ServiceDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Service",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -149,7 +149,6 @@ export class NodeDetails extends React.Component<Props> {
|
|||||||
maxCpu={node.getCpuCapacity()}
|
maxCpu={node.getCpuCapacity()}
|
||||||
maxMemory={node.getMemoryCapacity()}
|
maxMemory={node.getMemoryCapacity()}
|
||||||
/>
|
/>
|
||||||
<KubeEventDetails object={node}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -162,3 +161,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <NodeDetails {...props} />
|
Details: (props) => <NodeDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Node",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -55,8 +55,6 @@ export class StorageClassDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<KubeEventDetails object={storageClass}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -69,3 +67,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <StorageClassDetails {...props} />
|
Details: (props) => <StorageClassDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "StorageClass",
|
||||||
|
apiVersions: ["storage.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -88,8 +88,6 @@ export class PersistentVolumeClaimDetails extends React.Component<Props> {
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
|
||||||
<KubeEventDetails object={volumeClaim}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -102,3 +100,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "PersistentVolumeClaim",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -96,8 +96,6 @@ export class PersistentVolumeDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<KubeEventDetails object={volume}/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -110,3 +108,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <PersistentVolumeDetails {...props} />
|
Details: (props) => <PersistentVolumeDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "PersistentVolume",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -112,8 +112,6 @@ export class RoleBindingDetails extends React.Component<Props> {
|
|||||||
</Table>
|
</Table>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<KubeEventDetails object={roleBinding}/>
|
|
||||||
|
|
||||||
<AddRemoveButtons
|
<AddRemoveButtons
|
||||||
onAdd={() => AddRoleBindingDialog.open(roleBinding)}
|
onAdd={() => AddRoleBindingDialog.open(roleBinding)}
|
||||||
onRemove={selectedSubjects.length ? this.removeSelectedSubjects : null}
|
onRemove={selectedSubjects.length ? this.removeSelectedSubjects : null}
|
||||||
@ -132,6 +130,16 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <RoleBindingDetails {...props} />
|
Details: (props) => <RoleBindingDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "RoleBinding",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
kind: "ClusterRoleBinding",
|
kind: "ClusterRoleBinding",
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
@ -139,3 +147,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <RoleBindingDetails {...props} />
|
Details: (props) => <RoleBindingDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ClusterRoleBinding",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -59,8 +59,6 @@ export class RoleDetails extends React.Component<Props> {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|
||||||
<KubeEventDetails object={role}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -73,6 +71,14 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <RoleDetails {...props}/>
|
Details: (props) => <RoleDetails {...props}/>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Role",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add({
|
kubeObjectDetailRegistry.add({
|
||||||
kind: "ClusterRole",
|
kind: "ClusterRole",
|
||||||
@ -81,3 +87,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <RoleDetails {...props}/>
|
Details: (props) => <RoleDetails {...props}/>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ClusterRole",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props}/>
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -125,8 +125,6 @@ export class ServiceAccountsDetails extends React.Component<Props> {
|
|||||||
<div className="secrets">
|
<div className="secrets">
|
||||||
{this.renderSecrets()}
|
{this.renderSecrets()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<KubeEventDetails object={serviceAccount}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -139,3 +137,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <ServiceAccountsDetails {...props} />
|
Details: (props) => <ServiceAccountsDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ServiceAccount",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -81,7 +81,6 @@ export class CronJobDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
<KubeEventDetails object={cronJob}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -94,3 +93,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props) => <CronJobDetails {...props} />
|
Details: (props) => <CronJobDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "CronJob",
|
||||||
|
apiVersions: ["batch/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -91,7 +91,6 @@ export class DaemonSetDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<ResourceMetricsText metrics={metrics}/>
|
<ResourceMetricsText metrics={metrics}/>
|
||||||
<PodDetailsList pods={childPods} owner={daemonSet}/>
|
<PodDetailsList pods={childPods} owner={daemonSet}/>
|
||||||
<KubeEventDetails object={daemonSet}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -104,3 +103,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props: any) => <DaemonSetDetails {...props} />
|
Details: (props: any) => <DaemonSetDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "DaemonSet",
|
||||||
|
apiVersions: ["apps/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: any) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -116,7 +116,6 @@ export class DeploymentDetails extends React.Component<Props> {
|
|||||||
<ResourceMetricsText metrics={metrics}/>
|
<ResourceMetricsText metrics={metrics}/>
|
||||||
<ReplicaSets replicaSets={replicaSets}/>
|
<ReplicaSets replicaSets={replicaSets}/>
|
||||||
<PodDetailsList pods={childPods} owner={deployment}/>
|
<PodDetailsList pods={childPods} owner={deployment}/>
|
||||||
<KubeEventDetails object={deployment}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -129,3 +128,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props: any) => <DeploymentDetails {...props} />
|
Details: (props: any) => <DeploymentDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Deployment",
|
||||||
|
apiVersions: ["apps/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: any) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -101,7 +101,6 @@ export class JobDetails extends React.Component<Props> {
|
|||||||
<PodDetailsStatuses pods={childPods}/>
|
<PodDetailsStatuses pods={childPods}/>
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<PodDetailsList pods={childPods} owner={job}/>
|
<PodDetailsList pods={childPods} owner={job}/>
|
||||||
<KubeEventDetails object={job}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -114,3 +113,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props: any) => <JobDetails {...props}/>
|
Details: (props: any) => <JobDetails {...props}/>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Job",
|
||||||
|
apiVersions: ["batch/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: any) => <KubeEventDetails {...props}/>
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -215,7 +215,6 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<KubeEventDetails object={pod}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -225,6 +224,15 @@ kubeObjectDetailRegistry.add({
|
|||||||
kind: "Pod",
|
kind: "Pod",
|
||||||
apiVersions: ["v1"],
|
apiVersions: ["v1"],
|
||||||
components: {
|
components: {
|
||||||
Details: (props: any) => <PodDetails {...props} />
|
Details: (props: KubeObjectDetailsProps<Pod>) => <PodDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "Pod",
|
||||||
|
apiVersions: ["v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: KubeObjectDetailsProps<Pod>) => <KubeEventDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -91,7 +91,6 @@ export class ReplicaSetDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<ResourceMetricsText metrics={metrics}/>
|
<ResourceMetricsText metrics={metrics}/>
|
||||||
<PodDetailsList pods={childPods} owner={replicaSet}/>
|
<PodDetailsList pods={childPods} owner={replicaSet}/>
|
||||||
<KubeEventDetails object={replicaSet}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -104,3 +103,11 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props: any) => <ReplicaSetDetails {...props} />
|
Details: (props: any) => <ReplicaSetDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ReplicaSet",
|
||||||
|
apiVersions: ["apps/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: any) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -89,7 +89,6 @@ export class StatefulSetDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
<ResourceMetricsText metrics={metrics}/>
|
<ResourceMetricsText metrics={metrics}/>
|
||||||
<PodDetailsList pods={childPods} owner={statefulSet}/>
|
<PodDetailsList pods={childPods} owner={statefulSet}/>
|
||||||
<KubeEventDetails object={statefulSet}/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -103,3 +102,12 @@ kubeObjectDetailRegistry.add({
|
|||||||
Details: (props: any) => <StatefulSetDetails {...props} />
|
Details: (props: any) => <StatefulSetDetails {...props} />
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "StatefulSet",
|
||||||
|
apiVersions: ["apps/v1"],
|
||||||
|
priority: 5,
|
||||||
|
components: {
|
||||||
|
Details: (props: any) => <KubeEventDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user