mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-07 01:50:46 +00:00
published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub) copied from https://github.com/kubernetes/kubernetes.git, branch master, last commit is 71ba8a90f0a4f3a307cffeb8f8566d13277cb135
This commit is contained in:
@@ -24,13 +24,13 @@ import (
|
||||
)
|
||||
|
||||
type BatchInterface interface {
|
||||
GetRESTClient() *rest.RESTClient
|
||||
RESTClient() rest.Interface
|
||||
JobsGetter
|
||||
}
|
||||
|
||||
// BatchClient is used to interact with features provided by the Batch group.
|
||||
type BatchClient struct {
|
||||
*rest.RESTClient
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *BatchClient) Jobs(namespace string) JobInterface {
|
||||
@@ -61,7 +61,7 @@ func NewForConfigOrDie(c *rest.Config) *BatchClient {
|
||||
}
|
||||
|
||||
// New creates a new BatchClient for the given RESTClient.
|
||||
func New(c *rest.RESTClient) *BatchClient {
|
||||
func New(c rest.Interface) *BatchClient {
|
||||
return &BatchClient{c}
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ func setConfigDefaults(config *rest.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *BatchClient) GetRESTClient() *rest.RESTClient {
|
||||
func (c *BatchClient) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@@ -30,8 +30,9 @@ func (c *FakeBatch) Jobs(namespace string) v1.JobInterface {
|
||||
return &FakeJobs{c, namespace}
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeBatch) GetRESTClient() *rest.RESTClient {
|
||||
return nil
|
||||
func (c *FakeBatch) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import (
|
||||
api_v1 "k8s.io/client-go/pkg/api/v1"
|
||||
v1 "k8s.io/client-go/pkg/apis/batch/v1"
|
||||
watch "k8s.io/client-go/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// JobsGetter has a method to return a JobInterface.
|
||||
@@ -45,14 +46,14 @@ type JobInterface interface {
|
||||
|
||||
// jobs implements JobInterface
|
||||
type jobs struct {
|
||||
client *BatchClient
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newJobs returns a Jobs
|
||||
func newJobs(c *BatchClient, namespace string) *jobs {
|
||||
return &jobs{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user