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 }