introduce cluster interface;

remove cluster types separate file
This commit is contained in:
Murat Kabilov
2017-06-09 16:02:29 +02:00
parent a6c1e8f64d
commit 685e0c533e
4 changed files with 35 additions and 18 deletions
+22
View File
@@ -28,6 +28,24 @@ import (
"github.com/zalando-incubator/postgres-operator/pkg/util/volumes"
)
type Interface interface {
Create() error
Delete() error
ExecCommand(podName *spec.NamespacedName, command ...string) (string, error)
ReceivePodEvent(event spec.PodEvent)
Run(stopCh <-chan struct{})
Sync() error
Update(newSpec *spec.Postgresql) error
SetFailed(err error)
}
type PostgresRole string
const (
Master PostgresRole = "master"
Replica PostgresRole = "replica"
)
// Config contains operator-wide clients and configuration used from a cluster. TODO: remove struct duplication.
type Config struct {
KubeClient *kubernetes.Clientset //TODO: move clients to the better place?
@@ -630,3 +648,7 @@ func (c *Cluster) initInfrastructureRoles() error {
}
return nil
}
func (c *Cluster) SetFailed(err error) {
c.Error = err
}
-8
View File
@@ -1,8 +0,0 @@
package cluster
type PostgresRole string
const (
Master PostgresRole = "master"
Replica PostgresRole = "replica"
)