Skip to content

change: refactor logic for enabling L4/L7 proxy#9607

Merged
juststillthinking merged 21 commits into
apache:masterfrom
Revolyssup:revolyssup/fix9600
Jul 12, 2023
Merged

change: refactor logic for enabling L4/L7 proxy#9607
juststillthinking merged 21 commits into
apache:masterfrom
Revolyssup:revolyssup/fix9600

Conversation

@Revolyssup

@Revolyssup Revolyssup commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

Description

Fixes #9600
This PR refactors the logic as explained in the issue above.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@Revolyssup

Copy link
Copy Markdown
Contributor Author

@leslie-tsang @monkeyDluffy6017 Please review and make suggestions.

leslie-tsang
leslie-tsang previously approved these changes Jun 6, 2023
Comment thread conf/config-default.yaml Outdated
Comment thread apisix/cli/ops.lua Outdated
local stream = "stream"
if yaml_conf.apisix.proxy_mode then
-- check for "http" as prefix
if string.sub(yaml_conf.apisix.proxy_mode,1,#http) ~= http then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Literally compare with "http", "stream" and "http&stream" here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread apisix/cli/schema.lua Outdated
proxy_mode = {
type = "string",
enum = {"http", "stream", "http&stream"},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fix the indent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: revolyssup <[email protected]>
Signed-off-by: revolyssup <[email protected]>
Signed-off-by: revolyssup <[email protected]>
@juststillthinking juststillthinking changed the title fix: Refactor logic for enabling L4/L7 proxy change: refactor logic for enabling L4/L7 proxy Jun 12, 2023
Comment thread conf/config-default.yaml Outdated
Comment thread conf/config-default.yaml
Comment thread docs/en/latest/stream-proxy.md Outdated
@juststillthinking

Copy link
Copy Markdown
Contributor

Hi @Revolyssup, test cases are needed

@juststillthinking

juststillthinking commented Jun 12, 2023

Copy link
Copy Markdown
Contributor

@Revolyssup

Revolyssup commented Jun 12, 2023

Copy link
Copy Markdown
Contributor Author

@Revolyssup

Copy link
Copy Markdown
Contributor Author

@monkeyDluffy6017 Please approve CI again.

@juststillthinking

Copy link
Copy Markdown
Contributor

@Revolyssup I find that many places in our code rely on the stream_proxy variable to control the stream switch, so if you want to use proxy_mode to control it, you'll need to change these places, like

  1. https://github.com/apache/apisix/blob/master/apisix/cli/ngx_tpl.lua#L127
  2. https://github.com/apache/apisix/blob/master/apisix/admin/init.lua#L177

Comment thread docs/en/latest/stream-proxy.md
Comment thread apisix/cli/ngx_tpl.lua Outdated
@juststillthinking

juststillthinking commented Jun 21, 2023

Copy link
Copy Markdown
Contributor

Please search only: and delete the related code

@juststillthinking

Copy link
Copy Markdown
Contributor

Please make the ci pass

@juststillthinking juststillthinking added wait for update wait for the author's response in this issue/PR and removed need test cases labels Jun 21, 2023
@Revolyssup

Copy link
Copy Markdown
Contributor Author

Please search only: and delete related code

done

@juststillthinking

Copy link
Copy Markdown
Contributor

@Revolyssup Please make the ci pass

@Revolyssup

Copy link
Copy Markdown
Contributor Author

@Revolyssup Please make the ci pass

@monkeyDluffy6017 Yeah, I am trying to figure out this is failing Details
Do you have a clue?

@juststillthinking

Copy link
Copy Markdown
Contributor

It says failed to enable stream proxy and http proxy. This should be caused by your changes, perhaps you should check the corresponding test cases

Signed-off-by: revolyssup <[email protected]>
Signed-off-by: revolyssup <[email protected]>
@Revolyssup

Copy link
Copy Markdown
Contributor Author

@monkeyDluffy6017 approve CI please

@Revolyssup

Copy link
Copy Markdown
Contributor Author

Most tests failed because of unrelated single reason. I think we need to re run the tests.

Signed-off-by: revolyssup <[email protected]>
Comment thread conf/config-default.yaml Outdated
Signed-off-by: Ashish Tiwari <[email protected]>
Signed-off-by: Ashish Tiwari <[email protected]>
Signed-off-by: Ashish Tiwari <[email protected]>
@juststillthinking juststillthinking added approved and removed wait for update wait for the author's response in this issue/PR labels Jul 10, 2023
@Sn0rt

Sn0rt commented Jul 11, 2023

Copy link
Copy Markdown
Contributor

@leslie-tsang pls take a review .

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.

discussion: refactor L4 and/or L7 Proxy Enablement

5 participants