[ADD] add debug messages

This commit is contained in:
GLYASAI 2018-12-11 12:11:27 +08:00
parent d714203fb6
commit a678b632d5

View File

@ -20,6 +20,7 @@ package conversion
import (
"fmt"
"github.com/Sirupsen/logrus"
"strings"
"github.com/goodrain/rainbond/db"
@ -79,6 +80,7 @@ func int32Ptr(i int) *int32 {
//TenantServiceBase conv tenant service base info
func TenantServiceBase(as *v1.AppService, dbmanager db.Manager) error {
logrus.Debugf("service_id: %d", as.ServiceID)
tenantService, err := dbmanager.TenantServiceDao().GetServiceByID(as.ServiceID)
if err != nil {
if err == gorm.ErrRecordNotFound {
@ -114,11 +116,14 @@ func TenantServiceBase(as *v1.AppService, dbmanager db.Manager) error {
if err := initTenant(as, tenant); err != nil {
return fmt.Errorf("conversion tenant info failure %s", err.Error())
}
logrus.Debugf("serviceType.LabelValue: %s", serviceType.LabelValue)
if serviceType == nil || serviceType.LabelValue == util.StatelessServiceType {
logrus.Debugf("Deployment")
initBaseDeployment(as, tenantService)
return nil
}
if serviceType.LabelValue == util.StatefulServiceType {
logrus.Debugf("StatefulSet")
initBaseStatefulSet(as, tenantService)
return nil
}