plugins/meta: Add missing error checks

Signed-off-by: Michal Rostecki <mrostecki@suse.de>
This commit is contained in:
Michal Rostecki 2018-09-20 11:06:50 +02:00
parent 8c61a2c2f3
commit f5f787057d
2 changed files with 4 additions and 1 deletions

View File

@ -167,6 +167,7 @@ func createVeth(hostNamespace string, hostVethIfName string, containerNamespace
Expect(err).NotTo(HaveOccurred())
containerNs, err := ns.GetNS(containerNamespace)
Expect(err).NotTo(HaveOccurred())
err = containerNs.Do(func(_ ns.NetNS) error {
peerAddr := &net.IPNet{
IP: hostIP,

View File

@ -1,4 +1,4 @@
// Copyright 2017 CNI authors
// Copyright 2017-2018 CNI authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -178,6 +178,7 @@ var _ = Describe("chain tests", func() {
Expect(err).NotTo(HaveOccurred())
chains, err := ipt.ListChains(TABLE)
Expect(err).NotTo(HaveOccurred())
for _, chain := range chains {
if chain == testChain.name {
Fail("Chain was not deleted")
@ -187,6 +188,7 @@ var _ = Describe("chain tests", func() {
err = testChain.teardown(ipt)
Expect(err).NotTo(HaveOccurred())
chains, err = ipt.ListChains(TABLE)
Expect(err).NotTo(HaveOccurred())
for _, chain := range chains {
if chain == testChain.name {
Fail("Chain was not deleted")