[REV] support set service PublishNotReadyAddresses for statefulset

This commit is contained in:
barnett 2018-04-28 10:44:17 +08:00
parent ddaa80a62d
commit e9d11918ce
2 changed files with 23 additions and 1 deletions

View File

@ -158,6 +158,14 @@ func TestGetMem(t *testing.T) {
// }
}
func TestCockroachDBCreateTable(t *testing.T) {
if err := CreateManager(dbconfig.Config{
MysqlConnectionInfo: "postgresql://root@localhost:5432/region?sslmode=disable",
DBType: "cockroachdb",
}); err != nil {
t.Fatal(err)
}
}
func TestCockroachDBCreateService(t *testing.T) {
if err := CreateManager(dbconfig.Config{
MysqlConnectionInfo: "postgresql://root@localhost:5432/region?sslmode=disable",
@ -165,7 +173,7 @@ func TestCockroachDBCreateService(t *testing.T) {
}); err != nil {
t.Fatal(err)
}
err := GetManager().TenantServiceDao().AddModel(&model.TenantServices{
err := GetManager().TenantServiceDeleteDao().AddModel(&model.TenantServicesDelete{
TenantID: "asdasd",
ServiceID: "asdasdasdasd",
ServiceAlias: "grasdasdasdads",
@ -205,3 +213,16 @@ func TestCockroachDBSaveDeployInfo(t *testing.T) {
t.Fatal(err)
}
}
func TestCockroachDBDeleteDeployInfo(t *testing.T) {
if err := CreateManager(dbconfig.Config{
MysqlConnectionInfo: "postgresql://root@localhost:5432/region?sslmode=disable",
DBType: "cockroachdb",
}); err != nil {
t.Fatal(err)
}
err := GetManager().K8sDeployReplicationDao().DeleteK8sDeployReplication("asdasdadsasdasdasd")
if err != nil {
t.Fatal(err)
}
}

View File

@ -278,5 +278,6 @@ func (k *K8sServiceBuild) createStatefulService(ports []*model.TenantServicesPor
ClusterIP: "None",
}
service.Spec = spec
service.Annotations = map[string]string{"service.alpha.kubernetes.io/tolerate-unready-endpoints": "true"}
return &service
}