Skip to content

Commit

Permalink
upgrade: upgrade CNI
Browse files Browse the repository at this point in the history
Signed-off-by: Starnop <[email protected]>
  • Loading branch information
starnop committed Sep 28, 2018
1 parent 36d308e commit f27873b
Show file tree
Hide file tree
Showing 47 changed files with 4,070 additions and 294 deletions.
15 changes: 13 additions & 2 deletions cri/ocicni/cni_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/alibaba/pouch/cri/config"

cnicurrent "github.com/containernetworking/cni/pkg/types/current"
"github.com/cri-o/ocicni/pkg/ocicni"
"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -87,12 +88,22 @@ func (c *CniManager) GetPodNetworkStatus(netnsPath string) (string, error) {
NetNS: netnsPath,
}

ip, err := c.plugin.GetPodNetworkStatus(podNetwork)
var err error
results, err := c.plugin.GetPodNetworkStatus(podNetwork)
if err != nil {
return "", fmt.Errorf("failed to get pod network status: %v", err)
}

return ip, nil
if len(results) > 0 {
// NOTE: only get the first IP of the first network at present
result := results[0].(*cnicurrent.Result)
if len(result.IPs) > 0 {
ip := result.IPs[0].Address.IP.String()
return ip, nil
}
return "", fmt.Errorf("failed to get pod network status for nil IP")
}
return "", fmt.Errorf("failed to get pod network status for nil result")
}

// Status returns error if the network plugin is in error state.
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/containernetworking/cni/CODE-OF-CONDUCT.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

125 changes: 125 additions & 0 deletions vendor/github.com/containernetworking/cni/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions vendor/github.com/containernetworking/cni/CONVENTIONS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions vendor/github.com/containernetworking/cni/DCO

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions vendor/github.com/containernetworking/cni/Documentation/cnitool.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f27873b

Please sign in to comment.