Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix repeate set chassis #3083

Merged
merged 4 commits into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
@@ -782,6 +782,10 @@ func (c *Controller) Run(ctx context.Context) {
util.LogFatalAndExit(err, "failed to initialize ovn resources")
}

if err := c.initNodeChassis(); err != nil {
util.LogFatalAndExit(err, "failed to initialize node chassis")
}

// sync ip crd before initIPAM since ip crd will be used to restore vm and statefulset pod in initIPAM
if err := c.initSyncCrdIPs(); err != nil {
util.LogFatalAndExit(err, "failed to sync crd ips")
@@ -791,10 +795,6 @@ func (c *Controller) Run(ctx context.Context) {
util.LogFatalAndExit(err, "failed to initialize ipam")
}

if err := c.initNodeChassis(); err != nil {
util.LogFatalAndExit(err, "failed to initialize node chassis")
}

if err := c.initNodeRoutes(); err != nil {
util.LogFatalAndExit(err, "failed to initialize node routes")
}
8 changes: 8 additions & 0 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
@@ -853,6 +853,14 @@ func (c *Controller) initNodeChassis() error {
for _, node := range nodes {
chassisName := node.Annotations[util.ChassisAnnotation]
if chassisName != "" {
existChasisId, err := c.ovnLegacyClient.GetChassis(node.Name)
if err != nil {
klog.Errorf("failed to get chassis id: %v", err)
return err
}
if existChasisId == chassisName {
continue
}
exist, err := c.ovnLegacyClient.ChassisExist(chassisName)
if err != nil {
klog.Errorf("failed to check chassis exist: %v", err)
2 changes: 1 addition & 1 deletion pkg/speaker/subnet.go
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ func (c *Controller) syncSubnetRoutes() {
}
}

klog.V(5).Infof("expected announce ipv4 routes %v\n,ipv6 route %v", bgpExpected[kubeovnv1.ProtocolIPv4], bgpExpected[kubeovnv1.ProtocolIPv6])
klog.V(5).Infof("expected announce ipv4 routes: %v, ipv6 routes: %v", bgpExpected[kubeovnv1.ProtocolIPv4], bgpExpected[kubeovnv1.ProtocolIPv6])

fn := func(d *bgpapi.Destination) {
for _, path := range d.Paths {