From 66252f068d9dc5cd7e152749b81405a269c03259 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Thu, 6 Apr 2023 16:05:22 +0300 Subject: [PATCH] Add more fields to details panel Signed-off-by: Alex Andreev --- .../mutating-webhook-configuration.api.ts | 4 ++ ...utating-webhook-configurations-details.tsx | 40 ++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/packages/core/src/common/k8s-api/endpoints/mutating-webhook-configuration.api.ts b/packages/core/src/common/k8s-api/endpoints/mutating-webhook-configuration.api.ts index a021e9b8aa..6434a31cc0 100644 --- a/packages/core/src/common/k8s-api/endpoints/mutating-webhook-configuration.api.ts +++ b/packages/core/src/common/k8s-api/endpoints/mutating-webhook-configuration.api.ts @@ -155,6 +155,10 @@ interface MutatingWebhook { // needs to run. This should be false when the webhook only applies to resources that have // the sideEffects field set to None. Defaults to true. sideEffects?: string; + + // reinvocationPolicy indicates whether this webhook should be called multiple times as part of a + // single admission evaluation. Allowed values are "Never" and "IfNeeded" + reinvocationPolicy?: "Never" | "IfNeeded"; } interface ServiceReference { diff --git a/packages/core/src/renderer/components/+config-mutating-webhook-configurations/mutating-webhook-configurations-details.tsx b/packages/core/src/renderer/components/+config-mutating-webhook-configurations/mutating-webhook-configurations-details.tsx index 8ec1511405..0d251eb169 100644 --- a/packages/core/src/renderer/components/+config-mutating-webhook-configurations/mutating-webhook-configurations-details.tsx +++ b/packages/core/src/renderer/components/+config-mutating-webhook-configurations/mutating-webhook-configurations-details.tsx @@ -22,8 +22,46 @@ export class MutatingWebhookDetails extends React.Component {webhookConfig.apiVersion} - Webhooks + {webhookConfig.getWebhooks()?.map((webhook) => ( + + + {webhook.name} + + + {webhook.clientConfig?.service?.name && ( +
+
+ Name: + {webhook.clientConfig.service.name} +
+
+ Namespace: + {webhook.clientConfig.service.namespace} +
+
+ )} +
+ + {webhook.matchPolicy} + + + {webhook.failurePolicy} + + + {webhook.admissionReviewVersions?.join(", ")} + + + {webhook.reinvocationPolicy} + + + {webhook.sideEffects} + + + {webhook.timeoutSeconds} + +
+ ))} ); }