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
655048ad
Commit
655048ad
authored
Mar 12, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decrease verbosity of namespace controller trace logging
parent
c9250bba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
namespace_controller_utils.go
pkg/controller/namespace/namespace_controller_utils.go
+18
-18
No files found.
pkg/controller/namespace/namespace_controller_utils.go
View file @
655048ad
...
...
@@ -146,11 +146,11 @@ func deleteCollection(
gvr
unversioned
.
GroupVersionResource
,
namespace
string
,
)
(
bool
,
error
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteCollection - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteCollection - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
key
:=
operationKey
{
op
:
operationDeleteCollection
,
gvr
:
gvr
}
if
!
opCache
.
isSupported
(
key
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteCollection ignored since not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteCollection ignored since not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
return
false
,
nil
}
...
...
@@ -168,12 +168,12 @@ func deleteCollection(
// when working with this resource type, we will get a literal not found error rather than expected method not supported
// remember next time that this resource does not support delete collection...
if
errors
.
IsMethodNotSupported
(
err
)
||
errors
.
IsNotFound
(
err
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteCollection not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteCollection not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
opCache
[
key
]
=
true
return
false
,
nil
}
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteCollection unexpected error - namespace: %s, gvr: %v, error: %v"
,
namespace
,
gvr
,
err
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteCollection unexpected error - namespace: %s, gvr: %v, error: %v"
,
namespace
,
gvr
,
err
)
return
true
,
err
}
...
...
@@ -188,11 +188,11 @@ func listCollection(
gvr
unversioned
.
GroupVersionResource
,
namespace
string
,
)
(
*
runtime
.
UnstructuredList
,
bool
,
error
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - listCollection - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - listCollection - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
key
:=
operationKey
{
op
:
operationList
,
gvr
:
gvr
}
if
!
opCache
.
isSupported
(
key
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - listCollection ignored since not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - listCollection ignored since not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
return
nil
,
false
,
nil
}
...
...
@@ -209,7 +209,7 @@ func listCollection(
// when working with this resource type, we will get a literal not found error rather than expected method not supported
// remember next time that this resource does not support delete collection...
if
errors
.
IsMethodNotSupported
(
err
)
||
errors
.
IsNotFound
(
err
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - listCollection not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - listCollection not supported - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
opCache
[
key
]
=
true
return
nil
,
false
,
nil
}
...
...
@@ -224,7 +224,7 @@ func deleteEachItem(
gvr
unversioned
.
GroupVersionResource
,
namespace
string
,
)
error
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteEachItem - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteEachItem - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
unstructuredList
,
listSupported
,
err
:=
listCollection
(
dynamicClient
,
opCache
,
gvr
,
namespace
)
if
err
!=
nil
{
...
...
@@ -253,20 +253,20 @@ func deleteAllContentForGroupVersionResource(
namespace
string
,
namespaceDeletedAt
unversioned
.
Time
,
)
(
int64
,
error
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - namespace: %s, gvr: %v"
,
namespace
,
gvr
)
// estimate how long it will take for the resource to be deleted (needed for objects that support graceful delete)
estimate
,
err
:=
estimateGracefulTermination
(
kubeClient
,
gvr
,
namespace
,
namespaceDeletedAt
)
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - unable to estimate - namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - unable to estimate - namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
return
estimate
,
err
}
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - estimate - namespace: %s, gvr: %v, estimate: %v"
,
namespace
,
gvr
,
estimate
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - estimate - namespace: %s, gvr: %v, estimate: %v"
,
namespace
,
gvr
,
estimate
)
// get a client for this group version...
dynamicClient
,
err
:=
clientPool
.
ClientForGroupVersion
(
gvr
.
GroupVersion
())
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - unable to get client - namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - unable to get client - namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
return
estimate
,
err
}
...
...
@@ -286,16 +286,16 @@ func deleteAllContentForGroupVersionResource(
// verify there are no more remaining items
// it is not an error condition for there to be remaining items if local estimate is non-zero
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - checking for no more items in namespace: %s, gvr: %v"
,
namespace
,
gvr
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - checking for no more items in namespace: %s, gvr: %v"
,
namespace
,
gvr
)
unstructuredList
,
listSupported
,
err
:=
listCollection
(
dynamicClient
,
opCache
,
gvr
,
namespace
)
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - error verifying no items in namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - error verifying no items in namespace: %s, gvr: %v, err: %v"
,
namespace
,
gvr
,
err
)
return
estimate
,
err
}
if
!
listSupported
{
return
estimate
,
nil
}
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - items remaining - namespace: %s, gvr: %v, items: %v"
,
namespace
,
gvr
,
len
(
unstructuredList
.
Items
))
glog
.
V
(
5
)
.
Infof
(
"namespace controller - deleteAllContentForGroupVersionResource - items remaining - namespace: %s, gvr: %v, items: %v"
,
namespace
,
gvr
,
len
(
unstructuredList
.
Items
))
if
len
(
unstructuredList
.
Items
)
!=
0
&&
estimate
==
int64
(
0
)
{
return
estimate
,
fmt
.
Errorf
(
"unexpected items still remain in namespace: %s for gvr: %v"
,
namespace
,
gvr
)
}
...
...
@@ -353,7 +353,7 @@ func syncNamespace(
return
err
}
glog
.
V
(
4
)
.
Infof
(
"namespace controller - syncNamespace - namespace: %s, finalizerToken: %s"
,
namespace
.
Name
,
finalizerToken
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - syncNamespace - namespace: %s, finalizerToken: %s"
,
namespace
.
Name
,
finalizerToken
)
// ensure that the status is up to date on the namespace
// if we get a not found error, we assume the namespace is truly gone
...
...
@@ -409,7 +409,7 @@ func syncNamespace(
// estimateGrracefulTermination will estimate the graceful termination required for the specific entity in the namespace
func
estimateGracefulTermination
(
kubeClient
clientset
.
Interface
,
groupVersionResource
unversioned
.
GroupVersionResource
,
ns
string
,
namespaceDeletedAt
unversioned
.
Time
)
(
int64
,
error
)
{
groupResource
:=
groupVersionResource
.
GroupResource
()
glog
.
V
(
4
)
.
Infof
(
"namespace controller - estimateGracefulTermination - group %s, resource: %s"
,
groupResource
.
Group
,
groupResource
.
Resource
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - estimateGracefulTermination - group %s, resource: %s"
,
groupResource
.
Group
,
groupResource
.
Resource
)
estimate
:=
int64
(
0
)
var
err
error
switch
groupResource
{
...
...
@@ -430,7 +430,7 @@ func estimateGracefulTermination(kubeClient clientset.Interface, groupVersionRes
// estimateGracefulTerminationForPods determines the graceful termination period for pods in the namespace
func
estimateGracefulTerminationForPods
(
kubeClient
clientset
.
Interface
,
ns
string
)
(
int64
,
error
)
{
glog
.
V
(
4
)
.
Infof
(
"namespace controller - estimateGracefulTerminationForPods - namespace %s"
,
ns
)
glog
.
V
(
5
)
.
Infof
(
"namespace controller - estimateGracefulTerminationForPods - namespace %s"
,
ns
)
estimate
:=
int64
(
0
)
items
,
err
:=
kubeClient
.
Core
()
.
Pods
(
ns
)
.
List
(
api
.
ListOptions
{})
if
err
!=
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