-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[ACR] az acr login: Support Podman for --name parameter
#31850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
db42a6b
6212d93
75bece2
d3dc428
3a97a8e
54d708b
8f7e84b
6dd4a4f
a165dde
1efc1ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
|
|
||
| import os | ||
| import re | ||
| import shutil | ||
| from knack.util import CLIError | ||
| from knack.log import get_logger | ||
| from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError | ||
|
|
@@ -396,6 +397,8 @@ def get_docker_command(is_diagnostics_context=False): | |
| docker_command = os.getenv('DOCKER_COMMAND') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function name is now misleading because the logic supports Podman as well. Consider renaming it to avoid confusion for future maintainers. |
||
| else: | ||
| docker_command = 'docker' | ||
| if not shutil.which('docker') and shutil.which('podman'): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is also used by _get_docker_status_and_version which outputs hardcoded "Docker" messages (e.g., "Docker version", "Docker daemon status"). When Podman is used instead, these messages will be inaccurate. Please update check_healthy.py as well to dynamically reflect which tool is being checked, or use tool-agnostic terminology like "Container runtime".
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lizMSFT this has been updated, however, |
||
| docker_command = 'podman' | ||
cpressland marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| from subprocess import PIPE, Popen, CalledProcessError | ||
| try: | ||
|
|
@@ -405,7 +408,7 @@ def get_docker_command(is_diagnostics_context=False): | |
| logger.debug("Could not run '%s' command. Exception: %s", docker_command, str(e)) | ||
| # The executable may not be discoverable in WSL so retry *.exe once | ||
| try: | ||
| docker_command = 'docker.exe' | ||
| docker_command = f'{docker_command}.exe' | ||
| p = Popen([docker_command, "ps"], stdout=PIPE, stderr=PIPE) | ||
| _, stderr = p.communicate() | ||
| except OSError as inner: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this
logger.warning("%s version: %s, build %s, platform %s/%s", docker_command.title(), version, commit, os, arch)statement be indented inside the else block?Right now it can raise a NameError if version, commit, os, or arch aren’t defined.