Skip to content

Add S3 cache `AuthenticationType` `none`

Alexander Fisher requested to merge alexjfisher/gitlab-runner:issue28224 into main

What does this MR do?

This adds an s3 cache authentication type of none

Why was this MR needed?

Previously there was no way to use an s3 bucket without either setting up an IAM user with access/secret keys (which need rotating etc), or an IAM role (which is only applicable if running the runner inside of AWS).

I'm using this change to store the cache in an s3 bucket, connecting via a private AWS s3 VPC endpoint (configured as the ServerAddress). The bucket's policy allows read/write to the bucket when the request comes from the endpoint.

What's the best way to test this MR?

I've added a couple of unit tests, but if you want to test this out for real, it should also be possible to configure an s3 bucket to allow unauthenticated read/write when connecting from specific source IP addresses.

What are the relevant issue numbers?

Fixes #28224

P.S. I'm new to golang, so any feedback on code style or testing etc. much appreciated.

Merge request reports