From d714203fb6f2973135f86c7b6c3fc3ddd794ab15 Mon Sep 17 00:00:00 2001 From: GLYASAI Date: Mon, 10 Dec 2018 22:37:10 +0800 Subject: [PATCH 1/3] [DEL] remove some debug messages --- worker/appm/controller/apply_rule.go | 1 - worker/appm/conversion/gateway.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/worker/appm/controller/apply_rule.go b/worker/appm/controller/apply_rule.go index f62e92c4b..2a781b80c 100644 --- a/worker/appm/controller/apply_rule.go +++ b/worker/appm/controller/apply_rule.go @@ -92,7 +92,6 @@ func (a *applyRuleController) applyOne(app *v1.AppService) error { func ensureService(new *corev1.Service, clientSet kubernetes.Interface) { old, err := clientSet.CoreV1().Services(new.Namespace).Get(new.Name, metav1.GetOptions{}) - logrus.Debugf("old service: %v", old) if err != nil { if k8sErrors.IsNotFound(err) { _, err := clientSet.CoreV1().Services(new.Namespace).Create(new) diff --git a/worker/appm/conversion/gateway.go b/worker/appm/conversion/gateway.go index 8670bf061..f913cef7a 100644 --- a/worker/appm/conversion/gateway.go +++ b/worker/appm/conversion/gateway.go @@ -145,7 +145,6 @@ func (a *AppServiceBuild) Build() ([]*corev1.Service, []*extensions.Ingress, []* var services []*corev1.Service var ingresses []*extensions.Ingress var secrets []*corev1.Secret - logrus.Debugf("ports: %v", ports) if ports != nil && len(ports) > 0 { for i := range ports { port := ports[i] @@ -153,7 +152,6 @@ func (a *AppServiceBuild) Build() ([]*corev1.Service, []*extensions.Ingress, []* services = append(services, a.createInnerService(port)) } if port.IsOuterService { - logrus.Debugf("outer port: %v", port) service := a.createOuterService(port) ings, secret, err := a.ApplyRules(port, service) From a678b632d57029481c740beadadb5a85396029df Mon Sep 17 00:00:00 2001 From: GLYASAI Date: Tue, 11 Dec 2018 12:11:27 +0800 Subject: [PATCH 2/3] [ADD] add debug messages --- worker/appm/conversion/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/worker/appm/conversion/service.go b/worker/appm/conversion/service.go index 5a5c3b93f..5d2722ed5 100644 --- a/worker/appm/conversion/service.go +++ b/worker/appm/conversion/service.go @@ -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 } From 4092bac824f6060e52d5ac686512a4e330cd7f35 Mon Sep 17 00:00:00 2001 From: GLYASAI Date: Tue, 11 Dec 2018 12:22:06 +0800 Subject: [PATCH 3/3] [ADD] add debug messages --- worker/appm/conversion/version.go | 1 + 1 file changed, 1 insertion(+) diff --git a/worker/appm/conversion/version.go b/worker/appm/conversion/version.go index 837c9adfa..8e7f6bf0b 100644 --- a/worker/appm/conversion/version.go +++ b/worker/appm/conversion/version.go @@ -75,6 +75,7 @@ func TenantServiceVersion(as *v1.AppService, dbmanager db.Manager) error { setFeature(&podtmpSpec) //set to deployment or statefulset as.SetPodTemplate(podtmpSpec) + logrus.Debugf("Deployment: %v", as.GetDeployment()) return nil }