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
a17a4753
Commit
a17a4753
authored
Mar 14, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22951 from derekwaynecarr/flake_ns
Auto commit by PR queue bot
parents
e290a10d
775c5a26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
admission.go
plugin/pkg/admission/namespace/lifecycle/admission.go
+12
-0
No files found.
plugin/pkg/admission/namespace/lifecycle/admission.go
View file @
a17a4753
...
@@ -57,6 +57,18 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) {
...
@@ -57,6 +57,18 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) {
// if we're here, then the API server has found a route, which means that if we have a non-empty namespace
// if we're here, then the API server has found a route, which means that if we have a non-empty namespace
// its a namespaced resource.
// its a namespaced resource.
if
len
(
a
.
GetNamespace
())
==
0
||
a
.
GetKind
()
==
api
.
Kind
(
"Namespace"
)
{
if
len
(
a
.
GetNamespace
())
==
0
||
a
.
GetKind
()
==
api
.
Kind
(
"Namespace"
)
{
// if a namespace is deleted, we want to prevent all further creates into it
// while it is undergoing termination. to reduce incidences where the cache
// is slow to update, we forcefully remove the namespace from our local cache.
// this will cause a live lookup of the namespace to get its latest state even
// before the watch notification is received.
if
a
.
GetOperation
()
==
admission
.
Delete
{
l
.
store
.
Delete
(
&
api
.
Namespace
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
a
.
GetName
(),
},
})
}
return
nil
return
nil
}
}
...
...
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