Reputation: 1857
While I'm reading how to test on k8s with the fake client on this link, I noticed this function, which, IIUC, assigns a faked server version to the faked k8s cluster.
k8s.clientset.Discovery().(*discoveryfake.FakeDiscovery).FakedServerVersion = &version.Info{
Major: expectedMajor,
Minor: expectedMinor,
}
I'm trying to understand what this *discoveryfake.FakeDiscovery
code means.
k8s.clientset.Discovery()
returns DiscoveryInterface
(defined here), but I cannot find *discoveryfake
field.
What does Discovery().(*discoveryfake.FakeDiscovery)
mean?
Upvotes: 2
Views: 168