vendor: bump to libcni v1.0-rc1
Signed-off-by: Casey Callendrello <cdc@redhat.com>
This commit is contained in:
17
vendor/github.com/containernetworking/cni/libcni/api.go
generated
vendored
17
vendor/github.com/containernetworking/cni/libcni/api.go
generated
vendored
@ -428,7 +428,7 @@ func (c *CNIConfig) AddNetworkList(ctx context.Context, list *NetworkConfigList,
|
||||
for _, net := range list.Plugins {
|
||||
result, err = c.addNetwork(ctx, list.Name, list.CNIVersion, net, result, rt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("plugin %s failed (add): %w", pluginDescription(net.Network), err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ func (c *CNIConfig) DelNetworkList(ctx context.Context, list *NetworkConfigList,
|
||||
for i := len(list.Plugins) - 1; i >= 0; i-- {
|
||||
net := list.Plugins[i]
|
||||
if err := c.delNetwork(ctx, list.Name, list.CNIVersion, net, cachedResult, rt); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("plugin %s failed (delete): %w", pluginDescription(net.Network), err)
|
||||
}
|
||||
}
|
||||
_ = c.cacheDel(list.Name, rt)
|
||||
@ -521,6 +521,19 @@ func (c *CNIConfig) DelNetworkList(ctx context.Context, list *NetworkConfigList,
|
||||
return nil
|
||||
}
|
||||
|
||||
func pluginDescription(net *types.NetConf) string {
|
||||
if net == nil {
|
||||
return "<missing>"
|
||||
}
|
||||
pluginType := net.Type
|
||||
out := fmt.Sprintf("type=%q", pluginType)
|
||||
name := net.Name
|
||||
if name != "" {
|
||||
out += fmt.Sprintf(" name=%q", name)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// AddNetwork executes the plugin with the ADD command
|
||||
func (c *CNIConfig) AddNetwork(ctx context.Context, net *NetworkConfig, rt *RuntimeConf) (types.Result, error) {
|
||||
result, err := c.addNetwork(ctx, net.Network.Name, net.Network.CNIVersion, net, nil, rt)
|
||||
|
Reference in New Issue
Block a user