From a54665f80b394cbdbcabfbf999efc63d6b4dcce6 Mon Sep 17 00:00:00 2001 From: Alexander Constantinescu Date: Tue, 20 Jul 2021 15:57:45 +0200 Subject: [PATCH] Run libovsdb modelgen on v21.06.0 OVN NB schema Signed-off-by: Alexander Constantinescu --- go-controller/Makefile | 2 +- go-controller/pkg/nbdb/acl.go | 23 +-- go-controller/pkg/nbdb/bfd.go | 28 ++++ go-controller/pkg/nbdb/load_balancer.go | 1 + .../pkg/nbdb/logical_router_policy.go | 1 + .../pkg/nbdb/logical_router_static_route.go | 1 + go-controller/pkg/nbdb/model.go | 123 +++++++++++++++- go-controller/pkg/sbdb/bfd.go | 30 ++++ go-controller/pkg/sbdb/fdb.go | 12 ++ go-controller/pkg/sbdb/load_balancer.go | 1 + go-controller/pkg/sbdb/model.go | 139 +++++++++++++++++- go-controller/pkg/sbdb/port_binding.go | 1 + 12 files changed, 346 insertions(+), 16 deletions(-) create mode 100644 go-controller/pkg/nbdb/bfd.go create mode 100644 go-controller/pkg/sbdb/bfd.go create mode 100644 go-controller/pkg/sbdb/fdb.go diff --git a/go-controller/Makefile b/go-controller/Makefile index 8b92735446a..06cc95088ff 100644 --- a/go-controller/Makefile +++ b/go-controller/Makefile @@ -20,7 +20,7 @@ else CONTAINER_RUNTIME=docker endif CONTAINER_RUNNABLE ?= $(shell $(CONTAINER_RUNTIME) -v > /dev/null 2>&1; echo $$?) -OVN_VERSION ?= v20.12.0 +OVN_VERSION ?= v21.06.0 .PHONY: all build check test diff --git a/go-controller/pkg/nbdb/acl.go b/go-controller/pkg/nbdb/acl.go index 048a49c260d..0ced7e5e59d 100644 --- a/go-controller/pkg/nbdb/acl.go +++ b/go-controller/pkg/nbdb/acl.go @@ -10,17 +10,18 @@ type ( ) const ( - ACLActionAllow ACLAction = "allow" - ACLActionAllowRelated ACLAction = "allow-related" - ACLActionDrop ACLAction = "drop" - ACLActionReject ACLAction = "reject" - ACLDirectionFromLport ACLDirection = "from-lport" - ACLDirectionToLport ACLDirection = "to-lport" - ACLSeverityAlert ACLSeverity = "alert" - ACLSeverityWarning ACLSeverity = "warning" - ACLSeverityNotice ACLSeverity = "notice" - ACLSeverityInfo ACLSeverity = "info" - ACLSeverityDebug ACLSeverity = "debug" + ACLActionAllow ACLAction = "allow" + ACLActionAllowRelated ACLAction = "allow-related" + ACLActionAllowStateless ACLAction = "allow-stateless" + ACLActionDrop ACLAction = "drop" + ACLActionReject ACLAction = "reject" + ACLDirectionFromLport ACLDirection = "from-lport" + ACLDirectionToLport ACLDirection = "to-lport" + ACLSeverityAlert ACLSeverity = "alert" + ACLSeverityWarning ACLSeverity = "warning" + ACLSeverityNotice ACLSeverity = "notice" + ACLSeverityInfo ACLSeverity = "info" + ACLSeverityDebug ACLSeverity = "debug" ) // ACL defines an object in ACL table diff --git a/go-controller/pkg/nbdb/bfd.go b/go-controller/pkg/nbdb/bfd.go new file mode 100644 index 00000000000..b22975f9b60 --- /dev/null +++ b/go-controller/pkg/nbdb/bfd.go @@ -0,0 +1,28 @@ +// Code generated by "libovsdb.modelgen" +// DO NOT EDIT. + +package nbdb + +type ( + BFDStatus = string +) + +const ( + BFDStatusDown BFDStatus = "down" + BFDStatusInit BFDStatus = "init" + BFDStatusUp BFDStatus = "up" + BFDStatusAdminDown BFDStatus = "admin_down" +) + +// BFD defines an object in BFD table +type BFD struct { + UUID string `ovsdb:"_uuid"` + DetectMult []int `ovsdb:"detect_mult"` + DstIP string `ovsdb:"dst_ip"` + ExternalIDs map[string]string `ovsdb:"external_ids"` + LogicalPort string `ovsdb:"logical_port"` + MinRx []int `ovsdb:"min_rx"` + MinTx []int `ovsdb:"min_tx"` + Options map[string]string `ovsdb:"options"` + Status []BFDStatus `ovsdb:"status"` +} diff --git a/go-controller/pkg/nbdb/load_balancer.go b/go-controller/pkg/nbdb/load_balancer.go index 4aee612c49d..78e6bb05e5f 100644 --- a/go-controller/pkg/nbdb/load_balancer.go +++ b/go-controller/pkg/nbdb/load_balancer.go @@ -27,6 +27,7 @@ type LoadBalancer struct { HealthCheck []string `ovsdb:"health_check"` IPPortMappings map[string]string `ovsdb:"ip_port_mappings"` Name string `ovsdb:"name"` + Options map[string]string `ovsdb:"options"` Protocol []LoadBalancerProtocol `ovsdb:"protocol"` SelectionFields []LoadBalancerSelectionFields `ovsdb:"selection_fields"` Vips map[string]string `ovsdb:"vips"` diff --git a/go-controller/pkg/nbdb/logical_router_policy.go b/go-controller/pkg/nbdb/logical_router_policy.go index af7346a14e2..3c8ac5d78a1 100644 --- a/go-controller/pkg/nbdb/logical_router_policy.go +++ b/go-controller/pkg/nbdb/logical_router_policy.go @@ -20,6 +20,7 @@ type LogicalRouterPolicy struct { ExternalIDs map[string]string `ovsdb:"external_ids"` Match string `ovsdb:"match"` Nexthop []string `ovsdb:"nexthop"` + Nexthops []string `ovsdb:"nexthops"` Options map[string]string `ovsdb:"options"` Priority int `ovsdb:"priority"` } diff --git a/go-controller/pkg/nbdb/logical_router_static_route.go b/go-controller/pkg/nbdb/logical_router_static_route.go index 59c278f9e0d..9eb449ef1e7 100644 --- a/go-controller/pkg/nbdb/logical_router_static_route.go +++ b/go-controller/pkg/nbdb/logical_router_static_route.go @@ -15,6 +15,7 @@ const ( // LogicalRouterStaticRoute defines an object in Logical_Router_Static_Route table type LogicalRouterStaticRoute struct { UUID string `ovsdb:"_uuid"` + BFD []string `ovsdb:"bfd"` ExternalIDs map[string]string `ovsdb:"external_ids"` IPPrefix string `ovsdb:"ip_prefix"` Nexthop string `ovsdb:"nexthop"` diff --git a/go-controller/pkg/nbdb/model.go b/go-controller/pkg/nbdb/model.go index f126b4db8e7..798164e3397 100644 --- a/go-controller/pkg/nbdb/model.go +++ b/go-controller/pkg/nbdb/model.go @@ -15,6 +15,7 @@ func FullDatabaseModel() (*model.DBModel, error) { return model.NewDBModel("OVN_Northbound", map[string]model.Model{ "ACL": &ACL{}, "Address_Set": &AddressSet{}, + "BFD": &BFD{}, "Connection": &Connection{}, "DHCP_Options": &DHCPOptions{}, "DNS": &DNS{}, @@ -42,7 +43,7 @@ func FullDatabaseModel() (*model.DBModel, error) { var schema = `{ "name": "OVN_Northbound", - "version": "5.28.0", + "version": "5.32.0", "tables": { "ACL": { "columns": { @@ -55,6 +56,7 @@ var schema = `{ [ "allow", "allow-related", + "allow-stateless", "drop", "reject" ] @@ -177,6 +179,93 @@ var schema = `{ ] ] }, + "BFD": { + "columns": { + "detect_mult": { + "type": { + "key": { + "type": "integer", + "minInteger": 1 + }, + "min": 0, + "max": 1 + } + }, + "dst_ip": { + "type": "string" + }, + "external_ids": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, + "logical_port": { + "type": "string" + }, + "min_rx": { + "type": { + "key": { + "type": "integer" + }, + "min": 0, + "max": 1 + } + }, + "min_tx": { + "type": { + "key": { + "type": "integer", + "minInteger": 1 + }, + "min": 0, + "max": 1 + } + }, + "options": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, + "status": { + "type": { + "key": { + "type": "string", + "enum": [ + "set", + [ + "down", + "init", + "up", + "admin_down" + ] + ] + }, + "min": 0, + "max": 1 + } + } + }, + "indexes": [ + [ + "logical_port", + "dst_ip" + ] + ] + }, "Connection": { "columns": { "external_ids": { @@ -496,6 +585,18 @@ var schema = `{ "name": { "type": "string" }, + "options": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, "protocol": { "type": { "key": { @@ -714,6 +815,15 @@ var schema = `{ "max": 1 } }, + "nexthops": { + "type": { + "key": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, "options": { "type": { "key": { @@ -848,6 +958,17 @@ var schema = `{ }, "Logical_Router_Static_Route": { "columns": { + "bfd": { + "type": { + "key": { + "type": "uuid", + "refTable": "BFD", + "refType": "weak" + }, + "min": 0, + "max": 1 + } + }, "external_ids": { "type": { "key": { diff --git a/go-controller/pkg/sbdb/bfd.go b/go-controller/pkg/sbdb/bfd.go new file mode 100644 index 00000000000..4da3424b5c1 --- /dev/null +++ b/go-controller/pkg/sbdb/bfd.go @@ -0,0 +1,30 @@ +// Code generated by "libovsdb.modelgen" +// DO NOT EDIT. + +package sbdb + +type ( + BFDStatus = string +) + +const ( + BFDStatusDown BFDStatus = "down" + BFDStatusInit BFDStatus = "init" + BFDStatusUp BFDStatus = "up" + BFDStatusAdminDown BFDStatus = "admin_down" +) + +// BFD defines an object in BFD table +type BFD struct { + UUID string `ovsdb:"_uuid"` + DetectMult int `ovsdb:"detect_mult"` + Disc int `ovsdb:"disc"` + DstIP string `ovsdb:"dst_ip"` + ExternalIDs map[string]string `ovsdb:"external_ids"` + LogicalPort string `ovsdb:"logical_port"` + MinRx int `ovsdb:"min_rx"` + MinTx int `ovsdb:"min_tx"` + Options map[string]string `ovsdb:"options"` + SrcPort int `ovsdb:"src_port"` + Status BFDStatus `ovsdb:"status"` +} diff --git a/go-controller/pkg/sbdb/fdb.go b/go-controller/pkg/sbdb/fdb.go new file mode 100644 index 00000000000..f52f43f50ce --- /dev/null +++ b/go-controller/pkg/sbdb/fdb.go @@ -0,0 +1,12 @@ +// Code generated by "libovsdb.modelgen" +// DO NOT EDIT. + +package sbdb + +// FDB defines an object in FDB table +type FDB struct { + UUID string `ovsdb:"_uuid"` + DpKey int `ovsdb:"dp_key"` + MAC string `ovsdb:"mac"` + PortKey int `ovsdb:"port_key"` +} diff --git a/go-controller/pkg/sbdb/load_balancer.go b/go-controller/pkg/sbdb/load_balancer.go index 0498ea8b4f3..469e7e89195 100644 --- a/go-controller/pkg/sbdb/load_balancer.go +++ b/go-controller/pkg/sbdb/load_balancer.go @@ -19,6 +19,7 @@ type LoadBalancer struct { Datapaths []string `ovsdb:"datapaths"` ExternalIDs map[string]string `ovsdb:"external_ids"` Name string `ovsdb:"name"` + Options map[string]string `ovsdb:"options"` Protocol []LoadBalancerProtocol `ovsdb:"protocol"` Vips map[string]string `ovsdb:"vips"` } diff --git a/go-controller/pkg/sbdb/model.go b/go-controller/pkg/sbdb/model.go index 2be79917009..36ad6285798 100644 --- a/go-controller/pkg/sbdb/model.go +++ b/go-controller/pkg/sbdb/model.go @@ -14,6 +14,7 @@ import ( func FullDatabaseModel() (*model.DBModel, error) { return model.NewDBModel("OVN_Southbound", map[string]model.Model{ "Address_Set": &AddressSet{}, + "BFD": &BFD{}, "Chassis": &Chassis{}, "Chassis_Private": &ChassisPrivate{}, "Connection": &Connection{}, @@ -23,6 +24,7 @@ func FullDatabaseModel() (*model.DBModel, error) { "DNS": &DNS{}, "Datapath_Binding": &DatapathBinding{}, "Encap": &Encap{}, + "FDB": &FDB{}, "Gateway_Chassis": &GatewayChassis{}, "HA_Chassis": &HAChassis{}, "HA_Chassis_Group": &HAChassisGroup{}, @@ -47,7 +49,7 @@ func FullDatabaseModel() (*model.DBModel, error) { var schema = `{ "name": "OVN_Southbound", - "version": "20.12.0", + "version": "20.17.0", "tables": { "Address_Set": { "columns": { @@ -70,6 +72,85 @@ var schema = `{ ] ] }, + "BFD": { + "columns": { + "detect_mult": { + "type": "integer" + }, + "disc": { + "type": "integer" + }, + "dst_ip": { + "type": "string" + }, + "external_ids": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, + "logical_port": { + "type": "string" + }, + "min_rx": { + "type": "integer" + }, + "min_tx": { + "type": "integer" + }, + "options": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, + "src_port": { + "type": { + "key": { + "type": "integer", + "minInteger": 49152, + "maxInteger": 65535 + } + } + }, + "status": { + "type": { + "key": { + "type": "string", + "enum": [ + "set", + [ + "down", + "init", + "up", + "admin_down" + ] + ] + } + } + } + }, + "indexes": [ + [ + "logical_port", + "dst_ip", + "src_port", + "disc" + ] + ] + }, "Chassis": { "columns": { "encaps": { @@ -487,6 +568,37 @@ var schema = `{ ] ] }, + "FDB": { + "columns": { + "dp_key": { + "type": { + "key": { + "type": "integer", + "minInteger": 1, + "maxInteger": 16777215 + } + } + }, + "mac": { + "type": "string" + }, + "port_key": { + "type": { + "key": { + "type": "integer", + "minInteger": 1, + "maxInteger": 16777215 + } + } + } + }, + "indexes": [ + [ + "mac", + "dp_key" + ] + ] + }, "Gateway_Chassis": { "columns": { "chassis": { @@ -783,6 +895,18 @@ var schema = `{ "name": { "type": "string" }, + "options": { + "type": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + }, + "min": 0, + "max": "unlimited" + } + }, "protocol": { "type": { "key": { @@ -897,7 +1021,7 @@ var schema = `{ "key": { "type": "integer", "minInteger": 0, - "maxInteger": 23 + "maxInteger": 32 } } } @@ -1017,7 +1141,7 @@ var schema = `{ "refTable": "Port_Binding", "refType": "weak" }, - "min": 1, + "min": 0, "max": "unlimited" } }, @@ -1173,6 +1297,15 @@ var schema = `{ "type": { "type": "string" }, + "up": { + "type": { + "key": { + "type": "boolean" + }, + "min": 0, + "max": 1 + } + }, "virtual_parent": { "type": { "key": { diff --git a/go-controller/pkg/sbdb/port_binding.go b/go-controller/pkg/sbdb/port_binding.go index 70c05729d1d..889894499e6 100644 --- a/go-controller/pkg/sbdb/port_binding.go +++ b/go-controller/pkg/sbdb/port_binding.go @@ -20,5 +20,6 @@ type PortBinding struct { Tag []int `ovsdb:"tag"` TunnelKey int `ovsdb:"tunnel_key"` Type string `ovsdb:"type"` + Up []bool `ovsdb:"up"` VirtualParent []string `ovsdb:"virtual_parent"` }