From 63fecd4f6a36d09f0a3493eeffebac813476c500 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Tue, 5 Sep 2023 11:03:38 +0800 Subject: [PATCH] chore: slice loop replace Signed-off-by: guoguangwu --- cmd/yurt-tunnel-server/app/options/options.go | 4 +--- pkg/yurtmanager/controller/yurtappset/adapter/adapter_util.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/yurt-tunnel-server/app/options/options.go b/cmd/yurt-tunnel-server/app/options/options.go index 1833b576770..32b045a7471 100644 --- a/cmd/yurt-tunnel-server/app/options/options.go +++ b/cmd/yurt-tunnel-server/app/options/options.go @@ -127,9 +127,7 @@ func (o *ServerOptions) Config() (*config.Config, error) { } if o.CertDNSNames != "" { - for _, name := range strings.Split(o.CertDNSNames, ",") { - cfg.CertDNSNames = append(cfg.CertDNSNames, name) - } + cfg.CertDNSNames = append(cfg.CertDNSNames, strings.Split(o.CertDNSNames, ",")...) } if o.CertIPs != "" { diff --git a/pkg/yurtmanager/controller/yurtappset/adapter/adapter_util.go b/pkg/yurtmanager/controller/yurtappset/adapter/adapter_util.go index 5b51077965f..e62094596c4 100644 --- a/pkg/yurtmanager/controller/yurtappset/adapter/adapter_util.go +++ b/pkg/yurtmanager/controller/yurtappset/adapter/adapter_util.go @@ -84,9 +84,7 @@ func attachTolerations(podSpec *corev1.PodSpec, poolConfig *appsv1alpha1.Pool) { podSpec.Tolerations = []corev1.Toleration{} } - for _, toleration := range poolConfig.Tolerations { - podSpec.Tolerations = append(podSpec.Tolerations, toleration) - } + podSpec.Tolerations = append(podSpec.Tolerations, poolConfig.Tolerations...) return }