-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
[BUG] VCL managed snippets #122
Comments
@davidnrba Thank you for reaching out to us. The VCL snippet means the code snippets which is managed on Fastly, not a local file.
The On the other hand, I could see the meaningless debug output like |
Hi I still get an error when including the datadome-init in the datadome-pass:
I have also tried including: But nothing has worked I was thinking that maybe is something related to this, but I dont know how to fix it since they are in different vcl files. Thanks again for your help! |
@davidnrba interesting, so could you show me the all VCLs and snippets? If can, I'll look into it. |
Ah, probably it solves... Therefore, you could not include However, does your use case works on Fastly? If so, we should support it. |
Yes, so Im working on setting up CICD implementation with terraform to manage Fastly resources as code. So I took all the snippets exactly as they were set up in Fastly UI already, and put them into terraform. The interesting thing is that the way it was set up is without any includes whatsoever, just VCL Snippets and a main VCL file. (Everything is currently working great in the UI so everything mentioned here is supported by Fastly) Looks like Fastly puts or appends them all together in a big VCL file and thats why it works. For example in our case we have a service lets say 'FastlyService' in the Fastly UI, this service has a Main.vcl and then 15 vcl snippets of code: However at the top of the Fastly UI there is also a button to show all the vcl code: In this VCL code we have all the configuration required for the 'FastlyService' including all the VCL snippets and the Main.vcl appended to the code: This would make sense because for example we have another vcl file named:
But Falco detects it as an error because the snippet starts with an
So I think there should be maybe an option in Falco where you can just specify at the beginning of the Main.vcl file all the other files you are using (kind of like the include tag), and just lint it normally as how it would with all the files together in one. Only problem with this solution is that Im not sure about how Fastly knows which VCL Snippets goes before which in the "big" VCL File. For example we might have the Main.vcl that calls both the datadome-init and the datadome-pass, but the datadome-pass also calls datadome-init. So if they are placed in the code for example like:
then it would rise an error as mentioned here. And instead it should be placed like:
(since main calls datadome-pass and init and pass calls init) As for sending you the VCL Files so you can test with them, could I do it through email or some other private channel so its not public in this issue? Also I noticed that I get a lot more errors by running Falco from a Terraform plan than just Falco to the Main.vcl and the snippets (and sometimes even different ones). But I can do it either way so Ill just stick to running Falco like (let me know if Im missing any option in this command):
|
Yes, I understand that Fastly embeds VCL snippets which corresponds to phase by finding macro like And So back to the current case, it seems you include a snippet that has However, probably we don't care about Anyway, I'm interested in your problem so I appreciate you could send me your VCLs. Could you send it through the email that is written in my GitHub account? Of course, this is a good chance to create some public channel to talk about this project (Discord, Slack, or something), thanks. |
@ysugimoto I know this is an old issue but seems still relevant, would a #falco channel on the Gophers slack be a good spot for this? |
PROBLEM
So Im trying to get the syntax of the vcl files reviewed with Falco. But I get these weird errors that I don't know how to fix.
Basically I have a Main.vcl file and then multiple snippets. For example I have one named
datadome-init.vcl
which has the following method declared inside of it:But then I have another snippet named:
datadome-pass.vcl
that has the following code:However when I run falco I get the following errors:
I have also tried to add:
include "snippet::datadome-init.vcl";
include "snippet::set_origin_header";
with no luck
The directory structure is:
Expected behavior
Basically to show no error since the code works in the fastly UI with no errors.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: