Merge pull request #204 from mrostecki/always-check-err

Add missing error checks
This commit is contained in:
Dan Williams
2018-09-24 20:52:38 -05:00
committed by GitHub
6 changed files with 13 additions and 4 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")