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
24df692b
Commit
24df692b
authored
Apr 15, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6872 from yujuhong/fix_lock
Fix locking issue in pod manager
parents
1ea2c3ba
967405f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
pod_manager.go
pkg/kubelet/pod_manager.go
+11
-8
No files found.
pkg/kubelet/pod_manager.go
View file @
24df692b
...
@@ -249,22 +249,25 @@ func (self *basicPodManager) TranslatePodUID(uid types.UID) types.UID {
...
@@ -249,22 +249,25 @@ func (self *basicPodManager) TranslatePodUID(uid types.UID) types.UID {
return
uid
return
uid
}
}
func
(
self
*
basicPodManager
)
get
FullNameMaps
()
(
map
[
string
]
*
api
.
Pod
,
map
[
string
]
*
api
.
Pod
)
{
func
(
self
*
basicPodManager
)
get
OrphanedMirrorPodNames
()
[]
string
{
self
.
lock
.
RLock
()
self
.
lock
.
RLock
()
defer
self
.
lock
.
RUnlock
()
defer
self
.
lock
.
RUnlock
()
return
self
.
podByFullName
,
self
.
mirrorPodByFullName
var
podFullNames
[]
string
for
podFullName
:=
range
self
.
mirrorPodByFullName
{
if
_
,
ok
:=
self
.
podByFullName
[
podFullName
];
!
ok
{
podFullNames
=
append
(
podFullNames
,
podFullName
)
}
}
return
podFullNames
}
}
// Delete all mirror pods which do not have associated static pods. This method
// Delete all mirror pods which do not have associated static pods. This method
// sends deletion requets to the API server, but does NOT modify the internal
// sends deletion requets to the API server, but does NOT modify the internal
// pod storage in basicPodManager.
// pod storage in basicPodManager.
func
(
self
*
basicPodManager
)
DeleteOrphanedMirrorPods
()
{
func
(
self
*
basicPodManager
)
DeleteOrphanedMirrorPods
()
{
podByFullName
,
mirrorPodByFullName
:=
self
.
getFullNameMaps
()
podFullNames
:=
self
.
getOrphanedMirrorPodNames
()
for
_
,
podFullName
:=
range
podFullNames
{
for
podFullName
:=
range
mirrorPodByFullName
{
self
.
mirrorClient
.
DeleteMirrorPod
(
podFullName
)
if
_
,
ok
:=
podByFullName
[
podFullName
];
!
ok
{
self
.
mirrorClient
.
DeleteMirrorPod
(
podFullName
)
}
}
}
}
}
...
...
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