mirror of https://github.com/certd/certd
fix: 修复远程数据选择无法过滤的bug
parent
79ebabfcfb
commit
6cbb0739f8
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue