kamal app exec may fail if not logged in#1227
kamal app exec may fail if not logged in#1227andrewjanssen wants to merge 1 commit intobasecamp:mainfrom
Conversation
|
@andrewjanssen, @cromega - like in #1223, we don't want to require secrets to be able to run Also I would expect the image to already be on the host - what's the situation where that's not the case? |
|
@djmb in our case, running a migration in a new build before we get to the deploy part. A The real solution, of course, would be built-in support for migrations in a way that doesn't require working around base assumptions in the tool. |
|
@cromega - where are you running the migration? In a |
|
@djmb our workflow is the following: Assume v1 of app is running
|
That's a good point, I didn't know that when writing this PR. Could address that by changing this PR to only log in if the registry credentials are present. Not very important to me either way. |
|
@cromega - I think you should be able to ensure the pipeline works by adding |
|
Implemented in #1511 |
Current state
The central Kamal command,
kamal deploy, automatically logs you in because it requires access to the container registry.Unlike the deploy command,
kamal app execdoes not log you in. Yet it sometimes requires registry access too. In these cases, when the host is not auth'd, it fails.Why would
kamal app execneed auth? When you tell it to use an image that's not currently on the host, as in #1163.Note that containers don't stay authorized very long. Container registry session tokens expire pretty quickly:
Proposed state
It would be nice for all Kamal commands to have the same “it just works” auth behavior. I think this is the simplicity that attracts people to Kamal. So it would be nice if
kamal exectook care of its own auth, likekamal deploydoes.Changes introduced by this PR
This PR makes
kamal app execlog in before executingdocker run.Other comments
If this PR is approved I'd be happy to make a follow-up PR for
kamal accessory exec.Resolves #1163.