Update clientset generator to use RESTClient interface instead of the RESTClient data type

This commit is contained in:
Jan Chaloupka 2016-10-13 14:56:07 +02:00
parent c8004a1b7b
commit 6079053407
194 changed files with 755 additions and 550 deletions

View File

@ -60,10 +60,11 @@ func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io
const pkgTestingCore = "k8s.io/kubernetes/pkg/client/testing/core" const pkgTestingCore = "k8s.io/kubernetes/pkg/client/testing/core"
const pkgRESTClient = "k8s.io/kubernetes/pkg/client/restclient" const pkgRESTClient = "k8s.io/kubernetes/pkg/client/restclient"
m := map[string]interface{}{ m := map[string]interface{}{
"group": g.group, "group": g.group,
"Group": namer.IC(g.group), "Group": namer.IC(g.group),
"Fake": c.Universe.Type(types.Name{Package: pkgTestingCore, Name: "Fake"}), "Fake": c.Universe.Type(types.Name{Package: pkgTestingCore, Name: "Fake"}),
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Interface"}),
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}),
} }
sw.Do(groupClientTemplate, m) sw.Do(groupClientTemplate, m)
for _, t := range g.types { for _, t := range g.types {
@ -103,9 +104,10 @@ func (c *Fake$.Group$) $.type|publicPlural$() $.realClientPackage$.$.type|public
` `
var getRESTClient = ` var getRESTClient = `
// 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. // with API server by this client implementation.
func (c *Fake$.Group$) GetRESTClient() *$.RESTClient|raw$ { func (c *Fake$.Group$) RESTClient() $.RESTClientInterface|raw$ {
return nil var ret *$.RESTClient|raw$
return ret
} }
` `

View File

@ -92,7 +92,7 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
"allGroups": allGroups, "allGroups": allGroups,
"Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}), "Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}),
"DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "DefaultKubernetesUserAgent"}), "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "DefaultKubernetesUserAgent"}),
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Interface"}),
"DiscoveryInterface": c.Universe.Type(types.Name{Package: pkgDiscovery, Name: "DiscoveryInterface"}), "DiscoveryInterface": c.Universe.Type(types.Name{Package: pkgDiscovery, Name: "DiscoveryInterface"}),
"DiscoveryClient": c.Universe.Type(types.Name{Package: pkgDiscovery, Name: "DiscoveryClient"}), "DiscoveryClient": c.Universe.Type(types.Name{Package: pkgDiscovery, Name: "DiscoveryClient"}),
"NewDiscoveryClientForConfig": c.Universe.Function(types.Name{Package: pkgDiscovery, Name: "NewDiscoveryClientForConfig"}), "NewDiscoveryClientForConfig": c.Universe.Function(types.Name{Package: pkgDiscovery, Name: "NewDiscoveryClientForConfig"}),
@ -183,7 +183,7 @@ $end$
var newClientsetForRESTClientTemplate = ` var newClientsetForRESTClientTemplate = `
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c *$.RESTClient|raw$) *Clientset { func New(c $.RESTClientInterface|raw$) *Clientset {
var clientset Clientset var clientset Clientset
$range .allGroups$ clientset.$.Group$Client =$.PackageName$.New(c) $range .allGroups$ clientset.$.Group$Client =$.PackageName$.New(c)
$end$ $end$

View File

@ -89,7 +89,7 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer
"types": g.types, "types": g.types,
"Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}), "Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}),
"DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "DefaultKubernetesUserAgent"}), "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "DefaultKubernetesUserAgent"}),
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Interface"}),
"RESTClientFor": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "RESTClientFor"}), "RESTClientFor": c.Universe.Function(types.Name{Package: pkgRESTClient, Name: "RESTClientFor"}),
"latestGroup": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "Group"}), "latestGroup": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "Group"}),
"GroupOrDie": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "GroupOrDie"}), "GroupOrDie": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "GroupOrDie"}),
@ -128,7 +128,7 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer
var groupInterfaceTemplate = ` var groupInterfaceTemplate = `
type $.Group$Interface interface { type $.Group$Interface interface {
GetRESTClient() *$.RESTClient|raw$ RESTClient() $.RESTClientInterface|raw$
$range .types$ $.|publicPlural$Getter $range .types$ $.|publicPlural$Getter
$end$ $end$
} }
@ -137,7 +137,7 @@ type $.Group$Interface interface {
var groupClientTemplate = ` var groupClientTemplate = `
// $.Group$Client is used to interact with features provided by the $.Group$ group. // $.Group$Client is used to interact with features provided by the $.Group$ group.
type $.Group$Client struct { type $.Group$Client struct {
*$.RESTClient|raw$ restClient $.RESTClientInterface|raw$
} }
` `
@ -181,19 +181,19 @@ func NewForConfigOrDie(c *$.Config|raw$) *$.Group$Client {
` `
var getRESTClient = ` var getRESTClient = `
// 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. // with API server by this client implementation.
func (c *$.Group$Client) GetRESTClient() *$.RESTClient|raw$ { func (c *$.Group$Client) RESTClient() $.RESTClientInterface|raw$ {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }
` `
var newClientForRESTClientTemplate = ` var newClientForRESTClientTemplate = `
// New creates a new $.Group$Client for the given RESTClient. // New creates a new $.Group$Client for the given RESTClient.
func New(c *$.RESTClient|raw$) *$.Group$Client { func New(c $.RESTClientInterface|raw$) *$.Group$Client {
return &$.Group$Client{c} return &$.Group$Client{c}
} }
` `

View File

@ -69,14 +69,15 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
pkg := filepath.Base(t.Name.Package) pkg := filepath.Base(t.Name.Package)
namespaced := !extractBoolTagOrDie("nonNamespaced", t.SecondClosestCommentLines) namespaced := !extractBoolTagOrDie("nonNamespaced", t.SecondClosestCommentLines)
m := map[string]interface{}{ m := map[string]interface{}{
"type": t, "type": t,
"package": pkg, "package": pkg,
"Package": namer.IC(pkg), "Package": namer.IC(pkg),
"Group": namer.IC(g.group), "Group": namer.IC(g.group),
"watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/watch", Name: "Interface"}), "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/watch", Name: "Interface"}),
"apiParameterCodec": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ParameterCodec"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/client/restclient", Name: "Interface"}),
"PatchType": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "PatchType"}), "apiParameterCodec": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ParameterCodec"}),
"namespaced": namespaced, "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "PatchType"}),
"namespaced": namespaced,
} }
if g.version == "unversioned" { if g.version == "unversioned" {
@ -179,7 +180,7 @@ var interfaceTemplate4 = `
var structNamespaced = ` var structNamespaced = `
// $.type|privatePlural$ implements $.type|public$Interface // $.type|privatePlural$ implements $.type|public$Interface
type $.type|privatePlural$ struct { type $.type|privatePlural$ struct {
client *$.Group$Client client $.RESTClientInterface|raw$
ns string ns string
} }
` `
@ -188,7 +189,7 @@ type $.type|privatePlural$ struct {
var structNonNamespaced = ` var structNonNamespaced = `
// $.type|privatePlural$ implements $.type|public$Interface // $.type|privatePlural$ implements $.type|public$Interface
type $.type|privatePlural$ struct { type $.type|privatePlural$ struct {
client *$.Group$Client client $.RESTClientInterface|raw$
} }
` `
@ -196,7 +197,7 @@ var newStructNamespaced = `
// new$.type|publicPlural$ returns a $.type|publicPlural$ // new$.type|publicPlural$ returns a $.type|publicPlural$
func new$.type|publicPlural$(c *$.Group$Client, namespace string) *$.type|privatePlural$ { func new$.type|publicPlural$(c *$.Group$Client, namespace string) *$.type|privatePlural$ {
return &$.type|privatePlural${ return &$.type|privatePlural${
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }
@ -206,7 +207,7 @@ var newStructNonNamespaced = `
// new$.type|publicPlural$ returns a $.type|publicPlural$ // new$.type|publicPlural$ returns a $.type|publicPlural$
func new$.type|publicPlural$(c *$.Group$Client) *$.type|privatePlural$ { func new$.type|publicPlural$(c *$.Group$Client) *$.type|privatePlural$ {
return &$.type|privatePlural${ return &$.type|privatePlural${
client: c, client: c.RESTClient(),
} }
} }
` `

View File

@ -82,7 +82,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
} }
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c *restclient.RESTClient) *Clientset { func New(c restclient.Interface) *Clientset {
var clientset Clientset var clientset Clientset
clientset.TestgroupClient = unversionedtestgroup.New(c) clientset.TestgroupClient = unversionedtestgroup.New(c)

View File

@ -35,7 +35,7 @@ func ClientSetRateLimiterTest(t *testing.T) {
if err != nil { if err != nil {
t.Errorf("creating clientset for config %v failed: %v", config, err) t.Errorf("creating clientset for config %v failed: %v", config, err)
} }
testGroupThrottler := clientSet.Testgroup().GetRESTClient().GetRateLimiter() testGroupThrottler := clientSet.Testgroup().RESTClient().GetRateLimiter()
if rateLimiter != testGroupThrottler { if rateLimiter != testGroupThrottler {
t.Errorf("Clients in client set should use rateLimiter passed in config:\noriginal: %v\ntestGroup: %v", rateLimiter, testGroupThrottler) t.Errorf("Clients in client set should use rateLimiter passed in config:\noriginal: %v\ntestGroup: %v", rateLimiter, testGroupThrottler)

View File

@ -30,8 +30,9 @@ func (c *FakeTestgroup) TestTypes(namespace string) unversioned.TestTypeInterfac
return &FakeTestTypes{c, namespace} return &FakeTestTypes{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. // with API server by this client implementation.
func (c *FakeTestgroup) GetRESTClient() *restclient.RESTClient { func (c *FakeTestgroup) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -23,13 +23,13 @@ import (
) )
type TestgroupInterface interface { type TestgroupInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
TestTypesGetter TestTypesGetter
} }
// TestgroupClient is used to interact with features provided by the Testgroup group. // TestgroupClient is used to interact with features provided by the Testgroup group.
type TestgroupClient struct { type TestgroupClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *TestgroupClient) TestTypes(namespace string) TestTypeInterface { func (c *TestgroupClient) TestTypes(namespace string) TestTypeInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *TestgroupClient {
} }
// New creates a new TestgroupClient for the given RESTClient. // New creates a new TestgroupClient for the given RESTClient.
func New(c *restclient.RESTClient) *TestgroupClient { func New(c restclient.Interface) *TestgroupClient {
return &TestgroupClient{c} return &TestgroupClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *TestgroupClient) GetRESTClient() *restclient.RESTClient { func (c *TestgroupClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io" testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type TestTypeInterface interface {
// testTypes implements TestTypeInterface // testTypes implements TestTypeInterface
type testTypes struct { type testTypes struct {
client *TestgroupClient client restclient.Interface
ns string ns string
} }
// newTestTypes returns a TestTypes // newTestTypes returns a TestTypes
func newTestTypes(c *TestgroupClient, namespace string) *testTypes { func newTestTypes(c *TestgroupClient, namespace string) *testTypes {
return &testTypes{ return &testTypes{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -114,7 +114,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
} }
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c *restclient.RESTClient) *Clientset { func New(c restclient.Interface) *Clientset {
var clientset Clientset var clientset Clientset
clientset.FederationClient = unversionedfederation.New(c) clientset.FederationClient = unversionedfederation.New(c)
clientset.CoreClient = unversionedcore.New(c) clientset.CoreClient = unversionedcore.New(c)

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type ConfigMapInterface interface {
// configMaps implements ConfigMapInterface // configMaps implements ConfigMapInterface
type configMaps struct { type configMaps struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newConfigMaps returns a ConfigMaps // newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreClient, namespace string) *configMaps { func newConfigMaps(c *CoreClient, namespace string) *configMaps {
return &configMaps{ return &configMaps{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,7 +23,7 @@ import (
) )
type CoreInterface interface { type CoreInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
ConfigMapsGetter ConfigMapsGetter
EventsGetter EventsGetter
NamespacesGetter NamespacesGetter
@ -33,7 +33,7 @@ type CoreInterface interface {
// CoreClient is used to interact with features provided by the Core group. // CoreClient is used to interact with features provided by the Core group.
type CoreClient struct { type CoreClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface { func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface {
@ -80,7 +80,7 @@ func NewForConfigOrDie(c *restclient.Config) *CoreClient {
} }
// New creates a new CoreClient for the given RESTClient. // New creates a new CoreClient for the given RESTClient.
func New(c *restclient.RESTClient) *CoreClient { func New(c restclient.Interface) *CoreClient {
return &CoreClient{c} return &CoreClient{c}
} }
@ -109,11 +109,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *CoreClient) GetRESTClient() *restclient.RESTClient { func (c *CoreClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type EventInterface interface {
// events implements EventInterface // events implements EventInterface
type events struct { type events struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newEvents returns a Events // newEvents returns a Events
func newEvents(c *CoreClient, namespace string) *events { func newEvents(c *CoreClient, namespace string) *events {
return &events{ return &events{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -46,8 +46,9 @@ func (c *FakeCore) Services(namespace string) unversioned.ServiceInterface {
return &FakeServices{c, namespace} return &FakeServices{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. // with API server by this client implementation.
func (c *FakeCore) GetRESTClient() *restclient.RESTClient { func (c *FakeCore) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type NamespaceInterface interface {
// namespaces implements NamespaceInterface // namespaces implements NamespaceInterface
type namespaces struct { type namespaces struct {
client *CoreClient client restclient.Interface
} }
// newNamespaces returns a Namespaces // newNamespaces returns a Namespaces
func newNamespaces(c *CoreClient) *namespaces { func newNamespaces(c *CoreClient) *namespaces {
return &namespaces{ return &namespaces{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type SecretInterface interface {
// secrets implements SecretInterface // secrets implements SecretInterface
type secrets struct { type secrets struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newSecrets returns a Secrets // newSecrets returns a Secrets
func newSecrets(c *CoreClient, namespace string) *secrets { func newSecrets(c *CoreClient, namespace string) *secrets {
return &secrets{ return &secrets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type ServiceInterface interface {
// services implements ServiceInterface // services implements ServiceInterface
type services struct { type services struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newServices returns a Services // newServices returns a Services
func newServices(c *CoreClient, namespace string) *services { func newServices(c *CoreClient, namespace string) *services {
return &services{ return &services{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type DaemonSetInterface interface {
// daemonSets implements DaemonSetInterface // daemonSets implements DaemonSetInterface
type daemonSets struct { type daemonSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDaemonSets returns a DaemonSets // newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
return &daemonSets{ return &daemonSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type DeploymentInterface interface {
// deployments implements DeploymentInterface // deployments implements DeploymentInterface
type deployments struct { type deployments struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDeployments returns a Deployments // newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments { func newDeployments(c *ExtensionsClient, namespace string) *deployments {
return &deployments{ return &deployments{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,7 +23,7 @@ import (
) )
type ExtensionsInterface interface { type ExtensionsInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
DaemonSetsGetter DaemonSetsGetter
DeploymentsGetter DeploymentsGetter
IngressesGetter IngressesGetter
@ -32,7 +32,7 @@ type ExtensionsInterface interface {
// ExtensionsClient is used to interact with features provided by the Extensions group. // ExtensionsClient is used to interact with features provided by the Extensions group.
type ExtensionsClient struct { type ExtensionsClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface { func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
@ -75,7 +75,7 @@ func NewForConfigOrDie(c *restclient.Config) *ExtensionsClient {
} }
// New creates a new ExtensionsClient for the given RESTClient. // New creates a new ExtensionsClient for the given RESTClient.
func New(c *restclient.RESTClient) *ExtensionsClient { func New(c restclient.Interface) *ExtensionsClient {
return &ExtensionsClient{c} return &ExtensionsClient{c}
} }
@ -104,11 +104,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient { func (c *ExtensionsClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -42,8 +42,9 @@ func (c *FakeExtensions) ReplicaSets(namespace string) unversioned.ReplicaSetInt
return &FakeReplicaSets{c, namespace} return &FakeReplicaSets{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. // with API server by this client implementation.
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient { func (c *FakeExtensions) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type IngressInterface interface {
// ingresses implements IngressInterface // ingresses implements IngressInterface
type ingresses struct { type ingresses struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newIngresses returns a Ingresses // newIngresses returns a Ingresses
func newIngresses(c *ExtensionsClient, namespace string) *ingresses { func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
return &ingresses{ return &ingresses{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type ReplicaSetInterface interface {
// replicaSets implements ReplicaSetInterface // replicaSets implements ReplicaSetInterface
type replicaSets struct { type replicaSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newReplicaSets returns a ReplicaSets // newReplicaSets returns a ReplicaSets
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
return &replicaSets{ return &replicaSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
federation "k8s.io/kubernetes/federation/apis/federation" federation "k8s.io/kubernetes/federation/apis/federation"
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,13 +45,13 @@ type ClusterInterface interface {
// clusters implements ClusterInterface // clusters implements ClusterInterface
type clusters struct { type clusters struct {
client *FederationClient client restclient.Interface
} }
// newClusters returns a Clusters // newClusters returns a Clusters
func newClusters(c *FederationClient) *clusters { func newClusters(c *FederationClient) *clusters {
return &clusters{ return &clusters{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -30,8 +30,9 @@ func (c *FakeFederation) Clusters() unversioned.ClusterInterface {
return &FakeClusters{c} return &FakeClusters{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeFederation) GetRESTClient() *restclient.RESTClient { func (c *FakeFederation) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -23,13 +23,13 @@ import (
) )
type FederationInterface interface { type FederationInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
ClustersGetter ClustersGetter
} }
// FederationClient is used to interact with features provided by the Federation group. // FederationClient is used to interact with features provided by the Federation group.
type FederationClient struct { type FederationClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *FederationClient) Clusters() ClusterInterface { func (c *FederationClient) Clusters() ClusterInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *FederationClient {
} }
// New creates a new FederationClient for the given RESTClient. // New creates a new FederationClient for the given RESTClient.
func New(c *restclient.RESTClient) *FederationClient { func New(c restclient.Interface) *FederationClient {
return &FederationClient{c} return &FederationClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *FederationClient) GetRESTClient() *restclient.RESTClient { func (c *FederationClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -114,7 +114,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
} }
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c *restclient.RESTClient) *Clientset { func New(c restclient.Interface) *Clientset {
var clientset Clientset var clientset Clientset
clientset.FederationClient = v1beta1federation.New(c) clientset.FederationClient = v1beta1federation.New(c)
clientset.CoreClient = v1core.New(c) clientset.CoreClient = v1core.New(c)

View File

@ -19,6 +19,7 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type ConfigMapInterface interface {
// configMaps implements ConfigMapInterface // configMaps implements ConfigMapInterface
type configMaps struct { type configMaps struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newConfigMaps returns a ConfigMaps // newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreClient, namespace string) *configMaps { func newConfigMaps(c *CoreClient, namespace string) *configMaps {
return &configMaps{ return &configMaps{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -24,7 +24,7 @@ import (
) )
type CoreInterface interface { type CoreInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
ConfigMapsGetter ConfigMapsGetter
EventsGetter EventsGetter
NamespacesGetter NamespacesGetter
@ -34,7 +34,7 @@ type CoreInterface interface {
// CoreClient is used to interact with features provided by the Core group. // CoreClient is used to interact with features provided by the Core group.
type CoreClient struct { type CoreClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface { func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface {
@ -81,7 +81,7 @@ func NewForConfigOrDie(c *restclient.Config) *CoreClient {
} }
// New creates a new CoreClient for the given RESTClient. // New creates a new CoreClient for the given RESTClient.
func New(c *restclient.RESTClient) *CoreClient { func New(c restclient.Interface) *CoreClient {
return &CoreClient{c} return &CoreClient{c}
} }
@ -106,11 +106,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *CoreClient) GetRESTClient() *restclient.RESTClient { func (c *CoreClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -19,6 +19,7 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type EventInterface interface {
// events implements EventInterface // events implements EventInterface
type events struct { type events struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newEvents returns a Events // newEvents returns a Events
func newEvents(c *CoreClient, namespace string) *events { func newEvents(c *CoreClient, namespace string) *events {
return &events{ return &events{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -46,8 +46,9 @@ func (c *FakeCore) Services(namespace string) v1.ServiceInterface {
return &FakeServices{c, namespace} return &FakeServices{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. // with API server by this client implementation.
func (c *FakeCore) GetRESTClient() *restclient.RESTClient { func (c *FakeCore) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,13 +45,13 @@ type NamespaceInterface interface {
// namespaces implements NamespaceInterface // namespaces implements NamespaceInterface
type namespaces struct { type namespaces struct {
client *CoreClient client restclient.Interface
} }
// newNamespaces returns a Namespaces // newNamespaces returns a Namespaces
func newNamespaces(c *CoreClient) *namespaces { func newNamespaces(c *CoreClient) *namespaces {
return &namespaces{ return &namespaces{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -19,6 +19,7 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type SecretInterface interface {
// secrets implements SecretInterface // secrets implements SecretInterface
type secrets struct { type secrets struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newSecrets returns a Secrets // newSecrets returns a Secrets
func newSecrets(c *CoreClient, namespace string) *secrets { func newSecrets(c *CoreClient, namespace string) *secrets {
return &secrets{ return &secrets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type ServiceInterface interface {
// services implements ServiceInterface // services implements ServiceInterface
type services struct { type services struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newServices returns a Services // newServices returns a Services
func newServices(c *CoreClient, namespace string) *services { func newServices(c *CoreClient, namespace string) *services {
return &services{ return &services{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -20,6 +20,7 @@ import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -45,14 +46,14 @@ type DaemonSetInterface interface {
// daemonSets implements DaemonSetInterface // daemonSets implements DaemonSetInterface
type daemonSets struct { type daemonSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDaemonSets returns a DaemonSets // newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
return &daemonSets{ return &daemonSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -20,6 +20,7 @@ import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -45,14 +46,14 @@ type DeploymentInterface interface {
// deployments implements DeploymentInterface // deployments implements DeploymentInterface
type deployments struct { type deployments struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDeployments returns a Deployments // newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments { func newDeployments(c *ExtensionsClient, namespace string) *deployments {
return &deployments{ return &deployments{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -24,7 +24,7 @@ import (
) )
type ExtensionsInterface interface { type ExtensionsInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
DaemonSetsGetter DaemonSetsGetter
DeploymentsGetter DeploymentsGetter
IngressesGetter IngressesGetter
@ -33,7 +33,7 @@ type ExtensionsInterface interface {
// ExtensionsClient is used to interact with features provided by the Extensions group. // ExtensionsClient is used to interact with features provided by the Extensions group.
type ExtensionsClient struct { type ExtensionsClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface { func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
@ -76,7 +76,7 @@ func NewForConfigOrDie(c *restclient.Config) *ExtensionsClient {
} }
// New creates a new ExtensionsClient for the given RESTClient. // New creates a new ExtensionsClient for the given RESTClient.
func New(c *restclient.RESTClient) *ExtensionsClient { func New(c restclient.Interface) *ExtensionsClient {
return &ExtensionsClient{c} return &ExtensionsClient{c}
} }
@ -101,11 +101,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient { func (c *ExtensionsClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -42,8 +42,9 @@ func (c *FakeExtensions) ReplicaSets(namespace string) v1beta1.ReplicaSetInterfa
return &FakeReplicaSets{c, namespace} return &FakeReplicaSets{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. // with API server by this client implementation.
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient { func (c *FakeExtensions) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -20,6 +20,7 @@ import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -45,14 +46,14 @@ type IngressInterface interface {
// ingresses implements IngressInterface // ingresses implements IngressInterface
type ingresses struct { type ingresses struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newIngresses returns a Ingresses // newIngresses returns a Ingresses
func newIngresses(c *ExtensionsClient, namespace string) *ingresses { func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
return &ingresses{ return &ingresses{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -20,6 +20,7 @@ import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -45,14 +46,14 @@ type ReplicaSetInterface interface {
// replicaSets implements ReplicaSetInterface // replicaSets implements ReplicaSetInterface
type replicaSets struct { type replicaSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newReplicaSets returns a ReplicaSets // newReplicaSets returns a ReplicaSets
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
return &replicaSets{ return &replicaSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -20,6 +20,7 @@ import (
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -45,13 +46,13 @@ type ClusterInterface interface {
// clusters implements ClusterInterface // clusters implements ClusterInterface
type clusters struct { type clusters struct {
client *FederationClient client restclient.Interface
} }
// newClusters returns a Clusters // newClusters returns a Clusters
func newClusters(c *FederationClient) *clusters { func newClusters(c *FederationClient) *clusters {
return &clusters{ return &clusters{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -30,8 +30,9 @@ func (c *FakeFederation) Clusters() v1beta1.ClusterInterface {
return &FakeClusters{c} return &FakeClusters{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeFederation) GetRESTClient() *restclient.RESTClient { func (c *FakeFederation) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -24,13 +24,13 @@ import (
) )
type FederationInterface interface { type FederationInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
ClustersGetter ClustersGetter
} }
// FederationClient is used to interact with features provided by the Federation group. // FederationClient is used to interact with features provided by the Federation group.
type FederationClient struct { type FederationClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *FederationClient) Clusters() ClusterInterface { func (c *FederationClient) Clusters() ClusterInterface {
@ -61,7 +61,7 @@ func NewForConfigOrDie(c *restclient.Config) *FederationClient {
} }
// New creates a new FederationClient for the given RESTClient. // New creates a new FederationClient for the given RESTClient.
func New(c *restclient.RESTClient) *FederationClient { func New(c restclient.Interface) *FederationClient {
return &FederationClient{c} return &FederationClient{c}
} }
@ -86,11 +86,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *FederationClient) GetRESTClient() *restclient.RESTClient { func (c *FederationClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -99,7 +99,7 @@ func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterS
LastProbeTime: currentTime, LastProbeTime: currentTime,
LastTransitionTime: currentTime, LastTransitionTime: currentTime,
} }
body, err := self.discoveryClient.Get().AbsPath("/healthz").Do().Raw() body, err := self.discoveryClient.RESTClient().Get().AbsPath("/healthz").Do().Raw()
if err != nil { if err != nil {
clusterStatus.Conditions = append(clusterStatus.Conditions, newNodeOfflineCondition) clusterStatus.Conditions = append(clusterStatus.Conditions, newNodeOfflineCondition)
} else { } else {

View File

@ -242,7 +242,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
} }
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c *restclient.RESTClient) *Clientset { func New(c restclient.Interface) *Clientset {
var clientset Clientset var clientset Clientset
clientset.CoreClient = unversionedcore.New(c) clientset.CoreClient = unversionedcore.New(c)
clientset.AuthenticationClient = unversionedauthentication.New(c) clientset.AuthenticationClient = unversionedauthentication.New(c)

View File

@ -23,13 +23,13 @@ import (
) )
type AppsInterface interface { type AppsInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
PetSetsGetter PetSetsGetter
} }
// AppsClient is used to interact with features provided by the Apps group. // AppsClient is used to interact with features provided by the Apps group.
type AppsClient struct { type AppsClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *AppsClient) PetSets(namespace string) PetSetInterface { func (c *AppsClient) PetSets(namespace string) PetSetInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *AppsClient {
} }
// New creates a new AppsClient for the given RESTClient. // New creates a new AppsClient for the given RESTClient.
func New(c *restclient.RESTClient) *AppsClient { func New(c restclient.Interface) *AppsClient {
return &AppsClient{c} return &AppsClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *AppsClient) GetRESTClient() *restclient.RESTClient { func (c *AppsClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -30,8 +30,9 @@ func (c *FakeApps) PetSets(namespace string) unversioned.PetSetInterface {
return &FakePetSets{c, namespace} return &FakePetSets{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. // with API server by this client implementation.
func (c *FakeApps) GetRESTClient() *restclient.RESTClient { func (c *FakeApps) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
apps "k8s.io/kubernetes/pkg/apis/apps" apps "k8s.io/kubernetes/pkg/apis/apps"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type PetSetInterface interface {
// petSets implements PetSetInterface // petSets implements PetSetInterface
type petSets struct { type petSets struct {
client *AppsClient client restclient.Interface
ns string ns string
} }
// newPetSets returns a PetSets // newPetSets returns a PetSets
func newPetSets(c *AppsClient, namespace string) *petSets { func newPetSets(c *AppsClient, namespace string) *petSets {
return &petSets{ return &petSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,13 +23,13 @@ import (
) )
type AuthenticationInterface interface { type AuthenticationInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
TokenReviewsGetter TokenReviewsGetter
} }
// AuthenticationClient is used to interact with features provided by the Authentication group. // AuthenticationClient is used to interact with features provided by the Authentication group.
type AuthenticationClient struct { type AuthenticationClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *AuthenticationClient) TokenReviews() TokenReviewInterface { func (c *AuthenticationClient) TokenReviews() TokenReviewInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *AuthenticationClient {
} }
// New creates a new AuthenticationClient for the given RESTClient. // New creates a new AuthenticationClient for the given RESTClient.
func New(c *restclient.RESTClient) *AuthenticationClient { func New(c restclient.Interface) *AuthenticationClient {
return &AuthenticationClient{c} return &AuthenticationClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *AuthenticationClient) GetRESTClient() *restclient.RESTClient { func (c *AuthenticationClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -30,8 +30,9 @@ func (c *FakeAuthentication) TokenReviews() unversioned.TokenReviewInterface {
return &FakeTokenReviews{c} return &FakeTokenReviews{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeAuthentication) GetRESTClient() *restclient.RESTClient { func (c *FakeAuthentication) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -16,6 +16,10 @@ limitations under the License.
package unversioned package unversioned
import (
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// TokenReviewsGetter has a method to return a TokenReviewInterface. // TokenReviewsGetter has a method to return a TokenReviewInterface.
// A group's client should implement this interface. // A group's client should implement this interface.
type TokenReviewsGetter interface { type TokenReviewsGetter interface {
@ -29,12 +33,12 @@ type TokenReviewInterface interface {
// tokenReviews implements TokenReviewInterface // tokenReviews implements TokenReviewInterface
type tokenReviews struct { type tokenReviews struct {
client *AuthenticationClient client restclient.Interface
} }
// newTokenReviews returns a TokenReviews // newTokenReviews returns a TokenReviews
func newTokenReviews(c *AuthenticationClient) *tokenReviews { func newTokenReviews(c *AuthenticationClient) *tokenReviews {
return &tokenReviews{ return &tokenReviews{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -23,7 +23,7 @@ import (
) )
type AuthorizationInterface interface { type AuthorizationInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
LocalSubjectAccessReviewsGetter LocalSubjectAccessReviewsGetter
SelfSubjectAccessReviewsGetter SelfSubjectAccessReviewsGetter
SubjectAccessReviewsGetter SubjectAccessReviewsGetter
@ -31,7 +31,7 @@ type AuthorizationInterface interface {
// AuthorizationClient is used to interact with features provided by the Authorization group. // AuthorizationClient is used to interact with features provided by the Authorization group.
type AuthorizationClient struct { type AuthorizationClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *AuthorizationClient) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface { func (c *AuthorizationClient) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface {
@ -70,7 +70,7 @@ func NewForConfigOrDie(c *restclient.Config) *AuthorizationClient {
} }
// New creates a new AuthorizationClient for the given RESTClient. // New creates a new AuthorizationClient for the given RESTClient.
func New(c *restclient.RESTClient) *AuthorizationClient { func New(c restclient.Interface) *AuthorizationClient {
return &AuthorizationClient{c} return &AuthorizationClient{c}
} }
@ -99,11 +99,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *AuthorizationClient) GetRESTClient() *restclient.RESTClient { func (c *AuthorizationClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -38,8 +38,9 @@ func (c *FakeAuthorization) SubjectAccessReviews() unversioned.SubjectAccessRevi
return &FakeSubjectAccessReviews{c} return &FakeSubjectAccessReviews{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeAuthorization) GetRESTClient() *restclient.RESTClient { func (c *FakeAuthorization) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -16,6 +16,10 @@ limitations under the License.
package unversioned package unversioned
import (
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface. // LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface.
// A group's client should implement this interface. // A group's client should implement this interface.
type LocalSubjectAccessReviewsGetter interface { type LocalSubjectAccessReviewsGetter interface {
@ -29,14 +33,14 @@ type LocalSubjectAccessReviewInterface interface {
// localSubjectAccessReviews implements LocalSubjectAccessReviewInterface // localSubjectAccessReviews implements LocalSubjectAccessReviewInterface
type localSubjectAccessReviews struct { type localSubjectAccessReviews struct {
client *AuthorizationClient client restclient.Interface
ns string ns string
} }
// newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews
func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews { func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews {
return &localSubjectAccessReviews{ return &localSubjectAccessReviews{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -16,6 +16,10 @@ limitations under the License.
package unversioned package unversioned
import (
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface.
// A group's client should implement this interface. // A group's client should implement this interface.
type SelfSubjectAccessReviewsGetter interface { type SelfSubjectAccessReviewsGetter interface {
@ -29,12 +33,12 @@ type SelfSubjectAccessReviewInterface interface {
// selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface
type selfSubjectAccessReviews struct { type selfSubjectAccessReviews struct {
client *AuthorizationClient client restclient.Interface
} }
// newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews
func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews { func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews {
return &selfSubjectAccessReviews{ return &selfSubjectAccessReviews{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -16,6 +16,10 @@ limitations under the License.
package unversioned package unversioned
import (
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface.
// A group's client should implement this interface. // A group's client should implement this interface.
type SubjectAccessReviewsGetter interface { type SubjectAccessReviewsGetter interface {
@ -29,12 +33,12 @@ type SubjectAccessReviewInterface interface {
// subjectAccessReviews implements SubjectAccessReviewInterface // subjectAccessReviews implements SubjectAccessReviewInterface
type subjectAccessReviews struct { type subjectAccessReviews struct {
client *AuthorizationClient client restclient.Interface
} }
// newSubjectAccessReviews returns a SubjectAccessReviews // newSubjectAccessReviews returns a SubjectAccessReviews
func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews { func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews {
return &subjectAccessReviews{ return &subjectAccessReviews{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -23,13 +23,13 @@ import (
) )
type AutoscalingInterface interface { type AutoscalingInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
HorizontalPodAutoscalersGetter HorizontalPodAutoscalersGetter
} }
// AutoscalingClient is used to interact with features provided by the Autoscaling group. // AutoscalingClient is used to interact with features provided by the Autoscaling group.
type AutoscalingClient struct { type AutoscalingClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *AutoscalingClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { func (c *AutoscalingClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *AutoscalingClient {
} }
// New creates a new AutoscalingClient for the given RESTClient. // New creates a new AutoscalingClient for the given RESTClient.
func New(c *restclient.RESTClient) *AutoscalingClient { func New(c restclient.Interface) *AutoscalingClient {
return &AutoscalingClient{c} return &AutoscalingClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *AutoscalingClient) GetRESTClient() *restclient.RESTClient { func (c *AutoscalingClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -30,8 +30,9 @@ func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) unversioned
return &FakeHorizontalPodAutoscalers{c, namespace} return &FakeHorizontalPodAutoscalers{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. // with API server by this client implementation.
func (c *FakeAutoscaling) GetRESTClient() *restclient.RESTClient { func (c *FakeAutoscaling) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type HorizontalPodAutoscalerInterface interface {
// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
type horizontalPodAutoscalers struct { type horizontalPodAutoscalers struct {
client *AutoscalingClient client restclient.Interface
ns string ns string
} }
// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers
func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers { func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers {
return &horizontalPodAutoscalers{ return &horizontalPodAutoscalers{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,14 +23,14 @@ import (
) )
type BatchInterface interface { type BatchInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
JobsGetter JobsGetter
ScheduledJobsGetter ScheduledJobsGetter
} }
// BatchClient is used to interact with features provided by the Batch group. // BatchClient is used to interact with features provided by the Batch group.
type BatchClient struct { type BatchClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *BatchClient) Jobs(namespace string) JobInterface { func (c *BatchClient) Jobs(namespace string) JobInterface {
@ -65,7 +65,7 @@ func NewForConfigOrDie(c *restclient.Config) *BatchClient {
} }
// New creates a new BatchClient for the given RESTClient. // New creates a new BatchClient for the given RESTClient.
func New(c *restclient.RESTClient) *BatchClient { func New(c restclient.Interface) *BatchClient {
return &BatchClient{c} return &BatchClient{c}
} }
@ -94,11 +94,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *BatchClient) GetRESTClient() *restclient.RESTClient { func (c *BatchClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -34,8 +34,9 @@ func (c *FakeBatch) ScheduledJobs(namespace string) unversioned.ScheduledJobInte
return &FakeScheduledJobs{c, namespace} return &FakeScheduledJobs{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. // with API server by this client implementation.
func (c *FakeBatch) GetRESTClient() *restclient.RESTClient { func (c *FakeBatch) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
batch "k8s.io/kubernetes/pkg/apis/batch" batch "k8s.io/kubernetes/pkg/apis/batch"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type JobInterface interface {
// jobs implements JobInterface // jobs implements JobInterface
type jobs struct { type jobs struct {
client *BatchClient client restclient.Interface
ns string ns string
} }
// newJobs returns a Jobs // newJobs returns a Jobs
func newJobs(c *BatchClient, namespace string) *jobs { func newJobs(c *BatchClient, namespace string) *jobs {
return &jobs{ return &jobs{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
batch "k8s.io/kubernetes/pkg/apis/batch" batch "k8s.io/kubernetes/pkg/apis/batch"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type ScheduledJobInterface interface {
// scheduledJobs implements ScheduledJobInterface // scheduledJobs implements ScheduledJobInterface
type scheduledJobs struct { type scheduledJobs struct {
client *BatchClient client restclient.Interface
ns string ns string
} }
// newScheduledJobs returns a ScheduledJobs // newScheduledJobs returns a ScheduledJobs
func newScheduledJobs(c *BatchClient, namespace string) *scheduledJobs { func newScheduledJobs(c *BatchClient, namespace string) *scheduledJobs {
return &scheduledJobs{ return &scheduledJobs{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,13 +23,13 @@ import (
) )
type CertificatesInterface interface { type CertificatesInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
CertificateSigningRequestsGetter CertificateSigningRequestsGetter
} }
// CertificatesClient is used to interact with features provided by the Certificates group. // CertificatesClient is used to interact with features provided by the Certificates group.
type CertificatesClient struct { type CertificatesClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface { func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *CertificatesClient {
} }
// New creates a new CertificatesClient for the given RESTClient. // New creates a new CertificatesClient for the given RESTClient.
func New(c *restclient.RESTClient) *CertificatesClient { func New(c restclient.Interface) *CertificatesClient {
return &CertificatesClient{c} return &CertificatesClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *CertificatesClient) GetRESTClient() *restclient.RESTClient { func (c *CertificatesClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
certificates "k8s.io/kubernetes/pkg/apis/certificates" certificates "k8s.io/kubernetes/pkg/apis/certificates"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,13 +45,13 @@ type CertificateSigningRequestInterface interface {
// certificateSigningRequests implements CertificateSigningRequestInterface // certificateSigningRequests implements CertificateSigningRequestInterface
type certificateSigningRequests struct { type certificateSigningRequests struct {
client *CertificatesClient client restclient.Interface
} }
// newCertificateSigningRequests returns a CertificateSigningRequests // newCertificateSigningRequests returns a CertificateSigningRequests
func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests { func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests {
return &certificateSigningRequests{ return &certificateSigningRequests{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -30,8 +30,9 @@ func (c *FakeCertificates) CertificateSigningRequests() unversioned.CertificateS
return &FakeCertificateSigningRequests{c} return &FakeCertificateSigningRequests{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeCertificates) GetRESTClient() *restclient.RESTClient { func (c *FakeCertificates) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,13 +43,13 @@ type ComponentStatusInterface interface {
// componentStatuses implements ComponentStatusInterface // componentStatuses implements ComponentStatusInterface
type componentStatuses struct { type componentStatuses struct {
client *CoreClient client restclient.Interface
} }
// newComponentStatuses returns a ComponentStatuses // newComponentStatuses returns a ComponentStatuses
func newComponentStatuses(c *CoreClient) *componentStatuses { func newComponentStatuses(c *CoreClient) *componentStatuses {
return &componentStatuses{ return &componentStatuses{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type ConfigMapInterface interface {
// configMaps implements ConfigMapInterface // configMaps implements ConfigMapInterface
type configMaps struct { type configMaps struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newConfigMaps returns a ConfigMaps // newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreClient, namespace string) *configMaps { func newConfigMaps(c *CoreClient, namespace string) *configMaps {
return &configMaps{ return &configMaps{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,7 +23,7 @@ import (
) )
type CoreInterface interface { type CoreInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
ComponentStatusesGetter ComponentStatusesGetter
ConfigMapsGetter ConfigMapsGetter
EndpointsGetter EndpointsGetter
@ -44,7 +44,7 @@ type CoreInterface interface {
// CoreClient is used to interact with features provided by the Core group. // CoreClient is used to interact with features provided by the Core group.
type CoreClient struct { type CoreClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *CoreClient) ComponentStatuses() ComponentStatusInterface { func (c *CoreClient) ComponentStatuses() ComponentStatusInterface {
@ -135,7 +135,7 @@ func NewForConfigOrDie(c *restclient.Config) *CoreClient {
} }
// New creates a new CoreClient for the given RESTClient. // New creates a new CoreClient for the given RESTClient.
func New(c *restclient.RESTClient) *CoreClient { func New(c restclient.Interface) *CoreClient {
return &CoreClient{c} return &CoreClient{c}
} }
@ -164,11 +164,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *CoreClient) GetRESTClient() *restclient.RESTClient { func (c *CoreClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type EndpointsInterface interface {
// endpoints implements EndpointsInterface // endpoints implements EndpointsInterface
type endpoints struct { type endpoints struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newEndpoints returns a Endpoints // newEndpoints returns a Endpoints
func newEndpoints(c *CoreClient, namespace string) *endpoints { func newEndpoints(c *CoreClient, namespace string) *endpoints {
return &endpoints{ return &endpoints{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type EventInterface interface {
// events implements EventInterface // events implements EventInterface
type events struct { type events struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newEvents returns a Events // newEvents returns a Events
func newEvents(c *CoreClient, namespace string) *events { func newEvents(c *CoreClient, namespace string) *events {
return &events{ return &events{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -90,8 +90,9 @@ func (c *FakeCore) ServiceAccounts(namespace string) unversioned.ServiceAccountI
return &FakeServiceAccounts{c, namespace} return &FakeServiceAccounts{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. // with API server by this client implementation.
func (c *FakeCore) GetRESTClient() *restclient.RESTClient { func (c *FakeCore) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type LimitRangeInterface interface {
// limitRanges implements LimitRangeInterface // limitRanges implements LimitRangeInterface
type limitRanges struct { type limitRanges struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newLimitRanges returns a LimitRanges // newLimitRanges returns a LimitRanges
func newLimitRanges(c *CoreClient, namespace string) *limitRanges { func newLimitRanges(c *CoreClient, namespace string) *limitRanges {
return &limitRanges{ return &limitRanges{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type NamespaceInterface interface {
// namespaces implements NamespaceInterface // namespaces implements NamespaceInterface
type namespaces struct { type namespaces struct {
client *CoreClient client restclient.Interface
} }
// newNamespaces returns a Namespaces // newNamespaces returns a Namespaces
func newNamespaces(c *CoreClient) *namespaces { func newNamespaces(c *CoreClient) *namespaces {
return &namespaces{ return &namespaces{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type NodeInterface interface {
// nodes implements NodeInterface // nodes implements NodeInterface
type nodes struct { type nodes struct {
client *CoreClient client restclient.Interface
} }
// newNodes returns a Nodes // newNodes returns a Nodes
func newNodes(c *CoreClient) *nodes { func newNodes(c *CoreClient) *nodes {
return &nodes{ return &nodes{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type PersistentVolumeInterface interface {
// persistentVolumes implements PersistentVolumeInterface // persistentVolumes implements PersistentVolumeInterface
type persistentVolumes struct { type persistentVolumes struct {
client *CoreClient client restclient.Interface
} }
// newPersistentVolumes returns a PersistentVolumes // newPersistentVolumes returns a PersistentVolumes
func newPersistentVolumes(c *CoreClient) *persistentVolumes { func newPersistentVolumes(c *CoreClient) *persistentVolumes {
return &persistentVolumes{ return &persistentVolumes{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type PersistentVolumeClaimInterface interface {
// persistentVolumeClaims implements PersistentVolumeClaimInterface // persistentVolumeClaims implements PersistentVolumeClaimInterface
type persistentVolumeClaims struct { type persistentVolumeClaims struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newPersistentVolumeClaims returns a PersistentVolumeClaims // newPersistentVolumeClaims returns a PersistentVolumeClaims
func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims { func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims {
return &persistentVolumeClaims{ return &persistentVolumeClaims{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type PodInterface interface {
// pods implements PodInterface // pods implements PodInterface
type pods struct { type pods struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newPods returns a Pods // newPods returns a Pods
func newPods(c *CoreClient, namespace string) *pods { func newPods(c *CoreClient, namespace string) *pods {
return &pods{ return &pods{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type PodTemplateInterface interface {
// podTemplates implements PodTemplateInterface // podTemplates implements PodTemplateInterface
type podTemplates struct { type podTemplates struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newPodTemplates returns a PodTemplates // newPodTemplates returns a PodTemplates
func newPodTemplates(c *CoreClient, namespace string) *podTemplates { func newPodTemplates(c *CoreClient, namespace string) *podTemplates {
return &podTemplates{ return &podTemplates{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type ReplicationControllerInterface interface {
// replicationControllers implements ReplicationControllerInterface // replicationControllers implements ReplicationControllerInterface
type replicationControllers struct { type replicationControllers struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newReplicationControllers returns a ReplicationControllers // newReplicationControllers returns a ReplicationControllers
func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers { func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers {
return &replicationControllers{ return &replicationControllers{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type ResourceQuotaInterface interface {
// resourceQuotas implements ResourceQuotaInterface // resourceQuotas implements ResourceQuotaInterface
type resourceQuotas struct { type resourceQuotas struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newResourceQuotas returns a ResourceQuotas // newResourceQuotas returns a ResourceQuotas
func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas { func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas {
return &resourceQuotas{ return &resourceQuotas{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type SecretInterface interface {
// secrets implements SecretInterface // secrets implements SecretInterface
type secrets struct { type secrets struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newSecrets returns a Secrets // newSecrets returns a Secrets
func newSecrets(c *CoreClient, namespace string) *secrets { func newSecrets(c *CoreClient, namespace string) *secrets {
return &secrets{ return &secrets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type ServiceInterface interface {
// services implements ServiceInterface // services implements ServiceInterface
type services struct { type services struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newServices returns a Services // newServices returns a Services
func newServices(c *CoreClient, namespace string) *services { func newServices(c *CoreClient, namespace string) *services {
return &services{ return &services{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -18,6 +18,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -42,14 +43,14 @@ type ServiceAccountInterface interface {
// serviceAccounts implements ServiceAccountInterface // serviceAccounts implements ServiceAccountInterface
type serviceAccounts struct { type serviceAccounts struct {
client *CoreClient client restclient.Interface
ns string ns string
} }
// newServiceAccounts returns a ServiceAccounts // newServiceAccounts returns a ServiceAccounts
func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts { func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts {
return &serviceAccounts{ return &serviceAccounts{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type DaemonSetInterface interface {
// daemonSets implements DaemonSetInterface // daemonSets implements DaemonSetInterface
type daemonSets struct { type daemonSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDaemonSets returns a DaemonSets // newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
return &daemonSets{ return &daemonSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type DeploymentInterface interface {
// deployments implements DeploymentInterface // deployments implements DeploymentInterface
type deployments struct { type deployments struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newDeployments returns a Deployments // newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments { func newDeployments(c *ExtensionsClient, namespace string) *deployments {
return &deployments{ return &deployments{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,7 +23,7 @@ import (
) )
type ExtensionsInterface interface { type ExtensionsInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
DaemonSetsGetter DaemonSetsGetter
DeploymentsGetter DeploymentsGetter
IngressesGetter IngressesGetter
@ -36,7 +36,7 @@ type ExtensionsInterface interface {
// ExtensionsClient is used to interact with features provided by the Extensions group. // ExtensionsClient is used to interact with features provided by the Extensions group.
type ExtensionsClient struct { type ExtensionsClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface { func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
@ -95,7 +95,7 @@ func NewForConfigOrDie(c *restclient.Config) *ExtensionsClient {
} }
// New creates a new ExtensionsClient for the given RESTClient. // New creates a new ExtensionsClient for the given RESTClient.
func New(c *restclient.RESTClient) *ExtensionsClient { func New(c restclient.Interface) *ExtensionsClient {
return &ExtensionsClient{c} return &ExtensionsClient{c}
} }
@ -124,11 +124,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient { func (c *ExtensionsClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -58,8 +58,9 @@ func (c *FakeExtensions) ThirdPartyResources() unversioned.ThirdPartyResourceInt
return &FakeThirdPartyResources{c} return &FakeThirdPartyResources{c}
} }
// 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. // with API server by this client implementation.
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient { func (c *FakeExtensions) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type IngressInterface interface {
// ingresses implements IngressInterface // ingresses implements IngressInterface
type ingresses struct { type ingresses struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newIngresses returns a Ingresses // newIngresses returns a Ingresses
func newIngresses(c *ExtensionsClient, namespace string) *ingresses { func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
return &ingresses{ return &ingresses{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,14 +44,14 @@ type NetworkPolicyInterface interface {
// networkPolicies implements NetworkPolicyInterface // networkPolicies implements NetworkPolicyInterface
type networkPolicies struct { type networkPolicies struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newNetworkPolicies returns a NetworkPolicies // newNetworkPolicies returns a NetworkPolicies
func newNetworkPolicies(c *ExtensionsClient, namespace string) *networkPolicies { func newNetworkPolicies(c *ExtensionsClient, namespace string) *networkPolicies {
return &networkPolicies{ return &networkPolicies{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type PodSecurityPolicyInterface interface {
// podSecurityPolicies implements PodSecurityPolicyInterface // podSecurityPolicies implements PodSecurityPolicyInterface
type podSecurityPolicies struct { type podSecurityPolicies struct {
client *ExtensionsClient client restclient.Interface
} }
// newPodSecurityPolicies returns a PodSecurityPolicies // newPodSecurityPolicies returns a PodSecurityPolicies
func newPodSecurityPolicies(c *ExtensionsClient) *podSecurityPolicies { func newPodSecurityPolicies(c *ExtensionsClient) *podSecurityPolicies {
return &podSecurityPolicies{ return &podSecurityPolicies{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type ReplicaSetInterface interface {
// replicaSets implements ReplicaSetInterface // replicaSets implements ReplicaSetInterface
type replicaSets struct { type replicaSets struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newReplicaSets returns a ReplicaSets // newReplicaSets returns a ReplicaSets
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
return &replicaSets{ return &replicaSets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -16,6 +16,10 @@ limitations under the License.
package unversioned package unversioned
import (
restclient "k8s.io/kubernetes/pkg/client/restclient"
)
// ScalesGetter has a method to return a ScaleInterface. // ScalesGetter has a method to return a ScaleInterface.
// A group's client should implement this interface. // A group's client should implement this interface.
type ScalesGetter interface { type ScalesGetter interface {
@ -29,14 +33,14 @@ type ScaleInterface interface {
// scales implements ScaleInterface // scales implements ScaleInterface
type scales struct { type scales struct {
client *ExtensionsClient client restclient.Interface
ns string ns string
} }
// newScales returns a Scales // newScales returns a Scales
func newScales(c *ExtensionsClient, namespace string) *scales { func newScales(c *ExtensionsClient, namespace string) *scales {
return &scales{ return &scales{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions" extensions "k8s.io/kubernetes/pkg/apis/extensions"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type ThirdPartyResourceInterface interface {
// thirdPartyResources implements ThirdPartyResourceInterface // thirdPartyResources implements ThirdPartyResourceInterface
type thirdPartyResources struct { type thirdPartyResources struct {
client *ExtensionsClient client restclient.Interface
} }
// newThirdPartyResources returns a ThirdPartyResources // newThirdPartyResources returns a ThirdPartyResources
func newThirdPartyResources(c *ExtensionsClient) *thirdPartyResources { func newThirdPartyResources(c *ExtensionsClient) *thirdPartyResources {
return &thirdPartyResources{ return &thirdPartyResources{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -30,8 +30,9 @@ func (c *FakePolicy) PodDisruptionBudgets(namespace string) unversioned.PodDisru
return &FakePodDisruptionBudgets{c, namespace} return &FakePodDisruptionBudgets{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. // with API server by this client implementation.
func (c *FakePolicy) GetRESTClient() *restclient.RESTClient { func (c *FakePolicy) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
policy "k8s.io/kubernetes/pkg/apis/policy" policy "k8s.io/kubernetes/pkg/apis/policy"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -44,14 +45,14 @@ type PodDisruptionBudgetInterface interface {
// podDisruptionBudgets implements PodDisruptionBudgetInterface // podDisruptionBudgets implements PodDisruptionBudgetInterface
type podDisruptionBudgets struct { type podDisruptionBudgets struct {
client *PolicyClient client restclient.Interface
ns string ns string
} }
// newPodDisruptionBudgets returns a PodDisruptionBudgets // newPodDisruptionBudgets returns a PodDisruptionBudgets
func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets { func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets {
return &podDisruptionBudgets{ return &podDisruptionBudgets{
client: c, client: c.RESTClient(),
ns: namespace, ns: namespace,
} }
} }

View File

@ -23,13 +23,13 @@ import (
) )
type PolicyInterface interface { type PolicyInterface interface {
GetRESTClient() *restclient.RESTClient RESTClient() restclient.Interface
PodDisruptionBudgetsGetter PodDisruptionBudgetsGetter
} }
// PolicyClient is used to interact with features provided by the Policy group. // PolicyClient is used to interact with features provided by the Policy group.
type PolicyClient struct { type PolicyClient struct {
*restclient.RESTClient restClient restclient.Interface
} }
func (c *PolicyClient) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { func (c *PolicyClient) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface {
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *PolicyClient {
} }
// New creates a new PolicyClient for the given RESTClient. // New creates a new PolicyClient for the given RESTClient.
func New(c *restclient.RESTClient) *PolicyClient { func New(c restclient.Interface) *PolicyClient {
return &PolicyClient{c} return &PolicyClient{c}
} }
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
return nil 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. // with API server by this client implementation.
func (c *PolicyClient) GetRESTClient() *restclient.RESTClient { func (c *PolicyClient) RESTClient() restclient.Interface {
if c == nil { if c == nil {
return nil return nil
} }
return c.RESTClient return c.restClient
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
rbac "k8s.io/kubernetes/pkg/apis/rbac" rbac "k8s.io/kubernetes/pkg/apis/rbac"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type ClusterRoleInterface interface {
// clusterRoles implements ClusterRoleInterface // clusterRoles implements ClusterRoleInterface
type clusterRoles struct { type clusterRoles struct {
client *RbacClient client restclient.Interface
} }
// newClusterRoles returns a ClusterRoles // newClusterRoles returns a ClusterRoles
func newClusterRoles(c *RbacClient) *clusterRoles { func newClusterRoles(c *RbacClient) *clusterRoles {
return &clusterRoles{ return &clusterRoles{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -19,6 +19,7 @@ package unversioned
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
rbac "k8s.io/kubernetes/pkg/apis/rbac" rbac "k8s.io/kubernetes/pkg/apis/rbac"
restclient "k8s.io/kubernetes/pkg/client/restclient"
watch "k8s.io/kubernetes/pkg/watch" watch "k8s.io/kubernetes/pkg/watch"
) )
@ -43,13 +44,13 @@ type ClusterRoleBindingInterface interface {
// clusterRoleBindings implements ClusterRoleBindingInterface // clusterRoleBindings implements ClusterRoleBindingInterface
type clusterRoleBindings struct { type clusterRoleBindings struct {
client *RbacClient client restclient.Interface
} }
// newClusterRoleBindings returns a ClusterRoleBindings // newClusterRoleBindings returns a ClusterRoleBindings
func newClusterRoleBindings(c *RbacClient) *clusterRoleBindings { func newClusterRoleBindings(c *RbacClient) *clusterRoleBindings {
return &clusterRoleBindings{ return &clusterRoleBindings{
client: c, client: c.RESTClient(),
} }
} }

View File

@ -42,8 +42,9 @@ func (c *FakeRbac) RoleBindings(namespace string) unversioned.RoleBindingInterfa
return &FakeRoleBindings{c, namespace} return &FakeRoleBindings{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. // with API server by this client implementation.
func (c *FakeRbac) GetRESTClient() *restclient.RESTClient { func (c *FakeRbac) RESTClient() restclient.Interface {
return nil var ret *restclient.RESTClient
return ret
} }

Some files were not shown because too many files have changed in this diff Show More