Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
setup-and-test:
# docker:
# - image: golang:1.10
# - image: golang:1.12
machine:
image: circleci/classic:latest
steps:
Expand All @@ -15,14 +15,14 @@ jobs:
sudo -E env "PATH=$PATH" apt-get install -y ipset
sudo -E env "PATH=$PATH" apt-get install -y python3-dev gcc
sudo -E env "PATH=$PATH" pip install coverage
mkdir -p /home/circleci/go1-10
mkdir -p /home/circleci/go1-12
mkdir --parents /home/circleci/.goproject/src/github.com/Azure/azure-container-networking
wget https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz
tar -C /home/circleci/go1-10 -xvf go1.10.2.linux-amd64.tar.gz
rm go1.10.2.linux-amd64.tar.gz
wget https://storage.googleapis.com/golang/go1.12.6.linux-amd64.tar.gz
tar -C /home/circleci/go1-12 -xvf go1.12.6.linux-amd64.tar.gz
rm go1.12.6.linux-amd64.tar.gz
mv * /home/circleci/.goproject/src/github.com/Azure/azure-container-networking
cd /home/circleci/.goproject/src/github.com/Azure/azure-container-networking
export GOROOT='/home/circleci/go1-10/go'
export GOROOT='/home/circleci/go1-12/go'
export GOPATH='/home/circleci/.goproject'
export PATH=$GOROOT/bin:$PATH
go get ./...
Expand Down
3 changes: 2 additions & 1 deletion cns/networkcontainers/networkcontainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ func pluginErr(err error, output []byte) error {
return &emsg
}
} else if len(output) > 0 {
// If plugin err is nil, we will only return error if we successfully unmarshal Error struct from CNI and Code != 0
var cniError cniTypes.Error
if err = json.Unmarshal(output, &cniError); err == nil && cniError.Code != 0 {
if unmarshalErr := json.Unmarshal(output, &cniError); unmarshalErr == nil && cniError.Code != 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the change here? I see err renamed to unmarshalErr

return fmt.Errorf("netplugin completed with error: %+v", cniError)
}
}
Expand Down