Skip to content

Commit eff0e16

Browse files
committed
Integrate gstate with resource-allocator interface
- Also did some cleanup around leftover (dead)code in netd.go which for handling gstate events inside netplugin. - One big change around resource specification is that the checks have become strict. Example, a vxlan-range is not allowed to be configured if the vnid range exceeds 4k vlans (needed for vxlan functionality). On similar lines the default for an empty vlan range (specified in tenant config) now results in not creating a vlan resoure at all (unlike reserving 1-4095 vlan tags earlier.) This change allows failing earlier than later. It also requires a more explicit configuration (for vlan and vxlan ranges) than assuming pre-configured defaults.
1 parent 9666414 commit eff0e16

21 files changed

+511
-595
lines changed

core/core.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ type Resource interface {
126126

127127
type ResourceAllocator interface {
128128
// A resource allocator provides mechanism to manage (define/undefine,
129-
// allocate/deallocate) resources, in logically centralized manner, in
130-
// a distributed system
129+
// allocate/deallocate) resources. Example, it may provide management in
130+
// logically centralized manner in a distributed system
131131
Init() error
132132
Deinit()
133133
DefineResource(id, desc string, rsrcCfg interface{}) error

examples/late_bindings/multiple_vxlan_nets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"DefaultNetType" : "vxlan",
1414
"SubnetPool" : "11.1.0.0/16",
1515
"AllocSubnetLen" : 24,
16-
"Vxlans" : "10001-20000",
16+
"Vxlans" : "10001-14000",
1717
"Networks" : [ {
1818
"Name" : "orange",
1919
"Endpoints" : [ {

examples/multiple_eps_in_container.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"DefaultNetType" : "vxlan",
1414
"SubnetPool" : "11.1.0.0/16",
1515
"AllocSubnetLen" : 24,
16-
"Vxlans" : "10001-20000",
16+
"Vxlans" : "10001-14000",
1717
"Networks" : [
1818
{
1919
"Name" : "orange",

examples/two_host_vxlan.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"DefaultNetType" : "vxlan",
1414
"SubnetPool" : "11.1.0.0/16",
1515
"AllocSubnetLen" : 24,
16-
"Vxlans" : "10001-20000",
16+
"Vxlans" : "10001-14000",
1717
"Networks" : [
1818
{
1919
"Name" : "orange",

examples/two_hosts_multiple_tenants.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"DefaultNetType" : "vxlan",
1414
"SubnetPool" : "11.1.0.0/16",
1515
"AllocSubnetLen" : 24,
16-
"Vxlans" : "10001-20000",
16+
"Vxlans" : "10001-12000",
1717
"Networks" : [ {
1818
"Name" : "orange",
1919
"Endpoints" : [
@@ -32,7 +32,7 @@
3232
"DefaultNetType" : "vxlan",
3333
"SubnetPool" : "11.1.0.0/16",
3434
"AllocSubnetLen" : 24,
35-
"Vxlans" : "10001-20000",
35+
"Vxlans" : "15001-17000",
3636
"Networks" : [ {
3737
"Name" : "purple",
3838
"Endpoints" : [

examples/two_hosts_multiple_tenants_mix_vlan_vxlan.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"DefaultNetType" : "vxlan",
3434
"SubnetPool" : "11.1.0.0/16",
3535
"AllocSubnetLen" : 24,
36-
"Vxlans" : "10001-20000",
36+
"Vxlans" : "10001-14000",
3737
"Networks" : [{
3838
"Name" : "purple",
3939
"Endpoints" : [{

examples/two_hosts_multiple_vxlan_nets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"DefaultNetType" : "vxlan",
1414
"SubnetPool" : "11.1.0.0/16",
1515
"AllocSubnetLen" : 24,
16-
"Vxlans" : "10001-20000",
16+
"Vxlans" : "10001-14000",
1717
"Networks" : [ {
1818
"Name" : "orange",
1919
"Endpoints" : [

0 commit comments

Comments
 (0)