forked from submariner-io/submariner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move core-infra functionality and use libovsdb
Rename the files which contain the core submariner/ovn functionality bits. Convert all the ovsdb clients from go-ovn to ovsdb. Re-organize some submariner files to align more closely with OVN Semantics. Convert all calls reguarding OVN logical_router_static_routes to use libovsdb rather than go-ovn. Convert all logical_router_policy calls to libovsdb. convert all OVN sbdb chassis related calls to use libovsdb. Update how clusterSet service avaliability works in the networkplugin-syncer code. Speciafically it ensures we add the a new OVN object (OVN cluster loadbalancer_group) to the submariner router. This group has all the VIPs for the cluster in question. Update vendoring since ovn-k requires k8s 1.23 Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
- Loading branch information
Showing
16 changed files
with
791 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 0 additions & 167 deletions
167
pkg/networkplugin-syncer/handlers/ovn/infrastructure.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
SPDX-License-Identifier: Apache-2.0 | ||
Copyright Contributors to the Submariner project. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package ovn | ||
|
||
import ( | ||
"strings" | ||
|
||
libovsdbclient "github.com/ovn-org/libovsdb/client" | ||
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/libovsdbops" | ||
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/sbdb" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func (ovn *SyncHandler) findChassisByHostname(hostname string) (*sbdb.Chassis, error) { | ||
chassisList, err := libovsdbops.ListChassis(ovn.sbdb) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "unable to get chassis list from OVN") | ||
} | ||
// Attempt matching by the exact hostname. | ||
for i := range chassisList { | ||
if chassisList[i].Hostname == hostname { | ||
return chassisList[i], nil | ||
} | ||
} | ||
|
||
// In a second round try to match expecting a higher level domain after the hostname. | ||
for i := range chassisList { | ||
if strings.HasPrefix(chassisList[i].Hostname, hostname+".") || | ||
strings.HasPrefix(hostname, chassisList[i].Hostname+".") { | ||
return chassisList[i], nil | ||
} | ||
} | ||
|
||
return nil, libovsdbclient.ErrNotFound | ||
} |
Oops, something went wrong.