Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build.Repo and Build.CacheRepo now uses buildRepo() #40

Merged
merged 4 commits into from Mar 15, 2022

Conversation

hcsaustrup
Copy link
Contributor

@hcsaustrup hcsaustrup commented Mar 4, 2022

Fixed assignment of Build.Repo and Build.CacheRepo so it not only contains the specified repo, but also registry by using buildRepo().
This required for pushing images to private repositories.

@myers
Copy link

myers commented Mar 10, 2022

I got stung by this as well.

A work around is to set the repo in your .drone.yml to have the registry / repo.

@hcsaustrup hcsaustrup changed the title fix: Build.Repo now uses buildRepo() fix: Build.Repo and Build.CacheRepo now uses buildRepo() Mar 12, 2022
@hcsaustrup
Copy link
Contributor Author

Turns out CacheRepo also needed buildRepo()

@shubham149 shubham149 merged commit fae9271 into drone:main Mar 15, 2022
@ymage
Copy link
Contributor

ymage commented Apr 3, 2022

Hi,

It seems I can't push anymore on docker hub public repo since this change.
Before, it generated some --destination=<myrepo>/<myimage>:latest => Push OK
Now, it generates --destination=https://index.docker.io/v1/<myrepo>/<myimage>:latest => Push KO

I tried with vanilla kaniko and it seems the issue comes from this added registry url prefix.

@shubham149
Copy link
Contributor

shubham149 commented Apr 4, 2022

Thanks a lot @ymage for bringing it up.

The aim for this change was to prefix the registry url in the repo name but looks like a lot of cases are missing here.

  1. If registry URL is public dockerhub, the full repo name: index.docker.io//: but this change generates repo name as https://index.docker.io/v1/<myrepo>/<myimage>:latest. Also, it needs to handle repo's without dockerhubUsr e.g. alpine image.
  2. https:// is usually present in the registry url but should not be mentioned in the repo name.

There can be other cases which might have missed here. I am inclined towards making a backward incompatible change where user has to mention PLUGIN_EXPAND_REPO to prepend registry url to the repo.

@shubham149
Copy link
Contributor

@hcsaustrup @myers I am going ahead with the backward incompatible change here: #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants