mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Remove leading '+' on some directory names
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
7dff8e31a6
commit
4379edf0c7
903 files changed
+438
-438
No files matched your search
+232
@@ -0,0 +1,232 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`MutatingWebhookConfigsDetails renders 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="MutatingWebhookDetails"
|
||||
>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
API version
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
admissionregistration.k8s.io/v1
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerTitle title"
|
||||
>
|
||||
Webhooks
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem firstItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Name
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
<strong>
|
||||
pod-policy.example.com
|
||||
</strong>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Client Config
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
Name:
|
||||
|
||||
service-name
|
||||
</div>
|
||||
<div>
|
||||
Namespace:
|
||||
|
||||
service-namespace
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Match Policy
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Failure Policy
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
Fail
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Admission Review Versions
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
v1, v1beta1
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Side Effects
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
None
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Timeout Seconds
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Namespace Selector
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Object Selector
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerItem lastItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
Rules
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
API Groups:
|
||||
|
||||
, apps, extensions
|
||||
</div>
|
||||
<div>
|
||||
API Versions:
|
||||
|
||||
v1, v1beta1
|
||||
</div>
|
||||
<div>
|
||||
Operations:
|
||||
|
||||
CREATE, UPDATE
|
||||
</div>
|
||||
<div>
|
||||
Resources:
|
||||
|
||||
pods, deployments
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
`;
|
||||
|
||||
exports[`MutatingWebhookConfigsDetails renders with no webhooks 1`] = `
|
||||
<body>
|
||||
<div>
|
||||
<div
|
||||
class="MutatingWebhookDetails"
|
||||
>
|
||||
<div
|
||||
class="DrawerItem"
|
||||
>
|
||||
<span
|
||||
class="name"
|
||||
>
|
||||
API version
|
||||
</span>
|
||||
<span
|
||||
class="value"
|
||||
>
|
||||
admissionregistration.k8s.io/v1
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="DrawerTitle title"
|
||||
>
|
||||
Webhooks
|
||||
</div>
|
||||
<div
|
||||
style="opacity: 0.6;"
|
||||
>
|
||||
No webhooks set
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
`;
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import {
|
||||
MutatingWebhookConfiguration,
|
||||
} from "../../../common/k8s-api/endpoints";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import type { DiRender } from "../test-utils/renderFor";
|
||||
import { renderFor } from "../test-utils/renderFor";
|
||||
import { MutatingWebhookDetails } from "./mutating-webhook-configurations-details";
|
||||
|
||||
const mutatingWebhookConfig = {
|
||||
apiVersion: "admissionregistration.k8s.io/v1",
|
||||
kind: "MutatingWebhookConfiguration",
|
||||
metadata: {
|
||||
name: "pod-policy.example.com",
|
||||
resourceVersion: "1",
|
||||
uid: "pod-policy.example.com",
|
||||
namespace: "default",
|
||||
selfLink: "/apis/admissionregistration.k8s.io/v1/pod-policy.example.com",
|
||||
},
|
||||
webhooks: [
|
||||
{
|
||||
name: "pod-policy.example.com",
|
||||
rules: [
|
||||
{
|
||||
apiGroups: ["", "apps", "extensions"],
|
||||
apiVersions: ["v1", "v1beta1"],
|
||||
operations: ["CREATE", "UPDATE"],
|
||||
resources: ["pods", "deployments"],
|
||||
},
|
||||
],
|
||||
failurePolicy: "Fail",
|
||||
admissionReviewVersions: ["v1", "v1beta1"],
|
||||
sideEffects: "None",
|
||||
clientConfig: {
|
||||
service: {
|
||||
namespace: "service-namespace",
|
||||
name: "service-name",
|
||||
},
|
||||
caBundle: "Cg==",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
describe("MutatingWebhookConfigsDetails", () => {
|
||||
let result: RenderResult;
|
||||
let render: DiRender;
|
||||
|
||||
beforeEach(async () => {
|
||||
const di = getDiForUnitTesting();
|
||||
|
||||
render = renderFor(di);
|
||||
});
|
||||
|
||||
it("renders", () => {
|
||||
const webhookConfig = new MutatingWebhookConfiguration(mutatingWebhookConfig);
|
||||
|
||||
result = render(
|
||||
<MutatingWebhookDetails object={webhookConfig} />,
|
||||
);
|
||||
|
||||
expect(result.baseElement).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders with no webhooks", () => {
|
||||
const webhookConfig = new MutatingWebhookConfiguration({
|
||||
...mutatingWebhookConfig,
|
||||
webhooks: [],
|
||||
});
|
||||
|
||||
result = render(
|
||||
<MutatingWebhookDetails object={webhookConfig} />,
|
||||
);
|
||||
|
||||
expect(result.baseElement).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
export * from "./mutating-webhook-configurations";
|
||||
export * from "./mutating-webhook-configurations-details";
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { kubeObjectStoreInjectionToken } from "../../../common/k8s-api/api-manager/kube-object-store-token";
|
||||
import { MutatingWebhookConfigurationStore } from "./mutating-webhook-configuration-store";
|
||||
import clusterFrameContextForNamespacedResourcesInjectable from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
import mutatingWebhookConfigurationApiInjectable
|
||||
from "../../../common/k8s-api/endpoints/mutating-webhook-configuration-api.injectable";
|
||||
|
||||
const mutatingWebhookConfigurationStoreInjectable = getInjectable({
|
||||
id: "mutating-webhook-configuration-store",
|
||||
instantiate: (di) => {
|
||||
const api = di.inject(mutatingWebhookConfigurationApiInjectable);
|
||||
|
||||
return new MutatingWebhookConfigurationStore({
|
||||
context: di.inject(clusterFrameContextForNamespacedResourcesInjectable),
|
||||
logger: di.inject(loggerInjectable),
|
||||
}, api);
|
||||
},
|
||||
injectionToken: kubeObjectStoreInjectionToken,
|
||||
});
|
||||
|
||||
export default mutatingWebhookConfigurationStoreInjectable;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type {
|
||||
MutatingWebhookConfiguration,
|
||||
MutatingWebhookConfigurationApi,
|
||||
} from "../../../common/k8s-api/endpoints";
|
||||
import type {
|
||||
KubeObjectStoreDependencies,
|
||||
KubeObjectStoreOptions,
|
||||
} from "../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
|
||||
export interface MutatingWebhookConfigurationStoreDependencies extends KubeObjectStoreDependencies {
|
||||
}
|
||||
|
||||
export class MutatingWebhookConfigurationStore extends KubeObjectStore<MutatingWebhookConfiguration, MutatingWebhookConfigurationApi> {
|
||||
constructor(protected readonly dependencies: MutatingWebhookConfigurationStoreDependencies, api: MutatingWebhookConfigurationApi, opts?: KubeObjectStoreOptions) {
|
||||
super(dependencies, api, opts);
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import type { MutatingWebhookConfiguration } from "../../../common/k8s-api/endpoints";
|
||||
import { WebhookConfig } from "./webhook-config";
|
||||
|
||||
export interface MutatingWebhookDetailsProps extends KubeObjectDetailsProps<MutatingWebhookConfiguration> {
|
||||
}
|
||||
|
||||
@observer
|
||||
export class MutatingWebhookDetails extends React.Component<MutatingWebhookDetailsProps> {
|
||||
render() {
|
||||
const { object: webhookConfig } = this.props;
|
||||
|
||||
return (
|
||||
<div className="MutatingWebhookDetails">
|
||||
<DrawerItem name="API version">
|
||||
{webhookConfig.apiVersion}
|
||||
</DrawerItem>
|
||||
<DrawerTitle>Webhooks</DrawerTitle>
|
||||
{webhookConfig.getWebhooks()?.length == 0 && (
|
||||
<div style={{ opacity: 0.6 }}>No webhooks set</div>
|
||||
)}
|
||||
{webhookConfig.getWebhooks()?.map((webhook) => (
|
||||
<WebhookConfig webhook={webhook} key={webhook.name} />
|
||||
))}
|
||||
</div >
|
||||
);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
routeSpecificComponentInjectionToken,
|
||||
} from "../../routes/route-specific-component-injection-token";
|
||||
import mutatingWebhookConfigurationsRouteInjectable
|
||||
from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/mutating-webhook-configurations-route.injectable";
|
||||
import { MutatingWebhookConfigurations } from "./mutating-webhook-configurations";
|
||||
|
||||
const mutatingWebhookConfigurationsRouteComponentInjectable = getInjectable({
|
||||
id: "mutating-webhook-configuration-route-component",
|
||||
|
||||
instantiate: (di) => ({
|
||||
route: di.inject(mutatingWebhookConfigurationsRouteInjectable),
|
||||
Component: MutatingWebhookConfigurations,
|
||||
}),
|
||||
|
||||
injectionToken: routeSpecificComponentInjectionToken,
|
||||
});
|
||||
|
||||
export default mutatingWebhookConfigurationsRouteComponentInjectable;
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { sidebarItemsInjectionToken } from "../layout/sidebar-items.injectable";
|
||||
import routeIsActiveInjectable from "../../routes/route-is-active.injectable";
|
||||
import mutatingWebhookConfigurationsRouteInjectable
|
||||
from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/mutating-webhook-configurations-route.injectable";
|
||||
import navigateToMutatingWebhookConfigurationsInjectable
|
||||
from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/navigate-to-mutating-webhook-configurations.injectable";
|
||||
import { configSidebarItemId } from "../config/config-sidebar-items.injectable";
|
||||
|
||||
const mutatingWebhookConfigurationsSidebarItemsInjectable = getInjectable({
|
||||
id: "mutating-webhook-configurations-sidebar-items",
|
||||
|
||||
instantiate: (di) => {
|
||||
const route = di.inject(mutatingWebhookConfigurationsRouteInjectable);
|
||||
const navigateToPage = di.inject(navigateToMutatingWebhookConfigurationsInjectable);
|
||||
const routeIsActive = di.inject(routeIsActiveInjectable, route);
|
||||
|
||||
return computed(() => [
|
||||
{
|
||||
id: "mutating-webhook-configurations",
|
||||
parentId: configSidebarItemId,
|
||||
title: "Mutating Webhook Configs",
|
||||
onClick: navigateToPage,
|
||||
isActive: routeIsActive,
|
||||
isVisible: route.isEnabled,
|
||||
orderNumber: 100,
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
injectionToken: sidebarItemsInjectionToken,
|
||||
});
|
||||
|
||||
export default mutatingWebhookConfigurationsSidebarItemsInjectable;
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
import type { MutatingWebhookConfigurationStore } from "./mutating-webhook-configuration-store";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import mutatingWebhookConfigurationsStoreInjectable from "./mutating-webhook-configuration-store.injectable";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
webhooks = "webhooks",
|
||||
age = "age",
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
store: MutatingWebhookConfigurationStore;
|
||||
}
|
||||
|
||||
const NonInjectedMutatingWebhookConfigurations = observer((props: Dependencies) => {
|
||||
return (
|
||||
<SiblingsInTabLayout>
|
||||
<KubeObjectListLayout
|
||||
isConfigurable
|
||||
customizeHeader={({ searchProps, ...rest }) => ({
|
||||
...rest,
|
||||
searchProps: {
|
||||
...searchProps,
|
||||
placeholder: "Search...",
|
||||
},
|
||||
})}
|
||||
tableId="config_mutating_webhook_configurations"
|
||||
className={"MutatingWebhookConfigurations"}
|
||||
store={props.store}
|
||||
sortingCallbacks={{
|
||||
[columnId.name]: item => item.getName(),
|
||||
[columnId.webhooks]: item => item.getWebhooks().length,
|
||||
[columnId.age]: item => -item.getCreationTimestamp(),
|
||||
}}
|
||||
searchFilters={[
|
||||
item => item.getSearchFields(),
|
||||
item => item.getLabels(),
|
||||
]}
|
||||
renderHeaderTitle="Mutating Webhook Configs"
|
||||
renderTableHeader={[
|
||||
{ title: "Name", className: "name", sortBy: columnId.name, id: columnId.name },
|
||||
{
|
||||
title: "Webhooks",
|
||||
sortBy: columnId.webhooks,
|
||||
id: columnId.webhooks,
|
||||
},
|
||||
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
|
||||
]}
|
||||
renderTableContents={item => [
|
||||
item.getName(),
|
||||
item.getWebhooks().length,
|
||||
<KubeObjectAge key="age" object={item} />,
|
||||
]}
|
||||
/>
|
||||
</SiblingsInTabLayout>
|
||||
);
|
||||
});
|
||||
|
||||
export const MutatingWebhookConfigurations = withInjectables<Dependencies>(NonInjectedMutatingWebhookConfigurations, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
store: di.inject(mutatingWebhookConfigurationsStoreInjectable),
|
||||
}),
|
||||
});
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
.matchLabels {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.lastItem + .firstItem {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import React from "react";
|
||||
import styles from "./webhook-config.module.css";
|
||||
import type { MutatingWebhook, ValidatingWebhook } from "../../../common/k8s-api/endpoints";
|
||||
import { DrawerItem } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
|
||||
interface WebhookProps {
|
||||
webhook: ValidatingWebhook | MutatingWebhook;
|
||||
}
|
||||
|
||||
export const WebhookConfig: React.FC<WebhookProps> = ({ webhook }) => {
|
||||
return (
|
||||
<>
|
||||
<DrawerItem name="Name" className={styles.firstItem}>
|
||||
<strong>{webhook.name}</strong>
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Client Config">
|
||||
{webhook.clientConfig?.service?.name && (
|
||||
<div>
|
||||
<div>
|
||||
Name:
|
||||
{" "}
|
||||
{webhook.clientConfig.service.name}
|
||||
</div>
|
||||
<div>
|
||||
Namespace:
|
||||
{" "}
|
||||
{webhook.clientConfig.service.namespace}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Match Policy">
|
||||
{webhook.matchPolicy}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Failure Policy">
|
||||
{webhook.failurePolicy}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Admission Review Versions">
|
||||
{webhook.admissionReviewVersions?.join(", ")}
|
||||
</DrawerItem>
|
||||
{ webhook.reinvocationPolicy && (
|
||||
<DrawerItem name="Reinvocation Policy">
|
||||
{webhook.reinvocationPolicy}
|
||||
</DrawerItem>
|
||||
)}
|
||||
<DrawerItem name="Side Effects">
|
||||
{webhook.sideEffects}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Timeout Seconds">
|
||||
{webhook.timeoutSeconds}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Namespace Selector">
|
||||
{webhook.namespaceSelector && (
|
||||
<div>
|
||||
<div>Match Expressions:</div>
|
||||
{webhook.namespaceSelector.matchExpressions?.map((expression, index) => (
|
||||
<div key={index}>
|
||||
<div>
|
||||
Key:
|
||||
{" "}
|
||||
{expression.key}
|
||||
</div>
|
||||
<div>
|
||||
Operator:
|
||||
{" "}
|
||||
{expression.operator}
|
||||
</div>
|
||||
<div>
|
||||
Values:
|
||||
{" "}
|
||||
{expression.values?.join(", ")}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{webhook.namespaceSelector.matchLabels && (
|
||||
<div>
|
||||
<div>Match Labels:</div>
|
||||
<div className={styles.matchLabels}>
|
||||
{Object.entries(webhook.namespaceSelector.matchLabels).map(([key, value], index) => (
|
||||
<Badge label={`${key}=${value}`} key={index} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Object Selector">
|
||||
{webhook.objectSelector && (
|
||||
<div>
|
||||
<div>Match Expressions:</div>
|
||||
{webhook.objectSelector.matchExpressions?.map((expression, index) => (
|
||||
<div key={index}>
|
||||
<div>
|
||||
Key:
|
||||
{" "}
|
||||
{expression.key}
|
||||
</div>
|
||||
<div>
|
||||
Operator:
|
||||
{" "}
|
||||
{expression.operator}
|
||||
</div>
|
||||
<div>
|
||||
Values:
|
||||
{" "}
|
||||
{expression.values?.join(", ")}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{webhook.objectSelector.matchLabels && (
|
||||
<div>
|
||||
<div>Match Labels:</div>
|
||||
<div className={styles.matchLabels}>
|
||||
{Object.entries(webhook.objectSelector.matchLabels).map(([key, value], index) => (
|
||||
<Badge label={`${key}=${value}`} key={index} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</DrawerItem>
|
||||
<DrawerItem name="Rules" className={styles.lastItem}>
|
||||
{webhook.rules?.map((rule, index) => (
|
||||
<div key={index}>
|
||||
<div>
|
||||
API Groups:
|
||||
{" "}
|
||||
{rule.apiGroups.join(", ")}
|
||||
</div>
|
||||
<div>
|
||||
API Versions:
|
||||
{" "}
|
||||
{rule.apiVersions?.join(", ")}
|
||||
</div>
|
||||
<div>
|
||||
Operations:
|
||||
{" "}
|
||||
{rule.operations.join(", ")}
|
||||
</div>
|
||||
{rule.resources && (
|
||||
<div>
|
||||
Resources:
|
||||
{" "}
|
||||
{rule.resources.join(", ")}
|
||||
</div>
|
||||
)}
|
||||
{rule.scope && (
|
||||
<div>
|
||||
Scope:
|
||||
{" "}
|
||||
{rule.scope}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</DrawerItem>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user