Commit graph

9 commits

Author SHA1 Message Date
Joseph Schorr
d15ed05933 Add test for breakage in ipresolver 2018-12-10 13:13:01 -05:00
Joseph Schorr
c3710a6a5e Add ability for specific geographic regions to be blocked from pulling images within a namespace 2018-12-06 17:14:45 -05:00
Kenny Lee Sin Cheong
bb01e08d44
Fix ipresolver test_thread_missing_file (#3268)
There is no guarantee that the assertion would happen AFTER "sleep" is
called.

Block the caller for an amount of time to give "update_ip_thread" time to call "sleep" and raise LoopInterruptionForTest exception to terminate the thread.
2018-10-15 17:18:11 -04:00
Kenny Lee Sin Cheong
fc67bbd0a6
IPResolver: fix unreachable code (#3267)
* Fix unreachable code

_get_aws_ip_ranges handles missing file exceptions and returns None,
so the excepttion handling block in the UpdateIPRange thread is never reached.

* Test for missing range file in resolver thread
2018-10-12 10:24:28 -04:00
Kenny Lee Sin Cheong
b6336393de Make IPResolver run the update in a separate thread
A separate thread will cache the results of parsing the range
file, and the IPResolver will hit the cache instead of blocking while recomputing the
ranges everytime. The thread updates every 600s, and retry every 60s on
failures.
2018-08-31 14:00:53 -04:00
Joseph Schorr
c168413a8e Fix bug when running ipresolver under Gitlab CI
Since the container does contain IP data, this would fail
2017-11-30 10:23:58 -05:00
Joseph Schorr
05b4a7d457 Add worker to update ipresolver data files every few hours 2017-09-28 14:40:59 -04:00
Joseph Schorr
010dda2c52 Add CloudFrontedS3Storage, which redirects to CloudFront for non-S3 ips 2017-09-28 14:40:58 -04:00
Joseph Schorr
2d522764f7 Add IP resolver utility that returns whether an IP is under AWS 2017-09-26 16:11:16 -04:00