Adds Path and Share settings to S3 cache
What does this MR do?
Adds settings Shared
and Path
to cache settings. Both will modify resulting URL as pointed out by @ayufan in #1897 (closed):
- By default, we keep current behavior, URLs have the form
/runner/<token>/project/<id>/<cache-key>
- When
shared
flag is enabled, the runner segment is removed from the URL:/project/<id>/<cache-key>
- In any case, we could add a
Path
prefix to that URL:<path>/runner/<token>/project/<id>/<cache-key>
Why was this MR needed?
Some users have problems when using autoscaling, because there's no way to remove runner token in the URL or add a prefix with the path. This change will enable both things preserving existing functionality.
Are there points in the code the reviewer needs to double check?
Path
allows spaces and other non-compatible URL characters that might cause problems or security issues. I've assumed we don't have to solve this here, given that ServerAddress
for instance might introduce same problems - but it wouldn't harm to point that out in case we do that in the future. cache_extractor.go
may be a good place to check for malformed URLs.
Does this MR meet the acceptance criteria?
-
Documentation created/updated - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Branch has no merge conflicts with master
(if you do - rebase it please)
What are the relevant issue numbers?
Resolves #1897 (closed)