forked from github/multus-cni
Add portmap capability support
Signed-off-by: Mathieu Rohon <mathieu.rohon@orange.com>
This commit is contained in:
committed by
Tomofumi Hayashi
parent
635a275746
commit
a4f5fd4bf0
@@ -35,13 +35,20 @@ var _ = Describe("config operations", func() {
|
||||
"kubeconfig": "/etc/kubernetes/node-kubeconfig.yaml",
|
||||
"delegates": [{
|
||||
"type": "weave-net"
|
||||
}]
|
||||
}],
|
||||
"runtimeConfig": {
|
||||
"portMappings": [
|
||||
{"hostPort": 8080, "containerPort": 80, "protocol": "tcp"}
|
||||
]
|
||||
}
|
||||
|
||||
}`
|
||||
netConf, err := LoadNetConf([]byte(conf))
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(netConf.Delegates)).To(Equal(1))
|
||||
Expect(netConf.Delegates[0].Conf.Type).To(Equal("weave-net"))
|
||||
Expect(netConf.Delegates[0].MasterPlugin).To(BeTrue())
|
||||
Expect(len(netConf.RuntimeConfig.PortMaps)).To(Equal(1))
|
||||
})
|
||||
|
||||
It("succeeds if only delegates are set", func() {
|
||||
|
Reference in New Issue
Block a user