Merge pull request #34138 from ingvagabund/create-restclient-interface

Automatic merge from submit-queue

Create restclient interface

Refactoring of code to allow replace *restclient.RESTClient with any RESTClient implementation that implements restclient.RESTClientInterface interface.
This commit is contained in:
Kubernetes Submit Queue
2016-10-21 16:02:04 -07:00
committed by GitHub
194 changed files with 755 additions and 550 deletions

View File

@@ -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)

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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(),
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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(),
}
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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(),
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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,
}
}

View File

@@ -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,
}
}

View File

@@ -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(),
}
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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 {