mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Update clientset generator to use RESTClient interface instead of the RESTClient data type
This commit is contained in:
parent
c8004a1b7b
commit
6079053407
@ -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 pkgRESTClient = "k8s.io/kubernetes/pkg/client/restclient"
|
||||
m := map[string]interface{}{
|
||||
"group": g.group,
|
||||
"Group": namer.IC(g.group),
|
||||
"Fake": c.Universe.Type(types.Name{Package: pkgTestingCore, Name: "Fake"}),
|
||||
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}),
|
||||
"group": g.group,
|
||||
"Group": namer.IC(g.group),
|
||||
"Fake": c.Universe.Type(types.Name{Package: pkgTestingCore, Name: "Fake"}),
|
||||
"RESTClientInterface": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Interface"}),
|
||||
"RESTClient": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "RESTClient"}),
|
||||
}
|
||||
sw.Do(groupClientTemplate, m)
|
||||
for _, t := range g.types {
|
||||
@ -103,9 +104,10 @@ func (c *Fake$.Group$) $.type|publicPlural$() $.realClientPackage$.$.type|public
|
||||
`
|
||||
|
||||
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.
|
||||
func (c *Fake$.Group$) GetRESTClient() *$.RESTClient|raw$ {
|
||||
return nil
|
||||
func (c *Fake$.Group$) RESTClient() $.RESTClientInterface|raw$ {
|
||||
var ret *$.RESTClient|raw$
|
||||
return ret
|
||||
}
|
||||
`
|
||||
|
@ -92,7 +92,7 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr
|
||||
"allGroups": allGroups,
|
||||
"Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}),
|
||||
"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"}),
|
||||
"DiscoveryClient": c.Universe.Type(types.Name{Package: pkgDiscovery, Name: "DiscoveryClient"}),
|
||||
"NewDiscoveryClientForConfig": c.Universe.Function(types.Name{Package: pkgDiscovery, Name: "NewDiscoveryClientForConfig"}),
|
||||
@ -183,7 +183,7 @@ $end$
|
||||
|
||||
var newClientsetForRESTClientTemplate = `
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c *$.RESTClient|raw$) *Clientset {
|
||||
func New(c $.RESTClientInterface|raw$) *Clientset {
|
||||
var clientset Clientset
|
||||
$range .allGroups$ clientset.$.Group$Client =$.PackageName$.New(c)
|
||||
$end$
|
||||
|
@ -89,7 +89,7 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer
|
||||
"types": g.types,
|
||||
"Config": c.Universe.Type(types.Name{Package: pkgRESTClient, Name: "Config"}),
|
||||
"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"}),
|
||||
"latestGroup": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "Group"}),
|
||||
"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 = `
|
||||
type $.Group$Interface interface {
|
||||
GetRESTClient() *$.RESTClient|raw$
|
||||
RESTClient() $.RESTClientInterface|raw$
|
||||
$range .types$ $.|publicPlural$Getter
|
||||
$end$
|
||||
}
|
||||
@ -137,7 +137,7 @@ type $.Group$Interface interface {
|
||||
var groupClientTemplate = `
|
||||
// $.Group$Client is used to interact with features provided by the $.Group$ group.
|
||||
type $.Group$Client struct {
|
||||
*$.RESTClient|raw$
|
||||
restClient $.RESTClientInterface|raw$
|
||||
}
|
||||
`
|
||||
|
||||
@ -181,19 +181,19 @@ func NewForConfigOrDie(c *$.Config|raw$) *$.Group$Client {
|
||||
`
|
||||
|
||||
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.
|
||||
func (c *$.Group$Client) GetRESTClient() *$.RESTClient|raw$ {
|
||||
func (c *$.Group$Client) RESTClient() $.RESTClientInterface|raw$ {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
`
|
||||
|
||||
var newClientForRESTClientTemplate = `
|
||||
// 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}
|
||||
}
|
||||
`
|
||||
|
@ -69,14 +69,15 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
|
||||
pkg := filepath.Base(t.Name.Package)
|
||||
namespaced := !extractBoolTagOrDie("nonNamespaced", t.SecondClosestCommentLines)
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
"package": pkg,
|
||||
"Package": namer.IC(pkg),
|
||||
"Group": namer.IC(g.group),
|
||||
"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"}),
|
||||
"PatchType": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "PatchType"}),
|
||||
"namespaced": namespaced,
|
||||
"type": t,
|
||||
"package": pkg,
|
||||
"Package": namer.IC(pkg),
|
||||
"Group": namer.IC(g.group),
|
||||
"watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/watch", Name: "Interface"}),
|
||||
"RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/client/restclient", Name: "Interface"}),
|
||||
"apiParameterCodec": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ParameterCodec"}),
|
||||
"PatchType": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "PatchType"}),
|
||||
"namespaced": namespaced,
|
||||
}
|
||||
|
||||
if g.version == "unversioned" {
|
||||
@ -134,7 +135,7 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
|
||||
|
||||
// group client will implement this interface.
|
||||
var getterComment = `
|
||||
// $.type|publicPlural$Getter has a method to return a $.type|public$Interface.
|
||||
// $.type|publicPlural$Getter has a method to return a $.type|public$Interface.
|
||||
// A group's client should implement this interface.`
|
||||
|
||||
var getterNamesapced = `
|
||||
@ -179,7 +180,7 @@ var interfaceTemplate4 = `
|
||||
var structNamespaced = `
|
||||
// $.type|privatePlural$ implements $.type|public$Interface
|
||||
type $.type|privatePlural$ struct {
|
||||
client *$.Group$Client
|
||||
client $.RESTClientInterface|raw$
|
||||
ns string
|
||||
}
|
||||
`
|
||||
@ -188,7 +189,7 @@ type $.type|privatePlural$ struct {
|
||||
var structNonNamespaced = `
|
||||
// $.type|privatePlural$ implements $.type|public$Interface
|
||||
type $.type|privatePlural$ struct {
|
||||
client *$.Group$Client
|
||||
client $.RESTClientInterface|raw$
|
||||
}
|
||||
`
|
||||
|
||||
@ -196,7 +197,7 @@ var newStructNamespaced = `
|
||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||
func new$.type|publicPlural$(c *$.Group$Client, namespace string) *$.type|privatePlural$ {
|
||||
return &$.type|privatePlural${
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
@ -206,7 +207,7 @@ var newStructNonNamespaced = `
|
||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||
func new$.type|publicPlural$(c *$.Group$Client) *$.type|privatePlural$ {
|
||||
return &$.type|privatePlural${
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
`
|
||||
|
@ -82,7 +82,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *Clientset {
|
||||
func New(c restclient.Interface) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.TestgroupClient = unversionedtestgroup.New(c)
|
||||
|
||||
|
@ -35,7 +35,7 @@ func ClientSetRateLimiterTest(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("creating clientset for config %v failed: %v", config, err)
|
||||
}
|
||||
testGroupThrottler := clientSet.Testgroup().GetRESTClient().GetRateLimiter()
|
||||
testGroupThrottler := clientSet.Testgroup().RESTClient().GetRateLimiter()
|
||||
|
||||
if rateLimiter != testGroupThrottler {
|
||||
t.Errorf("Clients in client set should use rateLimiter passed in config:\noriginal: %v\ntestGroup: %v", rateLimiter, testGroupThrottler)
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeTestgroup) TestTypes(namespace string) unversioned.TestTypeInterfac
|
||||
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.
|
||||
func (c *FakeTestgroup) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeTestgroup) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type TestgroupInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
TestTypesGetter
|
||||
}
|
||||
|
||||
// TestgroupClient is used to interact with features provided by the Testgroup group.
|
||||
type TestgroupClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *TestgroupClient {
|
||||
func New(c restclient.Interface) *TestgroupClient {
|
||||
return &TestgroupClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *TestgroupClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *TestgroupClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
testgroup_k8s_io "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup.k8s.io"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type TestTypeInterface interface {
|
||||
|
||||
// testTypes implements TestTypeInterface
|
||||
type testTypes struct {
|
||||
client *TestgroupClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newTestTypes returns a TestTypes
|
||||
func newTestTypes(c *TestgroupClient, namespace string) *testTypes {
|
||||
return &testTypes{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *Clientset {
|
||||
func New(c restclient.Interface) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.FederationClient = unversionedfederation.New(c)
|
||||
clientset.CoreClient = unversionedcore.New(c)
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type ConfigMapInterface interface {
|
||||
|
||||
// configMaps implements ConfigMapInterface
|
||||
type configMaps struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newConfigMaps returns a ConfigMaps
|
||||
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
|
||||
return &configMaps{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type CoreInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
ConfigMapsGetter
|
||||
EventsGetter
|
||||
NamespacesGetter
|
||||
@ -33,7 +33,7 @@ type CoreInterface interface {
|
||||
|
||||
// CoreClient is used to interact with features provided by the Core group.
|
||||
type CoreClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *CoreClient {
|
||||
func New(c restclient.Interface) *CoreClient {
|
||||
return &CoreClient{c}
|
||||
}
|
||||
|
||||
@ -109,11 +109,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CoreClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *CoreClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type EventInterface interface {
|
||||
|
||||
// events implements EventInterface
|
||||
type events struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEvents returns a Events
|
||||
func newEvents(c *CoreClient, namespace string) *events {
|
||||
return &events{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,9 @@ func (c *FakeCore) Services(namespace string) unversioned.ServiceInterface {
|
||||
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.
|
||||
func (c *FakeCore) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeCore) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type NamespaceInterface interface {
|
||||
|
||||
// namespaces implements NamespaceInterface
|
||||
type namespaces struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newNamespaces returns a Namespaces
|
||||
func newNamespaces(c *CoreClient) *namespaces {
|
||||
return &namespaces{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type SecretInterface interface {
|
||||
|
||||
// secrets implements SecretInterface
|
||||
type secrets struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSecrets returns a Secrets
|
||||
func newSecrets(c *CoreClient, namespace string) *secrets {
|
||||
return &secrets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type ServiceInterface interface {
|
||||
|
||||
// services implements ServiceInterface
|
||||
type services struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServices returns a Services
|
||||
func newServices(c *CoreClient, namespace string) *services {
|
||||
return &services{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type DaemonSetInterface interface {
|
||||
|
||||
// daemonSets implements DaemonSetInterface
|
||||
type daemonSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDaemonSets returns a DaemonSets
|
||||
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
return &daemonSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type DeploymentInterface interface {
|
||||
|
||||
// deployments implements DeploymentInterface
|
||||
type deployments struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeployments returns a Deployments
|
||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||
return &deployments{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type ExtensionsInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
DaemonSetsGetter
|
||||
DeploymentsGetter
|
||||
IngressesGetter
|
||||
@ -32,7 +32,7 @@ type ExtensionsInterface interface {
|
||||
|
||||
// ExtensionsClient is used to interact with features provided by the Extensions group.
|
||||
type ExtensionsClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *ExtensionsClient {
|
||||
func New(c restclient.Interface) *ExtensionsClient {
|
||||
return &ExtensionsClient{c}
|
||||
}
|
||||
|
||||
@ -104,11 +104,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *ExtensionsClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -42,8 +42,9 @@ func (c *FakeExtensions) ReplicaSets(namespace string) unversioned.ReplicaSetInt
|
||||
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.
|
||||
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeExtensions) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type IngressInterface interface {
|
||||
|
||||
// ingresses implements IngressInterface
|
||||
type ingresses struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newIngresses returns a Ingresses
|
||||
func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
|
||||
return &ingresses{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type ReplicaSetInterface interface {
|
||||
|
||||
// replicaSets implements ReplicaSetInterface
|
||||
type replicaSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newReplicaSets returns a ReplicaSets
|
||||
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
|
||||
return &replicaSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
federation "k8s.io/kubernetes/federation/apis/federation"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,13 +45,13 @@ type ClusterInterface interface {
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client *FederationClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *FederationClient) *clusters {
|
||||
return &clusters{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeFederation) Clusters() unversioned.ClusterInterface {
|
||||
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.
|
||||
func (c *FakeFederation) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeFederation) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type FederationInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
ClustersGetter
|
||||
}
|
||||
|
||||
// FederationClient is used to interact with features provided by the Federation group.
|
||||
type FederationClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *FederationClient) Clusters() ClusterInterface {
|
||||
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *FederationClient {
|
||||
}
|
||||
|
||||
// New creates a new FederationClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *FederationClient {
|
||||
func New(c restclient.Interface) *FederationClient {
|
||||
return &FederationClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FederationClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *FederationClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *Clientset {
|
||||
func New(c restclient.Interface) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.FederationClient = v1beta1federation.New(c)
|
||||
clientset.CoreClient = v1core.New(c)
|
||||
|
@ -19,6 +19,7 @@ package v1
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type ConfigMapInterface interface {
|
||||
|
||||
// configMaps implements ConfigMapInterface
|
||||
type configMaps struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newConfigMaps returns a ConfigMaps
|
||||
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
|
||||
return &configMaps{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
type CoreInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
ConfigMapsGetter
|
||||
EventsGetter
|
||||
NamespacesGetter
|
||||
@ -34,7 +34,7 @@ type CoreInterface interface {
|
||||
|
||||
// CoreClient is used to interact with features provided by the Core group.
|
||||
type CoreClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *CoreClient {
|
||||
func New(c restclient.Interface) *CoreClient {
|
||||
return &CoreClient{c}
|
||||
}
|
||||
|
||||
@ -106,11 +106,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CoreClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *CoreClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package v1
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type EventInterface interface {
|
||||
|
||||
// events implements EventInterface
|
||||
type events struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEvents returns a Events
|
||||
func newEvents(c *CoreClient, namespace string) *events {
|
||||
return &events{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,9 @@ func (c *FakeCore) Services(namespace string) v1.ServiceInterface {
|
||||
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.
|
||||
func (c *FakeCore) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeCore) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package v1
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,13 +45,13 @@ type NamespaceInterface interface {
|
||||
|
||||
// namespaces implements NamespaceInterface
|
||||
type namespaces struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newNamespaces returns a Namespaces
|
||||
func newNamespaces(c *CoreClient) *namespaces {
|
||||
return &namespaces{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ package v1
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type SecretInterface interface {
|
||||
|
||||
// secrets implements SecretInterface
|
||||
type secrets struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSecrets returns a Secrets
|
||||
func newSecrets(c *CoreClient, namespace string) *secrets {
|
||||
return &secrets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package v1
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type ServiceInterface interface {
|
||||
|
||||
// services implements ServiceInterface
|
||||
type services struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServices returns a Services
|
||||
func newServices(c *CoreClient, namespace string) *services {
|
||||
return &services{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -45,14 +46,14 @@ type DaemonSetInterface interface {
|
||||
|
||||
// daemonSets implements DaemonSetInterface
|
||||
type daemonSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDaemonSets returns a DaemonSets
|
||||
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
return &daemonSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -45,14 +46,14 @@ type DeploymentInterface interface {
|
||||
|
||||
// deployments implements DeploymentInterface
|
||||
type deployments struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeployments returns a Deployments
|
||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||
return &deployments{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
type ExtensionsInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
DaemonSetsGetter
|
||||
DeploymentsGetter
|
||||
IngressesGetter
|
||||
@ -33,7 +33,7 @@ type ExtensionsInterface interface {
|
||||
|
||||
// ExtensionsClient is used to interact with features provided by the Extensions group.
|
||||
type ExtensionsClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *ExtensionsClient {
|
||||
func New(c restclient.Interface) *ExtensionsClient {
|
||||
return &ExtensionsClient{c}
|
||||
}
|
||||
|
||||
@ -101,11 +101,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *ExtensionsClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -42,8 +42,9 @@ func (c *FakeExtensions) ReplicaSets(namespace string) v1beta1.ReplicaSetInterfa
|
||||
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.
|
||||
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeExtensions) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -45,14 +46,14 @@ type IngressInterface interface {
|
||||
|
||||
// ingresses implements IngressInterface
|
||||
type ingresses struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newIngresses returns a Ingresses
|
||||
func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
|
||||
return &ingresses{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -45,14 +46,14 @@ type ReplicaSetInterface interface {
|
||||
|
||||
// replicaSets implements ReplicaSetInterface
|
||||
type replicaSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newReplicaSets returns a ReplicaSets
|
||||
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
|
||||
return &replicaSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -45,13 +46,13 @@ type ClusterInterface interface {
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client *FederationClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *FederationClient) *clusters {
|
||||
return &clusters{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeFederation) Clusters() v1beta1.ClusterInterface {
|
||||
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.
|
||||
func (c *FakeFederation) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeFederation) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -24,13 +24,13 @@ import (
|
||||
)
|
||||
|
||||
type FederationInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
ClustersGetter
|
||||
}
|
||||
|
||||
// FederationClient is used to interact with features provided by the Federation group.
|
||||
type FederationClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *FederationClient) Clusters() ClusterInterface {
|
||||
@ -61,7 +61,7 @@ func NewForConfigOrDie(c *restclient.Config) *FederationClient {
|
||||
}
|
||||
|
||||
// New creates a new FederationClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *FederationClient {
|
||||
func New(c restclient.Interface) *FederationClient {
|
||||
return &FederationClient{c}
|
||||
}
|
||||
|
||||
@ -86,11 +86,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FederationClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *FederationClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterS
|
||||
LastProbeTime: 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 {
|
||||
clusterStatus.Conditions = append(clusterStatus.Conditions, newNodeOfflineCondition)
|
||||
} else {
|
||||
|
@ -242,7 +242,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *Clientset {
|
||||
func New(c restclient.Interface) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.CoreClient = unversionedcore.New(c)
|
||||
clientset.AuthenticationClient = unversionedauthentication.New(c)
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type AppsInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
PetSetsGetter
|
||||
}
|
||||
|
||||
// AppsClient is used to interact with features provided by the Apps group.
|
||||
type AppsClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *AppsClient {
|
||||
func New(c restclient.Interface) *AppsClient {
|
||||
return &AppsClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *AppsClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *AppsClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeApps) PetSets(namespace string) unversioned.PetSetInterface {
|
||||
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.
|
||||
func (c *FakeApps) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeApps) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
apps "k8s.io/kubernetes/pkg/apis/apps"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type PetSetInterface interface {
|
||||
|
||||
// petSets implements PetSetInterface
|
||||
type petSets struct {
|
||||
client *AppsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPetSets returns a PetSets
|
||||
func newPetSets(c *AppsClient, namespace string) *petSets {
|
||||
return &petSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type AuthenticationInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
TokenReviewsGetter
|
||||
}
|
||||
|
||||
// AuthenticationClient is used to interact with features provided by the Authentication group.
|
||||
type AuthenticationClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *AuthenticationClient) TokenReviews() TokenReviewInterface {
|
||||
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *AuthenticationClient {
|
||||
}
|
||||
|
||||
// New creates a new AuthenticationClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *AuthenticationClient {
|
||||
func New(c restclient.Interface) *AuthenticationClient {
|
||||
return &AuthenticationClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *AuthenticationClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *AuthenticationClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeAuthentication) TokenReviews() unversioned.TokenReviewInterface {
|
||||
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.
|
||||
func (c *FakeAuthentication) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeAuthentication) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
// TokenReviewsGetter has a method to return a TokenReviewInterface.
|
||||
// A group's client should implement this interface.
|
||||
type TokenReviewsGetter interface {
|
||||
@ -29,12 +33,12 @@ type TokenReviewInterface interface {
|
||||
|
||||
// tokenReviews implements TokenReviewInterface
|
||||
type tokenReviews struct {
|
||||
client *AuthenticationClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newTokenReviews returns a TokenReviews
|
||||
func newTokenReviews(c *AuthenticationClient) *tokenReviews {
|
||||
return &tokenReviews{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type AuthorizationInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
LocalSubjectAccessReviewsGetter
|
||||
SelfSubjectAccessReviewsGetter
|
||||
SubjectAccessReviewsGetter
|
||||
@ -31,7 +31,7 @@ type AuthorizationInterface interface {
|
||||
|
||||
// AuthorizationClient is used to interact with features provided by the Authorization group.
|
||||
type AuthorizationClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *AuthorizationClient {
|
||||
func New(c restclient.Interface) *AuthorizationClient {
|
||||
return &AuthorizationClient{c}
|
||||
}
|
||||
|
||||
@ -99,11 +99,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *AuthorizationClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *AuthorizationClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -38,8 +38,9 @@ func (c *FakeAuthorization) SubjectAccessReviews() unversioned.SubjectAccessRevi
|
||||
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.
|
||||
func (c *FakeAuthorization) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeAuthorization) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
// LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface.
|
||||
// A group's client should implement this interface.
|
||||
type LocalSubjectAccessReviewsGetter interface {
|
||||
@ -29,14 +33,14 @@ type LocalSubjectAccessReviewInterface interface {
|
||||
|
||||
// localSubjectAccessReviews implements LocalSubjectAccessReviewInterface
|
||||
type localSubjectAccessReviews struct {
|
||||
client *AuthorizationClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews
|
||||
func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews {
|
||||
return &localSubjectAccessReviews{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
// SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SelfSubjectAccessReviewsGetter interface {
|
||||
@ -29,12 +33,12 @@ type SelfSubjectAccessReviewInterface interface {
|
||||
|
||||
// selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface
|
||||
type selfSubjectAccessReviews struct {
|
||||
client *AuthorizationClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews
|
||||
func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews {
|
||||
return &selfSubjectAccessReviews{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
// SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SubjectAccessReviewsGetter interface {
|
||||
@ -29,12 +33,12 @@ type SubjectAccessReviewInterface interface {
|
||||
|
||||
// subjectAccessReviews implements SubjectAccessReviewInterface
|
||||
type subjectAccessReviews struct {
|
||||
client *AuthorizationClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newSubjectAccessReviews returns a SubjectAccessReviews
|
||||
func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews {
|
||||
return &subjectAccessReviews{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type AutoscalingInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
HorizontalPodAutoscalersGetter
|
||||
}
|
||||
|
||||
// AutoscalingClient is used to interact with features provided by the Autoscaling group.
|
||||
type AutoscalingClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *AutoscalingClient {
|
||||
func New(c restclient.Interface) *AutoscalingClient {
|
||||
return &AutoscalingClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *AutoscalingClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *AutoscalingClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) unversioned
|
||||
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.
|
||||
func (c *FakeAutoscaling) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeAutoscaling) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type HorizontalPodAutoscalerInterface interface {
|
||||
|
||||
// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
|
||||
type horizontalPodAutoscalers struct {
|
||||
client *AutoscalingClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers
|
||||
func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers {
|
||||
return &horizontalPodAutoscalers{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,14 +23,14 @@ import (
|
||||
)
|
||||
|
||||
type BatchInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
JobsGetter
|
||||
ScheduledJobsGetter
|
||||
}
|
||||
|
||||
// BatchClient is used to interact with features provided by the Batch group.
|
||||
type BatchClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *BatchClient {
|
||||
func New(c restclient.Interface) *BatchClient {
|
||||
return &BatchClient{c}
|
||||
}
|
||||
|
||||
@ -94,11 +94,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *BatchClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *BatchClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -34,8 +34,9 @@ func (c *FakeBatch) ScheduledJobs(namespace string) unversioned.ScheduledJobInte
|
||||
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.
|
||||
func (c *FakeBatch) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeBatch) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
batch "k8s.io/kubernetes/pkg/apis/batch"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type JobInterface interface {
|
||||
|
||||
// jobs implements JobInterface
|
||||
type jobs struct {
|
||||
client *BatchClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newJobs returns a Jobs
|
||||
func newJobs(c *BatchClient, namespace string) *jobs {
|
||||
return &jobs{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
batch "k8s.io/kubernetes/pkg/apis/batch"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type ScheduledJobInterface interface {
|
||||
|
||||
// scheduledJobs implements ScheduledJobInterface
|
||||
type scheduledJobs struct {
|
||||
client *BatchClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newScheduledJobs returns a ScheduledJobs
|
||||
func newScheduledJobs(c *BatchClient, namespace string) *scheduledJobs {
|
||||
return &scheduledJobs{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type CertificatesInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
CertificateSigningRequestsGetter
|
||||
}
|
||||
|
||||
// CertificatesClient is used to interact with features provided by the Certificates group.
|
||||
type CertificatesClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface {
|
||||
@ -60,7 +60,7 @@ func NewForConfigOrDie(c *restclient.Config) *CertificatesClient {
|
||||
}
|
||||
|
||||
// New creates a new CertificatesClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *CertificatesClient {
|
||||
func New(c restclient.Interface) *CertificatesClient {
|
||||
return &CertificatesClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CertificatesClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *CertificatesClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
certificates "k8s.io/kubernetes/pkg/apis/certificates"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,13 +45,13 @@ type CertificateSigningRequestInterface interface {
|
||||
|
||||
// certificateSigningRequests implements CertificateSigningRequestInterface
|
||||
type certificateSigningRequests struct {
|
||||
client *CertificatesClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newCertificateSigningRequests returns a CertificateSigningRequests
|
||||
func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests {
|
||||
return &certificateSigningRequests{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,9 @@ func (c *FakeCertificates) CertificateSigningRequests() unversioned.CertificateS
|
||||
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.
|
||||
func (c *FakeCertificates) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeCertificates) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,13 +43,13 @@ type ComponentStatusInterface interface {
|
||||
|
||||
// componentStatuses implements ComponentStatusInterface
|
||||
type componentStatuses struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newComponentStatuses returns a ComponentStatuses
|
||||
func newComponentStatuses(c *CoreClient) *componentStatuses {
|
||||
return &componentStatuses{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type ConfigMapInterface interface {
|
||||
|
||||
// configMaps implements ConfigMapInterface
|
||||
type configMaps struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newConfigMaps returns a ConfigMaps
|
||||
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
|
||||
return &configMaps{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type CoreInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
ComponentStatusesGetter
|
||||
ConfigMapsGetter
|
||||
EndpointsGetter
|
||||
@ -44,7 +44,7 @@ type CoreInterface interface {
|
||||
|
||||
// CoreClient is used to interact with features provided by the Core group.
|
||||
type CoreClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *CoreClient) ComponentStatuses() ComponentStatusInterface {
|
||||
@ -135,7 +135,7 @@ func NewForConfigOrDie(c *restclient.Config) *CoreClient {
|
||||
}
|
||||
|
||||
// New creates a new CoreClient for the given RESTClient.
|
||||
func New(c *restclient.RESTClient) *CoreClient {
|
||||
func New(c restclient.Interface) *CoreClient {
|
||||
return &CoreClient{c}
|
||||
}
|
||||
|
||||
@ -164,11 +164,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CoreClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *CoreClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type EndpointsInterface interface {
|
||||
|
||||
// endpoints implements EndpointsInterface
|
||||
type endpoints struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEndpoints returns a Endpoints
|
||||
func newEndpoints(c *CoreClient, namespace string) *endpoints {
|
||||
return &endpoints{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type EventInterface interface {
|
||||
|
||||
// events implements EventInterface
|
||||
type events struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEvents returns a Events
|
||||
func newEvents(c *CoreClient, namespace string) *events {
|
||||
return &events{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -90,8 +90,9 @@ func (c *FakeCore) ServiceAccounts(namespace string) unversioned.ServiceAccountI
|
||||
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.
|
||||
func (c *FakeCore) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeCore) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type LimitRangeInterface interface {
|
||||
|
||||
// limitRanges implements LimitRangeInterface
|
||||
type limitRanges struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newLimitRanges returns a LimitRanges
|
||||
func newLimitRanges(c *CoreClient, namespace string) *limitRanges {
|
||||
return &limitRanges{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type NamespaceInterface interface {
|
||||
|
||||
// namespaces implements NamespaceInterface
|
||||
type namespaces struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newNamespaces returns a Namespaces
|
||||
func newNamespaces(c *CoreClient) *namespaces {
|
||||
return &namespaces{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type NodeInterface interface {
|
||||
|
||||
// nodes implements NodeInterface
|
||||
type nodes struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newNodes returns a Nodes
|
||||
func newNodes(c *CoreClient) *nodes {
|
||||
return &nodes{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type PersistentVolumeInterface interface {
|
||||
|
||||
// persistentVolumes implements PersistentVolumeInterface
|
||||
type persistentVolumes struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newPersistentVolumes returns a PersistentVolumes
|
||||
func newPersistentVolumes(c *CoreClient) *persistentVolumes {
|
||||
return &persistentVolumes{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type PersistentVolumeClaimInterface interface {
|
||||
|
||||
// persistentVolumeClaims implements PersistentVolumeClaimInterface
|
||||
type persistentVolumeClaims struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPersistentVolumeClaims returns a PersistentVolumeClaims
|
||||
func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims {
|
||||
return &persistentVolumeClaims{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type PodInterface interface {
|
||||
|
||||
// pods implements PodInterface
|
||||
type pods struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPods returns a Pods
|
||||
func newPods(c *CoreClient, namespace string) *pods {
|
||||
return &pods{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type PodTemplateInterface interface {
|
||||
|
||||
// podTemplates implements PodTemplateInterface
|
||||
type podTemplates struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPodTemplates returns a PodTemplates
|
||||
func newPodTemplates(c *CoreClient, namespace string) *podTemplates {
|
||||
return &podTemplates{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type ReplicationControllerInterface interface {
|
||||
|
||||
// replicationControllers implements ReplicationControllerInterface
|
||||
type replicationControllers struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newReplicationControllers returns a ReplicationControllers
|
||||
func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers {
|
||||
return &replicationControllers{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type ResourceQuotaInterface interface {
|
||||
|
||||
// resourceQuotas implements ResourceQuotaInterface
|
||||
type resourceQuotas struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newResourceQuotas returns a ResourceQuotas
|
||||
func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas {
|
||||
return &resourceQuotas{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type SecretInterface interface {
|
||||
|
||||
// secrets implements SecretInterface
|
||||
type secrets struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSecrets returns a Secrets
|
||||
func newSecrets(c *CoreClient, namespace string) *secrets {
|
||||
return &secrets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type ServiceInterface interface {
|
||||
|
||||
// services implements ServiceInterface
|
||||
type services struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServices returns a Services
|
||||
func newServices(c *CoreClient, namespace string) *services {
|
||||
return &services{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -42,14 +43,14 @@ type ServiceAccountInterface interface {
|
||||
|
||||
// serviceAccounts implements ServiceAccountInterface
|
||||
type serviceAccounts struct {
|
||||
client *CoreClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServiceAccounts returns a ServiceAccounts
|
||||
func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts {
|
||||
return &serviceAccounts{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type DaemonSetInterface interface {
|
||||
|
||||
// daemonSets implements DaemonSetInterface
|
||||
type daemonSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDaemonSets returns a DaemonSets
|
||||
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
return &daemonSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type DeploymentInterface interface {
|
||||
|
||||
// deployments implements DeploymentInterface
|
||||
type deployments struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeployments returns a Deployments
|
||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||
return &deployments{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type ExtensionsInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
DaemonSetsGetter
|
||||
DeploymentsGetter
|
||||
IngressesGetter
|
||||
@ -36,7 +36,7 @@ type ExtensionsInterface interface {
|
||||
|
||||
// ExtensionsClient is used to interact with features provided by the Extensions group.
|
||||
type ExtensionsClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *ExtensionsClient {
|
||||
func New(c restclient.Interface) *ExtensionsClient {
|
||||
return &ExtensionsClient{c}
|
||||
}
|
||||
|
||||
@ -124,11 +124,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *ExtensionsClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *ExtensionsClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -58,8 +58,9 @@ func (c *FakeExtensions) ThirdPartyResources() unversioned.ThirdPartyResourceInt
|
||||
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.
|
||||
func (c *FakeExtensions) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeExtensions) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type IngressInterface interface {
|
||||
|
||||
// ingresses implements IngressInterface
|
||||
type ingresses struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newIngresses returns a Ingresses
|
||||
func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
|
||||
return &ingresses{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,14 +44,14 @@ type NetworkPolicyInterface interface {
|
||||
|
||||
// networkPolicies implements NetworkPolicyInterface
|
||||
type networkPolicies struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newNetworkPolicies returns a NetworkPolicies
|
||||
func newNetworkPolicies(c *ExtensionsClient, namespace string) *networkPolicies {
|
||||
return &networkPolicies{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type PodSecurityPolicyInterface interface {
|
||||
|
||||
// podSecurityPolicies implements PodSecurityPolicyInterface
|
||||
type podSecurityPolicies struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newPodSecurityPolicies returns a PodSecurityPolicies
|
||||
func newPodSecurityPolicies(c *ExtensionsClient) *podSecurityPolicies {
|
||||
return &podSecurityPolicies{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type ReplicaSetInterface interface {
|
||||
|
||||
// replicaSets implements ReplicaSetInterface
|
||||
type replicaSets struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newReplicaSets returns a ReplicaSets
|
||||
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
|
||||
return &replicaSets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
// ScalesGetter has a method to return a ScaleInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ScalesGetter interface {
|
||||
@ -29,14 +33,14 @@ type ScaleInterface interface {
|
||||
|
||||
// scales implements ScaleInterface
|
||||
type scales struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newScales returns a Scales
|
||||
func newScales(c *ExtensionsClient, namespace string) *scales {
|
||||
return &scales{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type ThirdPartyResourceInterface interface {
|
||||
|
||||
// thirdPartyResources implements ThirdPartyResourceInterface
|
||||
type thirdPartyResources struct {
|
||||
client *ExtensionsClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newThirdPartyResources returns a ThirdPartyResources
|
||||
func newThirdPartyResources(c *ExtensionsClient) *thirdPartyResources {
|
||||
return &thirdPartyResources{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,9 @@ func (c *FakePolicy) PodDisruptionBudgets(namespace string) unversioned.PodDisru
|
||||
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.
|
||||
func (c *FakePolicy) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakePolicy) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
policy "k8s.io/kubernetes/pkg/apis/policy"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -44,14 +45,14 @@ type PodDisruptionBudgetInterface interface {
|
||||
|
||||
// podDisruptionBudgets implements PodDisruptionBudgetInterface
|
||||
type podDisruptionBudgets struct {
|
||||
client *PolicyClient
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPodDisruptionBudgets returns a PodDisruptionBudgets
|
||||
func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets {
|
||||
return &podDisruptionBudgets{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ import (
|
||||
)
|
||||
|
||||
type PolicyInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
RESTClient() restclient.Interface
|
||||
PodDisruptionBudgetsGetter
|
||||
}
|
||||
|
||||
// PolicyClient is used to interact with features provided by the Policy group.
|
||||
type PolicyClient struct {
|
||||
*restclient.RESTClient
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
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.
|
||||
func New(c *restclient.RESTClient) *PolicyClient {
|
||||
func New(c restclient.Interface) *PolicyClient {
|
||||
return &PolicyClient{c}
|
||||
}
|
||||
|
||||
@ -89,11 +89,11 @@ func setConfigDefaults(config *restclient.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *PolicyClient) GetRESTClient() *restclient.RESTClient {
|
||||
func (c *PolicyClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
return c.restClient
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type ClusterRoleInterface interface {
|
||||
|
||||
// clusterRoles implements ClusterRoleInterface
|
||||
type clusterRoles struct {
|
||||
client *RbacClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newClusterRoles returns a ClusterRoles
|
||||
func newClusterRoles(c *RbacClient) *clusterRoles {
|
||||
return &clusterRoles{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ package unversioned
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,13 +44,13 @@ type ClusterRoleBindingInterface interface {
|
||||
|
||||
// clusterRoleBindings implements ClusterRoleBindingInterface
|
||||
type clusterRoleBindings struct {
|
||||
client *RbacClient
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newClusterRoleBindings returns a ClusterRoleBindings
|
||||
func newClusterRoleBindings(c *RbacClient) *clusterRoleBindings {
|
||||
return &clusterRoleBindings{
|
||||
client: c,
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,9 @@ func (c *FakeRbac) RoleBindings(namespace string) unversioned.RoleBindingInterfa
|
||||
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.
|
||||
func (c *FakeRbac) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
func (c *FakeRbac) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user