tao12345666333 commented on code in PR #975:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/975#discussion_r854801841


##########
pkg/kube/translation/annotations/redirect.go:
##########
@@ -37,8 +41,15 @@ func (r *redirect) PluginName() string {
 func (r *redirect) Handle(e Extractor) (interface{}, error) {
        var plugin apisixv1.RedirectConfig
        plugin.HttpToHttps = e.GetBoolAnnotation(_httpToHttps)
+       plugin.URI = e.GetStringAnnotation(_uri)
+
+       retCode, err := strconv.Atoi(e.GetStringAnnotation(_retCode))
        // To avoid empty redirect plugin config, adding the check about the 
redirect.
-       if plugin.HttpToHttps {
+       if err == nil {
+               plugin.RetCode = retCode
+               return &plugin, nil

Review Comment:
   Why return it directly?



##########
pkg/kube/translation/annotations/redirect.go:
##########
@@ -37,8 +41,15 @@ func (r *redirect) PluginName() string {
 func (r *redirect) Handle(e Extractor) (interface{}, error) {
        var plugin apisixv1.RedirectConfig
        plugin.HttpToHttps = e.GetBoolAnnotation(_httpToHttps)
+       plugin.URI = e.GetStringAnnotation(_uri)
+

Review Comment:
   plz remove this blank line 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to