kamal app exec may fail if not logged in #1227
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 exec
does 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 exec
need 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 exec
took care of its own auth, likekamal deploy
does.Changes introduced by this PR
This PR makes
kamal app exec
log 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.