diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index e62f0b16ea6f8a1d5a1c64eb2ba4c76d1f20f4d1..9b8f2918b3d777b0eefbd2974849e2c59f85e5b0 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -39,7 +39,7 @@ type Config struct { KubeClient *kubernetes.Clientset //TODO: move clients to the better place? RestClient *rest.RESTClient RestConfig *rest.Config - TeamsAPIClient *teams.API + TeamsAPIClient teams.Client OpConfig config.Config InfrastructureRoles map[string]spec.PgUser // inherited from the controller } diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index b0e0962bdc34c277c8f96da9841ef58d840eab7e..2cac1d7c75bbb786b56e50d2a9a4762719f526b9 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -20,8 +20,8 @@ import ( type Config struct { RestConfig *rest.Config KubeClient *kubernetes.Clientset - RestClient *rest.RESTClient - TeamsAPIClient *teams.API + RestClient rest.Interface + TeamsAPIClient teams.Client InfrastructureRoles map[string]spec.PgUser } diff --git a/pkg/util/teams/teams.go b/pkg/util/teams/teams.go index b3d80349c770877506ffc482b71efb8488bd07f1..ac32ea7e4c54250db4241b614c720138523b66c3 100644 --- a/pkg/util/teams/teams.go +++ b/pkg/util/teams/teams.go @@ -39,6 +39,10 @@ type team struct { InfrastructureAccounts []infrastructureAccount `json:"infrastructure-accounts"` } +type Client interface { + TeamInfo(string, string) (*team, error) +} + type httpClient interface { Do(req *http.Request) (*http.Response, error) }