I am using the fake clientset to perform some mocking in a k8s cli tool I am creating.
Therefore I am creating a Job resource
jobs := clientset.BatchV1().Jobs(mynamespace)
_, err = jobs.Create(context.TODO(), job, metav1.CreateOptions{})
The clienset has been created as follows:
clientset := testclient.NewSimpleClientset()
where
testclient "k8s.io/client-go/kubernetes/fake"
The job seems to be created, i.e. err is nil on the call above.
I then (from another function call) try to list the corresponding pods (using the exact same clientset)
podList, err = clientset.CoreV1().Pods(myNamespace).List(context.TODO(), labelOptions)
However the length of the corresponding list is always zero
len(podList.Items) = 0
Shouldn't the call using the fake clienset create all related mock resources? (such as the job's pod)