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
15fc4703
Commit
15fc4703
authored
Dec 07, 2016
by
Euan Kemp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet: remove redundant hostNetwork helper
It did the same thing as the helper in kubecontainer
parent
ca049360
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
kubelet.go
pkg/kubelet/kubelet.go
+2
-2
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+1
-6
No files found.
pkg/kubelet/kubelet.go
View file @
15fc4703
...
@@ -1443,7 +1443,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
...
@@ -1443,7 +1443,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
}
}
// If the network plugin is not ready, only start the pod if it uses the host network
// If the network plugin is not ready, only start the pod if it uses the host network
if
rs
:=
kl
.
runtimeState
.
networkErrors
();
len
(
rs
)
!=
0
&&
!
podUsesHostNetwork
(
pod
)
{
if
rs
:=
kl
.
runtimeState
.
networkErrors
();
len
(
rs
)
!=
0
&&
!
kubecontainer
.
IsHostNetworkPod
(
pod
)
{
return
fmt
.
Errorf
(
"network is not ready: %v"
,
rs
)
return
fmt
.
Errorf
(
"network is not ready: %v"
,
rs
)
}
}
...
@@ -1548,7 +1548,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
...
@@ -1548,7 +1548,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
return
err
return
err
}
}
if
egress
!=
nil
||
ingress
!=
nil
{
if
egress
!=
nil
||
ingress
!=
nil
{
if
podUsesHostNetwork
(
pod
)
{
if
kubecontainer
.
IsHostNetworkPod
(
pod
)
{
kl
.
recorder
.
Event
(
pod
,
v1
.
EventTypeWarning
,
events
.
HostNetworkNotSupported
,
"Bandwidth shaping is not currently supported on the host network"
)
kl
.
recorder
.
Event
(
pod
,
v1
.
EventTypeWarning
,
events
.
HostNetworkNotSupported
,
"Bandwidth shaping is not currently supported on the host network"
)
}
else
if
kl
.
shaper
!=
nil
{
}
else
if
kl
.
shaper
!=
nil
{
if
len
(
apiPodStatus
.
PodIP
)
>
0
{
if
len
(
apiPodStatus
.
PodIP
)
>
0
{
...
...
pkg/kubelet/kubelet_pods.go
View file @
15fc4703
...
@@ -592,11 +592,6 @@ func (kl *Kubelet) makePodDataDirs(pod *v1.Pod) error {
...
@@ -592,11 +592,6 @@ func (kl *Kubelet) makePodDataDirs(pod *v1.Pod) error {
return
nil
return
nil
}
}
// returns whether the pod uses the host network namespace.
func
podUsesHostNetwork
(
pod
*
v1
.
Pod
)
bool
{
return
pod
.
Spec
.
HostNetwork
}
// getPullSecretsForPod inspects the Pod and retrieves the referenced pull
// getPullSecretsForPod inspects the Pod and retrieves the referenced pull
// secrets.
// secrets.
// TODO: duplicate secrets are being retrieved multiple times and there
// TODO: duplicate secrets are being retrieved multiple times and there
...
@@ -1066,7 +1061,7 @@ func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.Po
...
@@ -1066,7 +1061,7 @@ func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.Po
glog
.
V
(
4
)
.
Infof
(
"Cannot get host IP: %v"
,
err
)
glog
.
V
(
4
)
.
Infof
(
"Cannot get host IP: %v"
,
err
)
}
else
{
}
else
{
s
.
HostIP
=
hostIP
.
String
()
s
.
HostIP
=
hostIP
.
String
()
if
podUsesHostNetwork
(
pod
)
&&
s
.
PodIP
==
""
{
if
kubecontainer
.
IsHostNetworkPod
(
pod
)
&&
s
.
PodIP
==
""
{
s
.
PodIP
=
hostIP
.
String
()
s
.
PodIP
=
hostIP
.
String
()
}
}
}
}
...
...
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