skel: Plugins require a cniVersion in the NetConf

This commit is contained in:
Gabe Rosenhouse
2016-09-06 20:19:26 -04:00
committed by Gabe Rosenhouse
parent 56032390fe
commit fd150a4c97
14 changed files with 76 additions and 26 deletions

View File

@ -51,8 +51,9 @@ var _ = Describe("bridge Operations", func() {
conf := &NetConf{
NetConf: types.NetConf{
Name: "testConfig",
Type: "bridge",
CNIVersion: "0.2.0",
Name: "testConfig",
Type: "bridge",
},
BrName: IFNAME,
IsGW: false,
@ -95,8 +96,9 @@ var _ = Describe("bridge Operations", func() {
conf := &NetConf{
NetConf: types.NetConf{
Name: "testConfig",
Type: "bridge",
CNIVersion: "0.2.0",
Name: "testConfig",
Type: "bridge",
},
BrName: IFNAME,
IsGW: false,
@ -126,12 +128,14 @@ var _ = Describe("bridge Operations", func() {
Expect(err).NotTo(HaveOccurred())
conf := fmt.Sprintf(`{
"cniVersion": "0.2.0",
"name": "mynet",
"type": "bridge",
"bridge": "%s",
"isDefaultGateway": true,
"ipMasq": false,
"ipam": {
"cniVersion": "0.2.0",
"type": "host-local",
"subnet": "%s"
}
@ -253,15 +257,15 @@ var _ = Describe("bridge Operations", func() {
})
It("ensure bridge address", func() {
const IFNAME = "bridge0"
const EXPECTED_IP = "10.0.0.0/8"
const CHANGED_EXPECTED_IP = "10.1.2.3/16"
conf := &NetConf{
NetConf: types.NetConf{
Name: "testConfig",
Type: "bridge",
CNIVersion: "0.2.0",
Name: "testConfig",
Type: "bridge",
},
BrName: IFNAME,
IsGW: true,
@ -320,5 +324,4 @@ var _ = Describe("bridge Operations", func() {
})
Expect(err).NotTo(HaveOccurred())
})
})