-
Notifications
You must be signed in to change notification settings - Fork 948
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move KubernetesClient to k8sutil package.
- Loading branch information
1 parent
d86cccf
commit c5e24b3
Showing
6 changed files
with
38 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,8 @@ | ||
package cluster | ||
|
||
import ( | ||
"k8s.io/client-go/kubernetes" | ||
v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" | ||
v1core "k8s.io/client-go/kubernetes/typed/core/v1" | ||
extensions "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" | ||
) | ||
|
||
type PostgresRole string | ||
|
||
const ( | ||
Master PostgresRole = "master" | ||
Replica PostgresRole = "replica" | ||
) | ||
|
||
type KubernetesClient struct { | ||
v1core.SecretsGetter | ||
v1core.ServicesGetter | ||
v1core.EndpointsGetter | ||
v1core.PodsGetter | ||
v1core.PersistentVolumesGetter | ||
v1core.PersistentVolumeClaimsGetter | ||
v1core.ConfigMapsGetter | ||
v1beta1.StatefulSetsGetter | ||
extensions.ThirdPartyResourcesGetter | ||
} | ||
|
||
func NewFromKubernetesInterface(src kubernetes.Interface) (c KubernetesClient) { | ||
c = KubernetesClient{} | ||
c.PodsGetter = src.CoreV1() | ||
c.ServicesGetter = src.CoreV1() | ||
c.EndpointsGetter = src.CoreV1() | ||
c.SecretsGetter = src.CoreV1() | ||
c.ConfigMapsGetter = src.CoreV1() | ||
c.PersistentVolumeClaimsGetter = src.CoreV1() | ||
c.PersistentVolumesGetter = src.CoreV1() | ||
c.StatefulSetsGetter = src.AppsV1beta1() | ||
c.ThirdPartyResourcesGetter = src.ExtensionsV1beta1() | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters