Pull GitLab Runner cache S3 server address from the runners config

Summary

As per issue, remove runner specific configuration fields from the chart, GitLab runner S3 settings are getting deprecated from the chart and instead we will be using config template.

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "ubuntu:16.04"
        [runners.cache]
          Type = "s3"
          Path = "runner"
          Shared = true
          [runners.cache.s3]
            ServerAddress = "s3.amazonaws.com"
            BucketName = "my_bucket_name"
            BucketLocation = "eu-west-1"
            Insecure = false

Deprecation notice.

runners:
  cache: {}
    ## S3 settings
    ## DEPRECATED: See https://docs.gitlab.com/runner/install/kubernetes.html#additional-configuration and https://docs.gitlab.com/runner/install/kubernetes.html#using-cache-with-configuration-template
    # s3ServerAddress: s3.amazonaws.com
    # s3BucketName:
    # s3BucketLocation:
    # s3CacheInsecure: false

However, we in the main chart rely on the s3ServerAddress field in order to set the default minio URL if the s3ServerAddress is not set and if it is set we still take the value from s3ServerAddress, which we do so with this template method which overrides the configuration set in the config template as per below, therefore the ServerAddress is ignored:

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        [runners.cache]
          Type = "s3"
          [runners.cache.s3]
            ServerAddress = "s3.amazonaws.com"

We should make, if possible so that the value s3ServerAddress is taken from the config.template.toml ServerAddress or otherwise set the default minio URL and not rely on s3ServerAddress.

Current behavior

Runners cache S3 settings server address is pulled from s3ServerAddress.

runners:
  cache: {}
    ## S3 settings
    ## DEPRECATED: See https://docs.gitlab.com/runner/install/kubernetes.html#additional-configuration and https://docs.gitlab.com/runner/install/kubernetes.html#using-cache-with-configuration-template
    # s3ServerAddress: s3.amazonaws.com
    # s3BucketName:
    # s3BucketLocation:
    # s3CacheInsecure: false

Expected behavior

Runners S3 cache settings server address should be pulled from the below value:

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        [runners.cache]
          Type = "s3"
          [runners.cache.s3]
            ServerAddress = "s3.amazonaws.com"

Versions

  • Chart: 4.11.3
Edited by Julius Kvedaras