Skip to content
Snippets Groups Projects

Add support for credentials store

Merged Kirill Shirinkin requested to merge (removed):master into master

What does this MR do?

With this MR runner will correctly fetch credentials store from credsStore, if it's configured.

Why was this MR needed?

In some environments, specifically in AWS, credentials are provided via credentials store, as documented here: https://docs.docker.com/engine/reference/commandline/login/#credentials-store. Currently this auth method doesn't work with gitlab runner. In case of AWS the only solution would be to re-trigger aws ecr get-login in a cron job every 12 hours to re-fetch credentials. See this Issue for more details: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1583

With new implementation, in addition to all previous ways to provide credentials, Gitlab Runner will also use credsStore, in a similar way Docker CLI does it.

Please notice, that this MR still doesn't cover all possible use cases, specifically it doesn't cover usage of "credsHelpers" key of Docker config - I can add it in next MR, if I get more time to work on this.

In any case, even without credsHelper support, this code change simplifies usage of Gitlab Runner combined with AWS ECR or GCE GCR, making authentication simple, transparent and automated. Also see:

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1583

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @Fodoj

    It is interesting. You are missing tests for this storage.

    @nick.thomas Could you jump-in and help with godep issue?

  • @tmaczukin how close are we to merging https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/505 ? It might be easier to do that then use govendor to add the new dependency here...

  • @Fodoj I purposefully avoided introducing support for these extra auth config methods in https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/301 because it pulled in so many extra packages. It doesn't feel like the docker code is built to allow sensible re-use of a subset of this code.

    Can we produce a full dependency graph? It's possible there's an alternative way to get these auth mechanisms working without pulling in quite so many extra packages.

  • @nick.thomas I can try, just need to get the build running here in CI.. So I guess the fix to godeps isssue is to wait for !505 (merged), and try it with govendor, right?

  • You're missing a changelog entry, and you have a failed pipeline.

    @zj Changelog entries are generated with script from merge requests titles at version release. There is no need to add them in the MR :)

    @nick.thomas @Fodoj I hope I will find time and merge !505 (merged) in next week.

  • @Fodoj !505 (merged) was just merged into master branch :wink:

  • added executordocker ~58728 labels

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading