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

[cli] load openresty libraries when rover is active #598

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Feb 15, 2018

Rover would remove all shared paths, including paths
where openresty distributes own code.

So try go get those paths and set them back after loading rover.

It is not really possible to write a test because APIcast crashes in the CLI (before generating nginx config) and we have no CLI tests.

@mikz mikz force-pushed the cli-openresty-lualib branch from 2a6e38a to f334564 Compare February 15, 2018 11:24
@@ -109,3 +109,61 @@ for my $inc ($apicast_src, 'src') {
my @args = ('resty', @resty_args, $bin, @ARGV);

exec '/usr/bin/env', @args;

__DATA__
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the easiest way to distribute the lua helper.

@mikz mikz requested a review from davidor February 15, 2018 11:25
@@ -109,3 +109,61 @@ for my $inc ($apicast_src, 'src') {
my @args = ('resty', @resty_args, $bin, @ARGV);

exec '/usr/bin/env', @args;

__DATA__
#!/usr/bin/env resty
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need an explanation here about why this is needed. Like the one included in the PR description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added more comments. Most of them are in the lua helper code.

* when rover.setup is activated it strips out all paths other than
lua_modules
* openresty ships shared code in $prefix/lualib/ directory
@mikz mikz force-pushed the cli-openresty-lualib branch from f334564 to 68fc003 Compare February 15, 2018 12:10
@mikz mikz requested a review from davidor February 15, 2018 12:11
@mikz mikz merged commit a9a0ec2 into master Feb 15, 2018
@mikz mikz deleted the cli-openresty-lualib branch February 15, 2018 12:18
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.

2 participants