adding k8sclient bug fixes

This commit is contained in:
rkamudhan
2018-07-27 01:10:00 +01:00
committed by Kuralamudhan Ramakrishnan
parent 7372922617
commit 707007abba
3 changed files with 43 additions and 27 deletions

View File

@@ -77,7 +77,7 @@ func LoadDelegateNetConf(bytes []byte, ifnameRequest string) (*DelegateNetConf,
// Do some minimal validation
if delegateConf.Conf.Type == "" {
if err := LoadDelegateNetConfList(bytes, delegateConf); err != nil {
return nil, fmt.Errorf("error in LoadDelegateNetConf: %v")
return nil, fmt.Errorf("error in LoadDelegateNetConf: %v", err)
}
}

View File

@@ -40,7 +40,7 @@ var _ = Describe("config operations", func() {
netConf, err := LoadNetConf([]byte(conf))
Expect(err).NotTo(HaveOccurred())
Expect(len(netConf.Delegates)).To(Equal(1))
Expect(netConf.Delegates[0].Type).To(Equal("weave-net"))
Expect(netConf.Delegates[0].Conf.Type).To(Equal("weave-net"))
Expect(netConf.Delegates[0].MasterPlugin).To(BeTrue())
})
@@ -57,9 +57,9 @@ var _ = Describe("config operations", func() {
netConf, err := LoadNetConf([]byte(conf))
Expect(err).NotTo(HaveOccurred())
Expect(len(netConf.Delegates)).To(Equal(2))
Expect(netConf.Delegates[0].Type).To(Equal("weave-net"))
Expect(netConf.Delegates[0].Conf.Type).To(Equal("weave-net"))
Expect(netConf.Delegates[0].MasterPlugin).To(BeTrue())
Expect(netConf.Delegates[1].Type).To(Equal("foobar"))
Expect(netConf.Delegates[1].Conf.Type).To(Equal("foobar"))
Expect(netConf.Delegates[1].MasterPlugin).To(BeFalse())
})