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
f42ee945
Commit
f42ee945
authored
Sep 01, 2016
by
derekwaynecarr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore v1 bindings in namespace controller deletion
parent
4e1ff53b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
namespace_controller.go
pkg/controller/namespace/namespace_controller.go
+18
-1
No files found.
pkg/controller/namespace/namespace_controller.go
View file @
f42ee945
...
@@ -63,13 +63,30 @@ func NewNamespaceController(
...
@@ -63,13 +63,30 @@ func NewNamespaceController(
groupVersionResources
[]
unversioned
.
GroupVersionResource
,
groupVersionResources
[]
unversioned
.
GroupVersionResource
,
resyncPeriod
time
.
Duration
,
resyncPeriod
time
.
Duration
,
finalizerToken
api
.
FinalizerName
)
*
NamespaceController
{
finalizerToken
api
.
FinalizerName
)
*
NamespaceController
{
// the namespace deletion code looks at the discovery document to enumerate the set of resources on the server.
// it then finds all namespaced resources, and in response to namespace deletion, will call delete on all of them.
// unfortunately, the discovery information does not include the list of supported verbs/methods. if the namespace
// controller calls LIST/DELETECOLLECTION for a resource, it will get a 405 error from the server and cache that that was the case.
// we found in practice though that some auth engines when encountering paths they don't know about may return a 50x.
// until we have verbs, we pre-populate resources that do not support list or delete for well-known apis rather than
// probing the server once in order to be told no.
opCache
:=
operationNotSupportedCache
{}
ignoredGroupVersionResources
:=
[]
unversioned
.
GroupVersionResource
{
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"bindings"
},
}
for
_
,
ignoredGroupVersionResource
:=
range
ignoredGroupVersionResources
{
opCache
[
operationKey
{
op
:
operationDeleteCollection
,
gvr
:
ignoredGroupVersionResource
}]
=
true
opCache
[
operationKey
{
op
:
operationList
,
gvr
:
ignoredGroupVersionResource
}]
=
true
}
// create the controller so we can inject the enqueue function
// create the controller so we can inject the enqueue function
namespaceController
:=
&
NamespaceController
{
namespaceController
:=
&
NamespaceController
{
kubeClient
:
kubeClient
,
kubeClient
:
kubeClient
,
clientPool
:
clientPool
,
clientPool
:
clientPool
,
queue
:
workqueue
.
NewNamedRateLimitingQueue
(
workqueue
.
DefaultControllerRateLimiter
(),
"namespace"
),
queue
:
workqueue
.
NewNamedRateLimitingQueue
(
workqueue
.
DefaultControllerRateLimiter
(),
"namespace"
),
groupVersionResources
:
groupVersionResources
,
groupVersionResources
:
groupVersionResources
,
opCache
:
op
erationNotSupportedCache
{}
,
opCache
:
op
Cache
,
finalizerToken
:
finalizerToken
,
finalizerToken
:
finalizerToken
,
}
}
...
...
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