-
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
[Task] Update pod route #261
Changes from 3 commits
4e309f1
db60539
5ccf651
5f951d2
6b3d6af
e5d56b6
f462b9d
7ab6f59
5c0d6f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,12 +328,6 @@ Response Data: | |
100, | ||
200 | ||
], | ||
"routes":[ | ||
{ | ||
"dstCIDR":"224.0.0.0/4", | ||
"gateway":"0.0.0.0" | ||
} | ||
], | ||
"bridgeName": "", | ||
"nodes": [ | ||
{ | ||
|
@@ -386,12 +380,6 @@ Response Data: | |
100, | ||
200 | ||
], | ||
"routes":[ | ||
{ | ||
"dstCIDR":"224.0.0.0/4", | ||
"gateway":"0.0.0.0" | ||
} | ||
], | ||
"bridgeName": "ovsbr0", | ||
"nodes": [ | ||
{ | ||
|
@@ -632,6 +620,11 @@ For each Pod, we have fileds need to handle. | |
- vlanTag: the vlan tag for `ifName` interface. | ||
- ipADdress: the IPv4 address of the `ifName` interface. | ||
- netmask: the IPv4 netmask of the `ifName` interface. | ||
- routesGw: a array of route with gateway (Optional) | ||
- dstCIDR: destination network cidr for add IP routing table | ||
- gateway: the gateway of the interface subnet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- routeIntf: a array of route without gateway (Optional) | ||
- dstCIDR: destination network cidr for add IP routing table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
7. capability: the power of the container, if it's ture, it will get almost all capability and act as a privileged=true. | ||
8. restartPolicy: the attribute how the pod restart is container, it should be a string and only valid for those following strings. | ||
- Always,OnFailure,Never | ||
|
@@ -659,8 +652,19 @@ Request Data: | |
"ifName":"eth12", | ||
"vlanTag":0, | ||
"ipAddress":"1.2.3.4", | ||
"netmask":"255.255.255.0" | ||
}], | ||
"netmask":"255.255.255.0", | ||
"routesGw": [ | ||
{ | ||
"dstCIDR":"192.168.2.0/24", | ||
"gateway":"192.168.2.254" | ||
} | ||
], | ||
"routeIntf": [ | ||
{ | ||
"dstCIDR":"224.0.0.0/4", | ||
} | ||
] | ||
}, | ||
"volumes":[ | ||
], | ||
"capability":true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,21 +25,27 @@ type Container struct { | |
Command []string `bson:"command" json:"command" validate:"required,dive,required"` | ||
} | ||
|
||
// PodRoute is the structure for add IP routing table | ||
type PodRoute struct { | ||
// PodRouteGw is the structure for add IP routing table with gateway | ||
type PodRouteGw struct { | ||
DstCIDR string `bson:"dstCIDR" json:"dstCIDR" validate:"required,cidrv4"` | ||
Gateway string `bson:"gateway" json:"gateway" validate:"required,ipv4"` | ||
} | ||
|
||
// PodRouteIntf is the structure for add IP routing table via interface | ||
type PodRouteIntf struct { | ||
DstCIDR string `bson:"dstCIDR" json:"dstCIDR" validate:"required,cidrv4"` | ||
Gateway string `bson:"gateway" json:"gateway" validate:"omitempty,ipv4"` | ||
} | ||
|
||
// PodNetwork is the structure for pod network info | ||
type PodNetwork struct { | ||
Name string `bson:"name" json:"name" validate:"required"` | ||
IfName string `bson:"ifName" json:"ifName" validate:"required"` | ||
// can not validate nil | ||
VlanTag *int32 `bson:"vlanTag" json:"vlanTag" validate:"-"` | ||
IPAddress string `bson:"ipAddress" json:"ipAddress" validate:"required,ipv4"` | ||
Netmask string `bson:"netmask" json:"netmask" validate:"required,ipv4"` | ||
Routes []PodRoute `bson:"routes,omitempty" json:"routes" validate:"required,dive,required"` | ||
VlanTag *int32 `bson:"vlanTag" json:"vlanTag" validate:"-"` | ||
IPAddress string `bson:"ipAddress" json:"ipAddress" validate:"required,ipv4"` | ||
Netmask string `bson:"netmask" json:"netmask" validate:"required,ipv4"` | ||
RoutesGw []PodRouteGw `bson:"routesGw,omitempty" json:"routesGw" validate:"dive"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I met CI fail if I use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. integration test failed. |
||
RoutesIntf []PodRouteIntf `bson:"routesIntf,omitempty" json:"routesIntf" validate:"dive"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// It's from the entity.Network entity | ||
BridgeName string `bson:"bridgeName" json:"bridgeName" validate:"-"` | ||
|
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.