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
864f9b4a
Commit
864f9b4a
authored
Apr 14, 2015
by
Xiang Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pkg/kubelet: drop unnecessary receiver in pod_manager.go
parent
ede4fb4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
pod_manager.go
pkg/kubelet/pod_manager.go
+11
-11
No files found.
pkg/kubelet/pod_manager.go
View file @
864f9b4a
...
...
@@ -179,24 +179,16 @@ func applyUpdates(changed []api.Pod, current []api.Pod) []api.Pod {
return
updated
}
func
(
self
*
basicPodManager
)
convertMapToPods
(
UIDMap
map
[
types
.
UID
]
*
api
.
Pod
)
[]
api
.
Pod
{
pods
:=
make
([]
api
.
Pod
,
0
,
len
(
UIDMap
))
for
_
,
pod
:=
range
UIDMap
{
pods
=
append
(
pods
,
*
pod
)
}
return
pods
}
// GetPods returns the regular pods bound to the kubelet and their spec.
func
(
self
*
basicPodManager
)
GetPods
()
[]
api
.
Pod
{
self
.
lock
.
RLock
()
defer
self
.
lock
.
RUnlock
()
return
self
.
convert
MapToPods
(
self
.
podByUID
)
return
pods
MapToPods
(
self
.
podByUID
)
}
// Returns all pods (including mirror pods).
func
(
self
*
basicPodManager
)
getAllPods
()
[]
api
.
Pod
{
return
append
(
self
.
convertMapToPods
(
self
.
podByUID
),
self
.
convert
MapToPods
(
self
.
mirrorPodByUID
)
...
)
return
append
(
podsMapToPods
(
self
.
podByUID
),
pods
MapToPods
(
self
.
mirrorPodByUID
)
...
)
}
// GetPodsAndMirrorMap returns the a copy of the regular pods and the mirror
...
...
@@ -208,7 +200,7 @@ func (self *basicPodManager) GetPodsAndMirrorMap() ([]api.Pod, map[string]api.Po
for
key
,
pod
:=
range
self
.
mirrorPodByFullName
{
mirrorPods
[
key
]
=
*
pod
}
return
self
.
convert
MapToPods
(
self
.
podByUID
),
mirrorPods
return
pods
MapToPods
(
self
.
podByUID
),
mirrorPods
}
// GetPodByName provides the (non-mirror) pod that matches namespace and name,
...
...
@@ -279,3 +271,11 @@ func (self *basicPodManager) IsMirrorPodOf(mirrorPod, pod *api.Pod) bool {
}
return
api
.
Semantic
.
DeepEqual
(
&
pod
.
Spec
,
&
mirrorPod
.
Spec
)
}
func
podsMapToPods
(
UIDMap
map
[
types
.
UID
]
*
api
.
Pod
)
[]
api
.
Pod
{
pods
:=
make
([]
api
.
Pod
,
0
,
len
(
UIDMap
))
for
_
,
pod
:=
range
UIDMap
{
pods
=
append
(
pods
,
*
pod
)
}
return
pods
}
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