mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-25 06:02:30 +00:00
client-go/metadata/fake: expose IsWatchListSemanticsUnSupported
Kubernetes-commit: 8324fc3e0343e1c6134f3e83be2d77d9556a496c
This commit is contained in:
committed by
Kubernetes Publisher
parent
c655edb878
commit
cc2ef1778d
@@ -109,6 +109,10 @@ func (c *FakeMetadataClient) Resource(resource schema.GroupVersionResource) meta
|
||||
return &metadataResourceClient{client: c, resource: resource}
|
||||
}
|
||||
|
||||
func (c *FakeMetadataClient) IsWatchListSemanticsUnSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Namespace returns an interface for accessing the current resource in the specified
|
||||
// namespace.
|
||||
func (c *metadataResourceClient) Namespace(ns string) metadata.ResourceInterface {
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/util/watchlist"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -58,6 +59,13 @@ func newPartialObjectMetadataWithAnnotations(annotations map[string]string) *met
|
||||
return u
|
||||
}
|
||||
|
||||
func TestDoesClientSupportWatchListSemantics(t *testing.T) {
|
||||
target := &FakeMetadataClient{}
|
||||
if !watchlist.DoesClientNotSupportWatchListSemantics(target) {
|
||||
t.Fatalf("FakeMetadataClient should NOT support WatchList semantics")
|
||||
}
|
||||
}
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
scheme := NewTestScheme()
|
||||
metav1.AddMetaToScheme(scheme)
|
||||
|
||||
Reference in New Issue
Block a user