Get fake clientset for an exisiting client in kubernetes client-go

12/16/2019

I had a requirement where initially I am using fake.NewFakeClient(objs..) (sigs.k8s.io/controller-runtime/pkg/client/fake) for creating custom resource and some external resources like pods, service etc.

Now I want to use fake.NewSimpleClientSet() (k8s.io/cleint-go/kubernetes/fake) but this must point to the previously created client. It should not create a new client set and I must be able to fetch the resources like pod created previously.

Can someone please guide me on this.

Any sort of help would be highly appreciated.

-- PREETI BANSAL
client-go
kubernetes
testing

0 Answers