mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Decrease verbosity of namespace controller trace logging
This commit is contained in:
parent
c9250bba2a
commit
655048add9
@ -146,11 +146,11 @@ func deleteCollection(
|
|||||||
gvr unversioned.GroupVersionResource,
|
gvr unversioned.GroupVersionResource,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (bool, error) {
|
) (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}
|
key := operationKey{op: operationDeleteCollection, gvr: gvr}
|
||||||
if !opCache.isSupported(key) {
|
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
|
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
|
// 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...
|
// remember next time that this resource does not support delete collection...
|
||||||
if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
|
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
|
opCache[key] = true
|
||||||
return false, nil
|
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
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,11 +188,11 @@ func listCollection(
|
|||||||
gvr unversioned.GroupVersionResource,
|
gvr unversioned.GroupVersionResource,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (*runtime.UnstructuredList, bool, error) {
|
) (*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}
|
key := operationKey{op: operationList, gvr: gvr}
|
||||||
if !opCache.isSupported(key) {
|
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
|
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
|
// 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...
|
// remember next time that this resource does not support delete collection...
|
||||||
if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
|
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
|
opCache[key] = true
|
||||||
return nil, false, nil
|
return nil, false, nil
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ func deleteEachItem(
|
|||||||
gvr unversioned.GroupVersionResource,
|
gvr unversioned.GroupVersionResource,
|
||||||
namespace string,
|
namespace string,
|
||||||
) error {
|
) 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)
|
unstructuredList, listSupported, err := listCollection(dynamicClient, opCache, gvr, namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -253,20 +253,20 @@ func deleteAllContentForGroupVersionResource(
|
|||||||
namespace string,
|
namespace string,
|
||||||
namespaceDeletedAt unversioned.Time,
|
namespaceDeletedAt unversioned.Time,
|
||||||
) (int64, error) {
|
) (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 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)
|
estimate, err := estimateGracefulTermination(kubeClient, gvr, namespace, namespaceDeletedAt)
|
||||||
if err != nil {
|
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
|
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...
|
// get a client for this group version...
|
||||||
dynamicClient, err := clientPool.ClientForGroupVersion(gvr.GroupVersion())
|
dynamicClient, err := clientPool.ClientForGroupVersion(gvr.GroupVersion())
|
||||||
if err != nil {
|
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
|
return estimate, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,16 +286,16 @@ func deleteAllContentForGroupVersionResource(
|
|||||||
|
|
||||||
// verify there are no more remaining items
|
// 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
|
// 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)
|
unstructuredList, listSupported, err := listCollection(dynamicClient, opCache, gvr, namespace)
|
||||||
if err != nil {
|
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
|
return estimate, err
|
||||||
}
|
}
|
||||||
if !listSupported {
|
if !listSupported {
|
||||||
return estimate, nil
|
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) {
|
if len(unstructuredList.Items) != 0 && estimate == int64(0) {
|
||||||
return estimate, fmt.Errorf("unexpected items still remain in namespace: %s for gvr: %v", namespace, gvr)
|
return estimate, fmt.Errorf("unexpected items still remain in namespace: %s for gvr: %v", namespace, gvr)
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ func syncNamespace(
|
|||||||
return err
|
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
|
// 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
|
// 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
|
// 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) {
|
func estimateGracefulTermination(kubeClient clientset.Interface, groupVersionResource unversioned.GroupVersionResource, ns string, namespaceDeletedAt unversioned.Time) (int64, error) {
|
||||||
groupResource := groupVersionResource.GroupResource()
|
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)
|
estimate := int64(0)
|
||||||
var err error
|
var err error
|
||||||
switch groupResource {
|
switch groupResource {
|
||||||
@ -430,7 +430,7 @@ func estimateGracefulTermination(kubeClient clientset.Interface, groupVersionRes
|
|||||||
|
|
||||||
// estimateGracefulTerminationForPods determines the graceful termination period for pods in the namespace
|
// estimateGracefulTerminationForPods determines the graceful termination period for pods in the namespace
|
||||||
func estimateGracefulTerminationForPods(kubeClient clientset.Interface, ns string) (int64, error) {
|
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)
|
estimate := int64(0)
|
||||||
items, err := kubeClient.Core().Pods(ns).List(api.ListOptions{})
|
items, err := kubeClient.Core().Pods(ns).List(api.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user