-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support two types of network. #55
Conversation
src/entity/network.go
Outdated
NodeName string `bson:"nodeName,omitempty" json:"nodeName,omitempty"` | ||
CreatedAt *time.Time `bson:"createdAt,omitempty" json:"createdAt,omitempty"` | ||
OVS OVSNetwork `bson:"ovs,omitempty" json:"ovs"` | ||
Fake FakeNetwork `bson:"fake,omitempty" json:"fake"` //FakeNetwork, for restful testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a BSON tag for field Fake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, 3Q
BridgeName: tName, | ||
PhysicalPorts: []entity.PhysicalPort{}, | ||
}, | ||
Type: "ovs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better use type definition for Network.Type
in case of typos and invalid values.
type NetworkType string
var OVSNetwork = NetworkType("ovs")
...
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good, I will modify that.
|
||
const ( | ||
OVSNetworkType NetworkType = "ovs" | ||
FakeNetworkType NetworkType = "fake" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, that's great
Codecov Report
@@ Coverage Diff @@
## develop #55 +/- ##
==========================================
- Coverage 80.91% 80.4% -0.52%
==========================================
Files 20 20
Lines 566 592 +26
==========================================
+ Hits 458 476 +18
- Misses 81 85 +4
- Partials 27 31 +4
Continue to review full report at Codecov.
|
Support two types of network. Former-commit-id: 5d65bdb1f51bd2d67260b67bd81bd302d0c6e210 [formerly 002ce61] Former-commit-id: ba8e482cafcf8757fd9333597af0fc30f6616bad
Support two types of network.
For the network, we should support the cluster/single network.
For cluster network, it should create network for all nodes. Otherwise use the nodename from the parameter.