Merge branch 'V5.0' of https://github.com/goodrain/rainbond into V5.0

This commit is contained in:
barnett 2018-12-11 15:36:53 +08:00
commit a4b45245f3
4 changed files with 6 additions and 3 deletions

View File

@ -92,7 +92,6 @@ func (a *applyRuleController) applyOne(app *v1.AppService) error {
func ensureService(new *corev1.Service, clientSet kubernetes.Interface) { func ensureService(new *corev1.Service, clientSet kubernetes.Interface) {
old, err := clientSet.CoreV1().Services(new.Namespace).Get(new.Name, metav1.GetOptions{}) old, err := clientSet.CoreV1().Services(new.Namespace).Get(new.Name, metav1.GetOptions{})
logrus.Debugf("old service: %v", old)
if err != nil { if err != nil {
if k8sErrors.IsNotFound(err) { if k8sErrors.IsNotFound(err) {
_, err := clientSet.CoreV1().Services(new.Namespace).Create(new) _, err := clientSet.CoreV1().Services(new.Namespace).Create(new)

View File

@ -145,7 +145,6 @@ func (a *AppServiceBuild) Build() ([]*corev1.Service, []*extensions.Ingress, []*
var services []*corev1.Service var services []*corev1.Service
var ingresses []*extensions.Ingress var ingresses []*extensions.Ingress
var secrets []*corev1.Secret var secrets []*corev1.Secret
logrus.Debugf("ports: %v", ports)
if ports != nil && len(ports) > 0 { if ports != nil && len(ports) > 0 {
for i := range ports { for i := range ports {
port := ports[i] port := ports[i]
@ -153,7 +152,6 @@ func (a *AppServiceBuild) Build() ([]*corev1.Service, []*extensions.Ingress, []*
services = append(services, a.createInnerService(port)) services = append(services, a.createInnerService(port))
} }
if port.IsOuterService { if port.IsOuterService {
logrus.Debugf("outer port: %v", port)
service := a.createOuterService(port) service := a.createOuterService(port)
ings, secret, err := a.ApplyRules(port, service) ings, secret, err := a.ApplyRules(port, service)

View File

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

View File

@ -75,6 +75,7 @@ func TenantServiceVersion(as *v1.AppService, dbmanager db.Manager) error {
setFeature(&podtmpSpec) setFeature(&podtmpSpec)
//set to deployment or statefulset //set to deployment or statefulset
as.SetPodTemplate(podtmpSpec) as.SetPodTemplate(podtmpSpec)
logrus.Debugf("Deployment: %v", as.GetDeployment())
return nil return nil
} }