From 6cbb0739f8428d51b0712f718fe4d236cc087cf9 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 5 Sep 2025 22:19:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=89=E6=8B=A9=E6=97=A0=E6=B3=95=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/libs/lib-k8s/src/lib/k8s.client.ts | 6 +++--- .../src/components/plugins/common/remote-select.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/libs/lib-k8s/src/lib/k8s.client.ts b/packages/libs/lib-k8s/src/lib/k8s.client.ts index 0af5ebc5..5a980bf7 100644 --- a/packages/libs/lib-k8s/src/lib/k8s.client.ts +++ b/packages/libs/lib-k8s/src/lib/k8s.client.ts @@ -1,7 +1,7 @@ import { CoreV1Api, KubeConfig, NetworkingV1Api, V1Ingress, V1Secret } from "@kubernetes/client-node"; import dns from "dns"; import { ILogger } from "@certd/basic"; -import _ from "lodash-es"; +import { merge } from "lodash-es"; export type K8sClientOpts = { kubeConfigStr: string; @@ -133,7 +133,7 @@ export class K8sClient { throw e; } - const newSecret = _.merge(oldSecret.body, opts.body); + const newSecret = merge(oldSecret.body, opts.body); const res = await this.client.replaceNamespacedSecret(secretName, namespace, newSecret); this.logger.info(`secret ${secretName} 已更新`); return res.body; @@ -167,7 +167,7 @@ export class K8sClient { this.logger.info("patch ingress:", ingressName, namespace); const client = this.kubeconfig.makeApiClient(NetworkingV1Api); const oldIngress = await client.readNamespacedIngress(ingressName, namespace); - const newIngress = _.merge(oldIngress.body, opts.body); + const newIngress = merge(oldIngress.body, opts.body); const res = await client.replaceNamespacedIngress(ingressName, namespace, newIngress); this.logger.info("ingress patched", opts.body); return res; diff --git a/packages/ui/certd-client/src/components/plugins/common/remote-select.vue b/packages/ui/certd-client/src/components/plugins/common/remote-select.vue index 7e1e9da0..b2b40d89 100644 --- a/packages/ui/certd-client/src/components/plugins/common/remote-select.vue +++ b/packages/ui/certd-client/src/components/plugins/common/remote-select.vue @@ -169,7 +169,7 @@ const getOptions = async () => { }; const filterOption = (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 || String(option.value).toLowerCase().indexOf(input.toLowerCase()); + return option.label.toLowerCase().includes(input.toLowerCase()) || String(option.value).toLowerCase().includes(input.toLowerCase()); }; async function onClick() {