rest client: use interface instead of structure pointer
This commit is contained in:
parent
3165106317
commit
129bcd7bd6
|
|
@ -37,7 +37,7 @@ var (
|
||||||
// Config contains operator-wide clients and configuration used from a cluster. TODO: remove struct duplication.
|
// Config contains operator-wide clients and configuration used from a cluster. TODO: remove struct duplication.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
KubeClient *kubernetes.Clientset //TODO: move clients to the better place?
|
KubeClient *kubernetes.Clientset //TODO: move clients to the better place?
|
||||||
RestClient *rest.RESTClient
|
RestClient rest.Interface
|
||||||
RestConfig *rest.Config
|
RestConfig *rest.Config
|
||||||
TeamsAPIClient *teams.API
|
TeamsAPIClient *teams.API
|
||||||
OpConfig config.Config
|
OpConfig config.Config
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import (
|
||||||
type Config struct {
|
type Config struct {
|
||||||
RestConfig *rest.Config
|
RestConfig *rest.Config
|
||||||
KubeClient *kubernetes.Clientset
|
KubeClient *kubernetes.Clientset
|
||||||
RestClient *rest.RESTClient
|
RestClient rest.Interface
|
||||||
TeamsAPIClient *teams.API
|
TeamsAPIClient *teams.API
|
||||||
InfrastructureRoles map[string]spec.PgUser
|
InfrastructureRoles map[string]spec.PgUser
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ func ResourceNotFound(err error) bool {
|
||||||
return apierrors.IsNotFound(err)
|
return apierrors.IsNotFound(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func KubernetesRestClient(c *rest.Config) (*rest.RESTClient, error) {
|
func KubernetesRestClient(c *rest.Config) (rest.Interface, error) {
|
||||||
c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion}
|
c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion}
|
||||||
c.APIPath = constants.K8sAPIPath
|
c.APIPath = constants.K8sAPIPath
|
||||||
c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
|
c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue