Allow multiple destinations#184
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
I signed it! |
priyawadhwa
left a comment
There was a problem hiding this comment.
Thanks for contributing, I left a couple comments!
| logrus.Error(err) | ||
| os.Exit(1) | ||
|
|
||
| for _, destination := range destinations { |
There was a problem hiding this comment.
Could we instead pass the destinations into DoPush, and have the for loop there?
| for _, destination := range destinations { | ||
| if err := executor.DoPush(ref, image, destination, tarPath); err != nil { | ||
| logrus.Error(err) | ||
| } |
There was a problem hiding this comment.
We probably want to add the os.Exit(1) here!
|
CLAs look good, thanks! |
|
Tested this, should be fine |
|
Great, thanks! |
Hello everyone,
I had the requirement to push an image to multiple container registries.
Since the image is already built it would make sense to push it to more than one registry (instead of building the image again with a different destination).
I recycled and existing type for multiple args and added a simple for-loop.
The missing
os.Exitinside the loop made sense to me (why stop when only one of multiple pushes fail)Tested this in my fork.
You can now specify multiple
--destinationflags.If the
tarpathis set, multiple tar-files (one for each destination) will be generated.Please note that I didn't touch the
README.mdin this pull request.