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

Add the option to include custom VCL through parameters #7850

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AbdelrahmanElawady
Copy link
Contributor

@AbdelrahmanElawady AbdelrahmanElawady commented Oct 25, 2023

This PR adds the option to include custom VCL through parameters in Varnish cache. This allows importing plugins (VMODs) and using them throughout the VCL file. It allows adding custom logic that is not handled by t3c. For example adding the functionality of some ATS plugins like Header Rewrite and Regex Remap.

It expects the subroutine that the code should be appended to so the user can have custom logic in different parts of the transaction lifecycle.


Which Traffic Control components are affected by this PR?

  • Traffic Control Cache Config (t3c, formerly ORT)

What is the best way to verify this PR?

  • Using CDN-in-a-Box, edit the edge parameters to include custom VCL. For example here is some code to remove via header in case of a test endpoint:
{
			"configFile": "default.vcl",
			"name": "vcl_deliver",
			"secure": false,
			"value": "if (req.url ~ \"/test\") {unset resp.http.via;}"
}
  • Run docker-compose exec enroller curl -L -o /dev/null -D - -s "http://video.demo1.mycdn.ciab.test/test" to print response headers.
  • via header should not be printed

PR submission checklist

@AbdelrahmanElawady AbdelrahmanElawady added new feature A new feature, capability or behavior low impact affects only a small portion of a CDN, and cannot itself break one cache-config Cache config generation Varnish related to Varnish labels Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #7850 (224ce75) into master (23e9248) will decrease coverage by 2.90%.
Report is 35 commits behind head on master.
The diff coverage is 20.00%.

@@             Coverage Diff              @@
##             master    #7850      +/-   ##
============================================
- Coverage     31.87%   28.97%   -2.90%     
  Complexity       98       98              
============================================
  Files           717      603     -114     
  Lines         82756    77425    -5331     
  Branches        970       90     -880     
============================================
- Hits          26377    22437    -3940     
+ Misses        54218    52894    -1324     
+ Partials       2161     2094      -67     
Flag Coverage Δ
golib_unit 53.88% <33.33%> (+0.30%) ⬆️
grove_unit 12.02% <ø> (ø)
t3c_unit 5.80% <0.00%> (-0.12%) ⬇️
traffic_monitor_unit 26.44% <ø> (ø)
traffic_ops_unit 21.68% <ø> (ø)
traffic_portal_v2 ?
traffic_stats_unit 10.78% <ø> (ø)
unit_tests 25.81% <20.00%> (-3.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
cache-config/t3c-apply/config/config.go 0.00% <ø> (ø)
cache-config/t3c-apply/torequest/cmd.go 0.00% <ø> (ø)
cache-config/t3c-apply/torequest/torequest.go 5.65% <ø> (ø)
cache-config/t3c-apply/util/gitutil.go 0.00% <ø> (ø)
cache-config/t3c-apply/util/util.go 0.00% <ø> (ø)
cache-config/t3c-check-refs/config/config.go 0.00% <ø> (ø)
cache-config/t3c-check-refs/t3c-check-refs.go 1.78% <ø> (ø)
cache-config/t3c-generate/cfgfile/all.go 51.38% <ø> (ø)
cache-config/t3c-generate/cfgfile/routing.go 84.00% <ø> (ø)
cache-config/t3c-generate/cfgfile/sslkeys.go 0.00% <ø> (ø)
... and 64 more

... and 152 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache-config Cache config generation low impact affects only a small portion of a CDN, and cannot itself break one new feature A new feature, capability or behavior Varnish related to Varnish
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

1 participant