Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
zbb88888 committed Jan 24, 2024
1 parent 34887da commit 9bc4193
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ func (c *Controller) Run(ctx context.Context) {
}

// sync ip crd before initIPAM since ip crd will be used to restore vm and statefulset pod in initIPAM
if err := c.initSyncIPsCR(); err != nil {
if err := c.syncIPCR(); err != nil {
util.LogFatalAndExit(err, "failed to sync crd ips")
}

Expand All @@ -806,10 +806,10 @@ func (c *Controller) Run(ctx context.Context) {
util.LogFatalAndExit(err, "failed to initialize node routes")
}

if err := c.initSyncCrdSubnets(); err != nil {
if err := c.syncSubnetCR(); err != nil {
util.LogFatalAndExit(err, "failed to sync crd subnets")
}
if err := c.initSyncCrdVlans(); err != nil {
if err := c.syncVlanCR(); err != nil {
util.LogFatalAndExit(err, "failed to sync crd vlans")
}

Expand Down Expand Up @@ -1171,7 +1171,7 @@ func (c *Controller) initResourceOnce() {
}

if c.config.PodDefaultFipType == util.IptablesFip {
if err := c.initSyncCrdVpcNatGw(); err != nil {
if err := c.syncVpcNatGatewayCR(); err != nil {
util.LogFatalAndExit(err, "failed to sync crd vpc nat gateways")
}
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ func (c *Controller) initDefaultVlan() error {
return nil
}

func (c *Controller) initSyncIPsCR() error {
func (c *Controller) syncIPCR() error {
klog.Info("start to sync ips")
ips, err := c.ipsLister.List(labels.Everything())
if err != nil {
Expand All @@ -587,9 +587,9 @@ func (c *Controller) initSyncIPsCR() error {
if ip.Spec.V4IPAddress == v4IP && ip.Spec.V6IPAddress == v6IP && !changed {
continue
}

ip.Spec.V4IPAddress = v4IP
ip.Spec.V6IPAddress = v6IP

_, err := c.config.KubeOvnClient.KubeovnV1().IPs().Update(context.Background(), ip, metav1.UpdateOptions{})
if err != nil {
klog.Errorf("failed to sync crd ip %s: %v", ip.Spec.IPAddress, err)
Expand All @@ -599,7 +599,7 @@ func (c *Controller) initSyncIPsCR() error {
return nil
}

func (c *Controller) initSyncCrdSubnets() error {
func (c *Controller) syncSubnetCR() error {
klog.Info("start to sync subnets")
subnets, err := c.subnetsLister.List(labels.Everything())
if err != nil {
Expand Down Expand Up @@ -639,7 +639,7 @@ func (c *Controller) initSyncCrdSubnets() error {
return nil
}

func (c *Controller) initSyncCrdVpcNatGw() error {
func (c *Controller) syncVpcNatGatewayCR() error {
klog.Info("start to sync crd vpc nat gw")
// get vpc nat gateway enable state
cm, err := c.configMapsLister.ConfigMaps(c.config.PodNamespace).Get(util.VpcNatGatewayConfig)
Expand Down Expand Up @@ -681,7 +681,7 @@ func (c *Controller) initSyncCrdVpcNatGw() error {
return nil
}

func (c *Controller) initSyncCrdVlans() error {
func (c *Controller) syncVlanCR() error {
klog.Info("start to sync vlans")
vlans, err := c.vlansLister.List(labels.Everything())
if err != nil {
Expand Down

0 comments on commit 9bc4193

Please sign in to comment.