mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #23704 from freehan/kubenet
Update cni binary #23712 is depending on this. Not sure why this one gets in first. Hand merging this
This commit is contained in:
commit
f690220b5c
@ -19,9 +19,9 @@ cni-tar:
|
||||
- user: root
|
||||
- name: /opt/cni
|
||||
- makedirs: True
|
||||
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-09214926.tar.gz
|
||||
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-42c4cb842dad606a84e93aad5a4484ded48e3046.tar.gz
|
||||
- tar_options: v
|
||||
- source_hash: md5=58f8631f912dd88be6a0920775db7274
|
||||
- source_hash: md5=8cee1d59f01a27e8c2c10c120dce1e7d
|
||||
- archive_format: tar
|
||||
- if_missing: /opt/cni/bin
|
||||
|
||||
|
@ -141,6 +141,7 @@ func (plugin *kubenetNetworkPlugin) Event(name string, details map[string]interf
|
||||
cidr.IP.To4()[3] += 1
|
||||
|
||||
json := fmt.Sprintf(NET_CONFIG_TEMPLATE, BridgeName, plugin.MTU, network.DefaultInterfaceName, podCIDR, cidr.IP.String())
|
||||
glog.V(2).Infof("CNI network config set to %v", json)
|
||||
plugin.netConfig, err = libcni.ConfFromBytes([]byte(json))
|
||||
if err == nil {
|
||||
glog.V(5).Infof("CNI network config:\n%s", json)
|
||||
@ -199,6 +200,7 @@ func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id k
|
||||
return fmt.Errorf("Error building CNI config: %v", err)
|
||||
}
|
||||
|
||||
glog.V(3).Infof("Calling cni plugins to add container to network with cni runtime: %+v", rt)
|
||||
res, err := plugin.cniConfig.AddNetwork(plugin.netConfig, rt)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error adding container to network: %v", err)
|
||||
@ -254,6 +256,7 @@ func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, i
|
||||
}
|
||||
delete(plugin.podCIDRs, id)
|
||||
|
||||
glog.V(3).Infof("Calling cni plugins to remove container from network with cni runtime: %+v", rt)
|
||||
if err := plugin.cniConfig.DelNetwork(plugin.netConfig, rt); err != nil {
|
||||
return fmt.Errorf("Error removing container from network: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user