Docker login if exec might pull image
The `app exec` and `accessory exec` commands will run `docker run` if they are not set to reuse existing containers. This might need to pull an image so let's make sure we are logged in before running the command. Fixes: https://github.com/basecamp/kamal/issues/1163
This commit is contained in:
@@ -307,6 +307,7 @@ class CliAppTest < CliTestCase
|
||||
|
||||
test "exec" do
|
||||
run_command("exec", "ruby -v").tap do |output|
|
||||
assert_match "docker login -u [REDACTED] -p [REDACTED]", output
|
||||
assert_match "docker run --rm --network kamal --env-file .kamal/apps/app/env/roles/web.env --log-opt max-size=\"10m\" dhh/app:latest ruby -v", output
|
||||
end
|
||||
end
|
||||
@@ -355,6 +356,7 @@ class CliAppTest < CliTestCase
|
||||
|
||||
run_command("exec", "-i", "ruby -v").tap do |output|
|
||||
assert_hook_ran "pre-connect", output
|
||||
assert_match "docker login -u [REDACTED] -p [REDACTED]", output
|
||||
assert_match "Get most recent version available as an image...", output
|
||||
assert_match "Launching interactive command with version latest via SSH from new container on 1.1.1.1...", output
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user