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
77286c38
Commit
77286c38
authored
Feb 14, 2017
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet: reduce extraneous logging for pods using host network
For pods using the host network, kubelet/shim should not log error/warning messages when determining the pod IP address.
parent
b1e0d0ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+5
-3
kuberuntime_sandbox.go
pkg/kubelet/kuberuntime/kuberuntime_sandbox.go
+3
-1
No files found.
pkg/kubelet/dockershim/docker_sandbox.go
View file @
77286c38
...
@@ -178,9 +178,6 @@ func (ds *dockerService) getIPFromPlugin(sandbox *dockertypes.ContainerJSON) (st
...
@@ -178,9 +178,6 @@ func (ds *dockerService) getIPFromPlugin(sandbox *dockertypes.ContainerJSON) (st
return
""
,
err
return
""
,
err
}
}
msg
:=
fmt
.
Sprintf
(
"Couldn't find network status for %s/%s through plugin"
,
metadata
.
Namespace
,
metadata
.
Name
)
msg
:=
fmt
.
Sprintf
(
"Couldn't find network status for %s/%s through plugin"
,
metadata
.
Namespace
,
metadata
.
Name
)
if
sharesHostNetwork
(
sandbox
)
{
return
""
,
fmt
.
Errorf
(
"%v: not responsible for host-network sandboxes"
,
msg
)
}
cID
:=
kubecontainer
.
BuildContainerID
(
runtimeName
,
sandbox
.
ID
)
cID
:=
kubecontainer
.
BuildContainerID
(
runtimeName
,
sandbox
.
ID
)
networkStatus
,
err
:=
ds
.
networkPlugin
.
GetPodNetworkStatus
(
metadata
.
Namespace
,
metadata
.
Name
,
cID
)
networkStatus
,
err
:=
ds
.
networkPlugin
.
GetPodNetworkStatus
(
metadata
.
Namespace
,
metadata
.
Name
,
cID
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -202,6 +199,11 @@ func (ds *dockerService) getIP(sandbox *dockertypes.ContainerJSON) (string, erro
...
@@ -202,6 +199,11 @@ func (ds *dockerService) getIP(sandbox *dockertypes.ContainerJSON) (string, erro
if
sandbox
.
NetworkSettings
==
nil
{
if
sandbox
.
NetworkSettings
==
nil
{
return
""
,
nil
return
""
,
nil
}
}
if
sharesHostNetwork
(
sandbox
)
{
// For sandboxes using host network, the shim is not responsible for
// reporting the IP.
return
""
,
nil
}
if
IP
,
err
:=
ds
.
getIPFromPlugin
(
sandbox
);
err
!=
nil
{
if
IP
,
err
:=
ds
.
getIPFromPlugin
(
sandbox
);
err
!=
nil
{
glog
.
Warningf
(
"%v"
,
err
)
glog
.
Warningf
(
"%v"
,
err
)
}
else
if
IP
!=
""
{
}
else
if
IP
!=
""
{
...
...
pkg/kubelet/kuberuntime/kuberuntime_sandbox.go
View file @
77286c38
...
@@ -198,7 +198,9 @@ func (m *kubeGenericRuntimeManager) determinePodSandboxIP(podNamespace, podName
...
@@ -198,7 +198,9 @@ func (m *kubeGenericRuntimeManager) determinePodSandboxIP(podNamespace, podName
return
""
return
""
}
}
ip
:=
podSandbox
.
Network
.
Ip
ip
:=
podSandbox
.
Network
.
Ip
if
net
.
ParseIP
(
ip
)
==
nil
{
if
len
(
ip
)
!=
0
&&
net
.
ParseIP
(
ip
)
==
nil
{
// ip could be an empty string if runtime is not responsible for the
// IP (e.g., host networking).
glog
.
Warningf
(
"Pod Sandbox reported an unparseable IP %v"
,
ip
)
glog
.
Warningf
(
"Pod Sandbox reported an unparseable IP %v"
,
ip
)
return
""
return
""
}
}
...
...
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