Skip to content

Upgrade minio to v7

John Cai requested to merge jc-update-minio-library into main

What does this MR do?

  1. Upgrades the minio-go library to v7.0.8
  2. Slight refactor of minio initialization code, as going from v6 to v7 introduced a breaking change in the API. Namely, they got rid of NewWithCredentials

Why was this MR needed?

There was a bug in the minio-go library that got fixed. Namely, the Amazon sts endpoint was being hardcoded and the China region was not supported.

What's the best way to test this MR?

  1. setup IAM credentials in AWS
  2. set up an s3 runner cache with cn-north-1 as the bucket location
config.toml
[runners.cache]
  Type = "s3"
  [runners.cache.s3]
  ServerName = ""
  AccessKey = ""
  SecretKey = ""
  BucketName = <bucket name>
  BucketLocation = "cn-north-1"
  1. run runner with AWS_WEB_IDENTITY_TOKEN_FILE set to any non empty value and AWS_REGION set to cn-north-1.

  2. run a simple build

.gitlab-ci.yml
cache:  
  key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
  paths:  
    - cached_file

job:
  script:
    - echo "generating file to be cached if it isn't cached."  
    - if [ ! -f cached_file ]; then echo 'some important data' > cached_file; else echo "Reusing cached_file."; fi;  
  1. Though the cache will fail because we are using dummy values for the credentials, the STS url it creates should be correct.

when using main branch you should see an error with the wrong URL:

ERROR: error while generating S3 pre-signed URL     error=Post https://sts.cn-north-1.amazonaws.com?Action=AssumeRoleWithWebIdentity&Version=2011-06-15&WebIdentityToken=: dial tcp: lookup sts.cn-north-1.amazonaws.com: no such host```
when using this branch you should see a 400 error, which means it got to the valid URL:

ERROR: error while generating S3 pre-signed URL     error=400 Bad Request

What are the relevant issue numbers?

gitlab#330047 (closed)

Edited by Steve Xuereb

Merge request reports