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
79ec8ae6
Unverified
Commit
79ec8ae6
authored
Nov 24, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hold namespaces briefly before processing deletion
parent
545f749a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
namespace_controller.go
pkg/controller/namespace/namespace_controller.go
+13
-1
No files found.
pkg/controller/namespace/namespace_controller.go
View file @
79ec8ae6
...
...
@@ -35,6 +35,16 @@ import (
"github.com/golang/glog"
)
const
(
// namespaceDeletionGracePeriod is the time period to wait before processing a received namespace event.
// This allows time for the following to occur:
// * lifecycle admission plugins on HA apiservers to also observe a namespace
// deletion and prevent new objects from being created in the terminating namespace
// * non-leader etcd servers to observe last-minute object creations in a namespace
// so this controller's cleanup can actually clean up all objects
namespaceDeletionGracePeriod
=
5
*
time
.
Second
)
// NamespaceController is responsible for performing actions dependent upon a namespace phase
type
NamespaceController
struct
{
// client that purges namespace content, must have list/delete privileges on all content
...
...
@@ -132,7 +142,9 @@ func (nm *NamespaceController) enqueueNamespace(obj interface{}) {
glog
.
Errorf
(
"Couldn't get key for object %+v: %v"
,
obj
,
err
)
return
}
nm
.
queue
.
Add
(
key
)
// delay processing namespace events to allow HA api servers to observe namespace deletion,
// and HA etcd servers to observe last minute object creations inside the namespace
nm
.
queue
.
AddAfter
(
key
,
namespaceDeletionGracePeriod
)
}
// worker processes the queue of namespace objects.
...
...
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