client-go: expose all discovery methods

The underlying implementation has both. Exposing that in the result of
Discovery() makes it easier for consumers to call the WithContext methods
because they don't need to wrap with ToDiscoveryInterfaceWithContext().

This is a breaking Go API change because tests which implement
the interface have to be updated.

Kubernetes-commit: d8f70b87cec6888420e778bca1ea8022a6617140
This commit is contained in:
Patrick Ohly
2026-03-18 14:24:10 +01:00
committed by Kubernetes Publisher
parent 99aed8af90
commit 2c2851f221
2 changed files with 3 additions and 3 deletions
@@ -29,7 +29,7 @@ import (
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
Discovery() discovery.DiscoveryInterfaces
SamplecontrollerV1alpha1() samplecontrollerv1alpha1.SamplecontrollerV1alpha1Interface
}
@@ -45,7 +45,7 @@ func (c *Clientset) SamplecontrollerV1alpha1() samplecontrollerv1alpha1.Sampleco
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
func (c *Clientset) Discovery() discovery.DiscoveryInterfaces {
if c == nil {
return nil
}
@@ -72,7 +72,7 @@ type Clientset struct {
tracker testing.ObjectTracker
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
func (c *Clientset) Discovery() discovery.DiscoveryInterfaces {
return c.discovery
}