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
4c289014
Commit
4c289014
authored
Jan 04, 2018
by
JulienBalestra
Committed by
JulienBalestra
Jan 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kubelet provides an updated and complete status of local-static Pods
parent
db8335f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
kubelet_getters.go
pkg/kubelet/kubelet_getters.go
+9
-1
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+8
-11
No files found.
pkg/kubelet/kubelet_getters.go
View file @
4c289014
...
...
@@ -142,7 +142,15 @@ func (kl *Kubelet) getPodContainerDir(podUID types.UID, ctrName string) string {
// GetPods returns all pods bound to the kubelet and their spec, and the mirror
// pods.
func
(
kl
*
Kubelet
)
GetPods
()
[]
*
v1
.
Pod
{
return
kl
.
podManager
.
GetPods
()
pods
:=
kl
.
podManager
.
GetPods
()
// a kubelet running without apiserver requires an additional
// update of the static pod status. See #57106
for
_
,
p
:=
range
pods
{
if
status
,
ok
:=
kl
.
statusManager
.
GetPodStatus
(
p
.
UID
);
ok
{
p
.
Status
=
status
}
}
return
pods
}
// GetRunningPods returns all pods running on kubelet from looking at the
...
...
pkg/kubelet/kubelet_pods.go
View file @
4c289014
...
...
@@ -1359,18 +1359,15 @@ func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.Po
Status
:
v1
.
ConditionTrue
,
})
if
kl
.
kubeClient
!=
nil
{
hostIP
,
err
:=
kl
.
getHostIPAnyWay
()
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"Cannot get host IP: %v"
,
err
)
}
else
{
s
.
HostIP
=
hostIP
.
String
()
if
kubecontainer
.
IsHostNetworkPod
(
pod
)
&&
s
.
PodIP
==
""
{
s
.
PodIP
=
hostIP
.
String
()
}
}
hostIP
,
err
:=
kl
.
getHostIPAnyWay
()
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"Cannot get host IP: %v"
,
err
)
return
*
s
}
s
.
HostIP
=
hostIP
.
String
()
if
kubecontainer
.
IsHostNetworkPod
(
pod
)
&&
s
.
PodIP
==
""
{
s
.
PodIP
=
hostIP
.
String
()
}
return
*
s
}
...
...
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