Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d026d7ec
Commit
d026d7ec
authored
Mar 31, 2016
by
Minhan Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cni binary
parent
2ac788b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
init.sls
cluster/saltbase/salt/cni/init.sls
+2
-2
kubenet_linux.go
pkg/kubelet/network/kubenet/kubenet_linux.go
+3
-0
No files found.
cluster/saltbase/salt/cni/init.sls
View file @
d026d7ec
...
...
@@ -12,9 +12,9 @@ cni-tar:
- user: root
- name: /opt/cni
- makedirs: True
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-
0921492
6.tar.gz
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-
42c4cb842dad606a84e93aad5a4484ded48e304
6.tar.gz
- tar_options: v
- source_hash: md5=
58f8631f912dd88be6a0920775db7274
- source_hash: md5=
8cee1d59f01a27e8c2c10c120dce1e7d
- archive_format: tar
- if_missing: /opt/cni/bin
pkg/kubelet/network/kubenet/kubenet_linux.go
View file @
d026d7ec
...
...
@@ -139,6 +139,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
)
...
...
@@ -197,6 +198,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
)
...
...
@@ -252,6 +254,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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment