Skip to content

Commit

Permalink
Run on local docker if exist (#3296)
Browse files Browse the repository at this point in the history
* Fixed error message

* add validation image not exist locally

* changelog

* fix changelog

* change version

* use the DockerBase pull_image function

* revert changes
  • Loading branch information
MosheEichler authored Jul 17, 2023
1 parent 3777135 commit 4910916
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog
## Unreleased
* Fixed an issue where **lint** and **validate** commands failed on integrations and scripts that use docker images that are not available in the Docker Hub but exist locally.
* Added documentation for the flag **override-existing** used in upload.
* Fixed an issue where **validate** failed on Incident Field items with a `template` value.
* Improved memory efficiency in **update-content-graph** and **create-content-graph** commands.
Expand Down
4 changes: 1 addition & 3 deletions demisto_sdk/commands/common/docker_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,8 @@ def _get_python_version_from_image_client(image: str) -> Version:
Returns:
Version: Python version X.Y (3.7, 3.6, ..)
"""
docker_client = init_global_docker_client()
try:
docker_client.images.pull(image)
image_model = docker_client.images.get(image)
image_model = DockerBase.pull_image(image)
env = image_model.attrs["Config"]["Env"]
logger.debug(f"Got {env=} from {image=}")
return _get_python_version_from_env(env)
Expand Down
2 changes: 1 addition & 1 deletion demisto_sdk/commands/common/hook_validations/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def get_deprecated_dockers_list() -> dict:
f"This may happen if you are not connected to the internet."
)
raise Exception(
f"Could not get latest demisto-sdk version.\nEncountered error: {exc_msg}"
f"Could not get deprecated docker images from dockerfiles repo.\nEncountered error: {exc_msg}"
)

def is_docker_image_deprecated(
Expand Down

0 comments on commit 4910916

Please sign in to comment.