0

我正在尝试使用unstructured.UnstructuredList来重用configmap和的逻辑secret

但是,在添加 之后ListAndDeployReferredObject,我开始看到大量Starting reflector *unstructured.Unstructured添加到我的日志文件中的跟踪。

我是在做一些奇怪的事情还是我错过了一些使用的设置unstructured.Unstructured

提前致谢。

func (r *ReconcileSubscription) ListAndDeployReferredObject(instance *appv1alpha1.Subscription, gvk schema.GroupVersionKind, refObj referredObject) error {
    insName := instance.GetName()
    insNs := instance.GetNamespace()
    uObjList := &unstructured.UnstructuredList{}

    uObjList.SetGroupVersionKind(gvk)

    opts := &client.ListOptions{Namespace: insNs}
    err := r.Client.List(context.TODO(), uObjList, opts)

    if err != nil && !errors.IsNotFound(err) {
        klog.Errorf("Failed to list referred objects with error %v ", err)
        return err
    }
    // other logics... 
}
I0326 23:05:58.955589   95169 reflector.go:120] Starting reflector *unstructured.Unstructured (10m0s) from pkg/mod/k8s.io/client-go@v0.0.0-20191016111102-bec269661e48/tools/cache/reflector.go:96
...
I0326 23:15:18.718932   95169 reflector.go:158] Listing and watching *unstructured.Unstructured from pkg/mod/k8s.io/client-go@v0.0.0-20191016111102-bec269661e48/tools/cache/reflector.go:96
4

1 回答 1

0

我发现这些打印是正常的,因为我们在控制器上使用动态客户端进行缓存

于 2020-04-01T13:53:03.717 回答