Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add try-paths plugins #1598

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: add try-paths plugins #1598

wants to merge 4 commits into from

Conversation

haifzhu
Copy link
Collaborator

@haifzhu haifzhu commented Dec 17, 2024

Ⅰ. Describe what this PR did

add try-paths wasm go plugin to implement try_files function of nginx。

Ⅱ. Does this pull request fix one issue?

Fix the issue: Add support of try_files usage #840 .

Ⅲ. Why don't you add test cases (unit test/integration test)?

test cases be added in codes.

Ⅳ. Describe how to verify it

enable the plugin on the route, and check its retry function on envoy log or request response.

Ⅴ. Special notes for reviews

no


| 名称 | 数据类型 | 填写要求 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| serviceSource | string | 必填 | - | 支持k8s,nacos,ip,dns |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只支持FQDN格式的serviceName就可以了,这样能简化下配置,不需要配serviceSource

}

log.Debugf("try path start, path: %s", config.tryPaths[index])
requestPath := strings.Replace(config.tryPaths[index], VariableReplacedStr, path, -1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tryPath 里面存在 $uri 这样的变量,应该需要解析出来吧?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tryPath 里面存在 $uri 这样的变量,应该需要解析出来吧?

是在上面debug的输出里面需要打印出请求路径对吧?不要tryPaths中的原路径。

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.47%. Comparing base (ef31e09) to head (296f0a0).
Report is 232 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1598      +/-   ##
==========================================
+ Coverage   35.91%   43.47%   +7.56%     
==========================================
  Files          69       76       +7     
  Lines       11576    12325     +749     
==========================================
+ Hits         4157     5358    +1201     
+ Misses       7104     6631     -473     
- Partials      315      336      +21     

see 69 files with indirect coverage changes

@haifzhu haifzhu requested a review from johnlanni December 18, 2024 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants