mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-17 14:57:25 +02:00
introduce cluster interface;
remove cluster types separate file
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package cluster
|
||||
|
||||
type PostgresRole string
|
||||
|
||||
const (
|
||||
Master PostgresRole = "master"
|
||||
Replica PostgresRole = "replica"
|
||||
)
|
||||
Reference in New Issue
Block a user