Skip to content

Commit fdc1d68

Browse files
authored
fix vpc-dns annotations update revision (#5655)
Signed-off-by: xieyanker <xjsisnice@gmail.com>
1 parent 04c9bd6 commit fdc1d68

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkg/controller/vpc_dns.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9-
"maps"
109
"os"
1110
"reflect"
1211
"strconv"
@@ -221,7 +220,7 @@ func (c *Controller) createOrUpdateVpcDNSDep(vpcDNS *kubeovnv1.VpcDns) error {
221220
deploy = nil
222221
}
223222

224-
newDp, err := c.genVpcDNSDeployment(vpcDNS, deploy)
223+
newDp, err := c.genVpcDNSDeployment(vpcDNS)
225224
if err != nil {
226225
klog.Errorf("failed to generate vpc-dns deployment, %v", err)
227226
return err
@@ -288,7 +287,7 @@ func (c *Controller) createOrUpdateVpcDNSSlr(vpcDNS *kubeovnv1.VpcDns) error {
288287
return nil
289288
}
290289

291-
func (c *Controller) genVpcDNSDeployment(vpcDNS *kubeovnv1.VpcDns, oldDeploy *v1.Deployment) (*v1.Deployment, error) {
290+
func (c *Controller) genVpcDNSDeployment(vpcDNS *kubeovnv1.VpcDns) (*v1.Deployment, error) {
292291
tmp := template.New("coredns")
293292
tmp, err := tmp.Parse(corednsTemplateContent)
294293
if err != nil {
@@ -319,10 +318,6 @@ func (c *Controller) genVpcDNSDeployment(vpcDNS *kubeovnv1.VpcDns, oldDeploy *v1
319318

320319
dep.Spec.Template.Annotations = make(map[string]string)
321320

322-
if oldDeploy != nil && len(oldDeploy.Annotations) != 0 {
323-
dep.Spec.Template.Annotations = maps.Clone(oldDeploy.Annotations)
324-
}
325-
326321
dep.Labels = map[string]string{
327322
util.VpcDNSNameLabel: "true",
328323
}

0 commit comments

Comments
 (0)