update dependencies

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-12-22 16:48:26 +08:00
parent 4a11a50544
commit fe6c5de00f
2857 changed files with 252134 additions and 115656 deletions

View File

@@ -34,6 +34,7 @@ import (
fedcommon "sigs.k8s.io/kubefed/pkg/apis/core/common"
fedv1b1 "sigs.k8s.io/kubefed/pkg/apis/core/v1beta1"
"sigs.k8s.io/kubefed/pkg/client/generic"
"sigs.k8s.io/kubefed/pkg/metrics"
)
const (
@@ -321,6 +322,7 @@ func (f *federatedInformerImpl) Start() {
// GetClientForCluster returns a client for the cluster, if present.
func (f *federatedInformerImpl) GetClientForCluster(clusterName string) (generic.Client, error) {
defer metrics.ClusterClientConnectionDurationFromStart(time.Now())
f.Lock()
defer f.Unlock()
@@ -337,6 +339,7 @@ func (f *federatedInformerImpl) GetClientForCluster(clusterName string) (generic
return client, err
}
f.clusterClients[clusterName] = client
return client, nil
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package util
import (
"context"
"time"
"github.com/pkg/errors"
@@ -68,14 +69,14 @@ func NewGenericInformerWithEventHandler(config *rest.Config, namespace string, o
ListFunc: func(opts metav1.ListOptions) (pkgruntime.Object, error) {
res := listObj.DeepCopyObject()
isNamespaceScoped := namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot
err := client.Get().NamespaceIfScoped(namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, scheme.ParameterCodec).Do().Into(res)
err := client.Get().NamespaceIfScoped(namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, scheme.ParameterCodec).Do(context.Background()).Into(res)
return res, err
},
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
// Watch needs to be set to true separately
opts.Watch = true
isNamespaceScoped := namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot
return client.Get().NamespaceIfScoped(namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, scheme.ParameterCodec).Watch()
return client.Get().NamespaceIfScoped(namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, scheme.ParameterCodec).Watch(context.Background())
},
},
obj,

View File

@@ -17,6 +17,8 @@ limitations under the License.
package util
import (
"context"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -52,11 +54,11 @@ func newResourceInformer(client ResourceClient, namespace string, apiResource *m
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) {
options.LabelSelector = labelSelector
return client.Resources(namespace).List(options)
return client.Resources(namespace).List(context.Background(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
options.LabelSelector = labelSelector
return client.Resources(namespace).Watch(options)
return client.Resources(namespace).Watch(context.Background(), options)
},
},
obj, // use an unstructured type with apiVersion / kind populated for informer logging purposes