use istio client-go library instead of knative (#1661)

use istio client-go library instead of knative
bump kubernetes dependency version
change code coverage to codecov
This commit is contained in:
zryfish
2019-12-13 11:26:18 +08:00
committed by GitHub
parent f249a6e081
commit ea88c8803d
2071 changed files with 354531 additions and 108336 deletions

View File

@@ -23,18 +23,20 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
// DelegatingClient forms an interface Client by composing separate
// reader, writer and statusclient interfaces. This way, you can have an Client that
// reads from a cache and writes to the API server.
// DelegatingClient forms a Client by composing separate reader, writer and
// statusclient interfaces. This way, you can have an Client that reads from a
// cache and writes to the API server.
type DelegatingClient struct {
Reader
Writer
StatusClient
}
// DelegatingReader forms a interface Reader that will cause Get and List
// requests for unstructured types to use the ClientReader while
// requests for any other type of object with use the CacheReader.
// DelegatingReader forms a Reader that will cause Get and List requests for
// unstructured types to use the ClientReader while requests for any other type
// of object with use the CacheReader. This avoids accidentally caching the
// entire cluster in the common case of loading arbitrary unstructured objects
// (e.g. from OwnerReferences).
type DelegatingReader struct {
CacheReader Reader
ClientReader Reader
@@ -50,10 +52,10 @@ func (d *DelegatingReader) Get(ctx context.Context, key ObjectKey, obj runtime.O
}
// List retrieves list of objects for a given namespace and list options.
func (d *DelegatingReader) List(ctx context.Context, opts *ListOptions, list runtime.Object) error {
func (d *DelegatingReader) List(ctx context.Context, list runtime.Object, opts ...ListOption) error {
_, isUnstructured := list.(*unstructured.UnstructuredList)
if isUnstructured {
return d.ClientReader.List(ctx, opts, list)
return d.ClientReader.List(ctx, list, opts...)
}
return d.CacheReader.List(ctx, opts, list)
return d.CacheReader.List(ctx, list, opts...)
}