Closed martin-mat closed 5 days ago
What about registry_spec.cr where docker login is mandatory? There is code like:
if ENV["DOCKERHUB_USERNAME"]? && ENV["DOCKERHUB_PASSWORD"]? result = Dockerd.exec("docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD", force_output: true) Log.info { "Docker Login output: #{result[:output]}" } else puts "DOCKERHUB_USERNAME & DOCKERHUB_PASSWORD Must be set.".colorize(:red) exit 1 end
What about registry_spec.cr where docker login is mandatory? There is code like:
if ENV["DOCKERHUB_USERNAME"]? && ENV["DOCKERHUB_PASSWORD"]? result = Dockerd.exec("docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD", force_output: true) Log.info { "Docker Login output: #{result[:output]}" } else puts "DOCKERHUB_USERNAME & DOCKERHUB_PASSWORD Must be set.".colorize(:red) exit 1 end
Good point. Currently it passes because DOCKERHUB_USERNAME are set (but empty string) so the condition is true. Docker login fails but is ignored. At the end the test passes, despite not being logged in to dockerhub.
Make "docker login" in spec execution optional. Note that it has anyway limited (if any) effect as docker registry mirror cache is used and docker login does not really have expected affect. The registry mirror cache itself needs to be configured with respective credentials.
Issues:
Refs: #2066
How has this been tested:
Types of changes:
Checklist:
Documentation
Code Review
Issue