Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
register deployments type
Browse files Browse the repository at this point in the history
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
  • Loading branch information
Kingdon Barrett committed Jul 27, 2021
1 parent 23a1012 commit e4e7f55
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/cluster/kubernetes/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const (

func fakeClients() (ExtendedClient, func()) {
scheme := runtime.NewScheme()
scheme.AddKnownTypes(corev1.SchemeGroupVersion, &corev1.Namespace{})
listMapping := map[schema.GroupVersionResource]string{
{Group: "", Version: "v1", Resource: "namespaces"}: "List",
{Group: "apps", Version: "v1", Resource: "deployments"}: "List",
}

// Set this to `true` to output a trace of the API actions called
// while running the tests
Expand All @@ -65,7 +68,7 @@ func fakeClients() (ExtendedClient, func()) {

coreClient := corefake.NewSimpleClientset(&corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: defaultTestNamespace}})
hrClient := helmopfake.NewSimpleClientset()
dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme)
dynamicClient := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(scheme, listMapping)
crdClient := crdfake.NewSimpleClientset()
shutdown := make(chan struct{})
discoveryClient := MakeCachedDiscovery(coreClient.Discovery(), crdClient, shutdown)
Expand Down

0 comments on commit e4e7f55

Please sign in to comment.