You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by zh...@apache.org on 2021/11/24 06:39:37 UTC

[apisix-ingress-controller] branch master updated: remove route timeout default value (#733)

This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new 9fe7298  remove route timeout default value (#733)
9fe7298 is described below

commit 9fe729889471b0291355a69938a5139ec828cfdf
Author: chen zhuo <ch...@126.com>
AuthorDate: Wed Nov 24 14:39:33 2021 +0800

    remove route timeout default value (#733)
---
 pkg/kube/translation/apisix_route.go | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/pkg/kube/translation/apisix_route.go b/pkg/kube/translation/apisix_route.go
index 9ffee9f..a8bcae3 100644
--- a/pkg/kube/translation/apisix_route.go
+++ b/pkg/kube/translation/apisix_route.go
@@ -446,12 +446,13 @@ func (t *translator) translateHTTPRoute(ctx *TranslateContext, ar *configv2alpha
 			return err
 		}
 
-		timeout := &apisixv1.UpstreamTimeout{
-			Connect: apisixv1.DefaultUpstreamTimeout,
-			Read:    apisixv1.DefaultUpstreamTimeout,
-			Send:    apisixv1.DefaultUpstreamTimeout,
-		}
+		var timeout *apisixv1.UpstreamTimeout
 		if part.Timeout != nil {
+			timeout = &apisixv1.UpstreamTimeout{
+				Connect: apisixv1.DefaultUpstreamTimeout,
+				Read:    apisixv1.DefaultUpstreamTimeout,
+				Send:    apisixv1.DefaultUpstreamTimeout,
+			}
 			if part.Timeout.Connect.Duration > 0 {
 				timeout.Connect = int(part.Timeout.Connect.Seconds())
 			}