mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-07-15 00:00:09 +08:00
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:
committed by
Kubernetes Publisher
parent
99aed8af90
commit
2c2851f221
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user