From bc580a3ae739f9b1c29314fc4c364cc89e8bb4cd Mon Sep 17 00:00:00 2001 From: berg Date: Tue, 19 Dec 2023 11:20:00 +0800 Subject: [PATCH] fix gateway print log panic (#167) Signed-off-by: liheng.zms --- pkg/trafficrouting/network/gateway/gateway.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/trafficrouting/network/gateway/gateway.go b/pkg/trafficrouting/network/gateway/gateway.go index 9a7673f1..b3ddba4c 100644 --- a/pkg/trafficrouting/network/gateway/gateway.go +++ b/pkg/trafficrouting/network/gateway/gateway.go @@ -19,6 +19,7 @@ import ( "github.com/openkruise/rollouts/api/v1beta1" "github.com/openkruise/rollouts/pkg/trafficrouting/network" + "github.com/openkruise/rollouts/pkg/util" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" @@ -89,7 +90,7 @@ func (r *gatewayController) EnsureRoutes(ctx context.Context, strategy *v1beta1. klog.Errorf("update %s httpRoute(%s) failed: %s", r.conf.Key, httpRoute.Name, err.Error()) return false, err } - klog.Infof("%s set HTTPRoute(name:%s weight:%d) success", r.conf.Key, *r.conf.TrafficConf.HTTPRouteName, *weight) + klog.Infof("%s set HTTPRoute(%s) desiredRule(%s) success", r.conf.Key, *r.conf.TrafficConf.HTTPRouteName, util.DumpJSON(desiredRule)) return false, nil }