-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Enabled the dynamic reload of GeoIP data #2107
Conversation
/assign @aledbf |
} | ||
geoip_get "GeoIP.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" | ||
geoip_get "GeoLiteCity.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" | ||
geoip_get "GeoIPASNum.dat.gz" "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea 👍
internal/ingress/controller/nginx.go
Outdated
var watchPath string | ||
var watchAction func() | ||
var addWatcher func() | ||
addWatcher = func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't work out how to define a function with parameters!? hence why I had to do variables, set them, and invoke the function. It works, but it doesn't feel right?
internal/ingress/controller/nginx.go
Outdated
addWatcher() | ||
|
||
// Add the GeoIP data to the watcher | ||
geoData := [3]string{"/etc/nginx/geoip/GeoIP.dat", "/etc/nginx/geoip/GeoIPASNum.dat", "/etc/nginx/geoip/GeoLiteCity.dat"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to enumerate the directory instead of hard coding files, as I couldn't sus our how to recursively watch a folder
@Stono how about
(inside the else) |
@aledbf thanks! I had to change: |
@aledbf are the e2e tests flakey? Not sure how this change would have caused:
|
The update of the nginx image will solve this issue. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, Stono The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hey,
This attempts to fix #2100
In summary I have:
/etc/nginx/geoip
Things I don't like:
/etc/nginx/geoip
, it'd be nice to probably just enumerate the files in that directory and watch them all (in case they change name/are added/removed)I've tested it on my controller, this was me modifying each file: