Merge "Fixing tagging of node-hello"

This commit is contained in:
Zuul
2025-03-06 14:56:24 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
from config.docker.objects.registry import Registry
from framework.logging.automation_logger import get_logger
from framework.validation.validation import validate_str_contains
from keywords.base_keyword import BaseKeyword
from keywords.docker.login.docker_login_keywords import DockerLoginKeywords
@@ -41,7 +42,11 @@ class DockerLoadImageKeywords(BaseKeyword):
Returns:
"""
self.ssh_connection.send_as_sudo(f"docker tag {image_name} {registry.get_registry_url()}/{tag_name}")
output = self.ssh_connection.send_as_sudo(f"docker tag {image_name} {registry.get_registry_url()}/{tag_name}")
if len(output) > 1: # If things go well, we get the prompt back. Otherwise, the first line returned is an Error.
get_logger().log_error(output[0])
raise Exception(f"Failed to tag docker image {image_name}")
def push_docker_image_to_registry(self, tag_name: str, registry: Registry):
"""

View File

@@ -1387,5 +1387,5 @@ def deploy_images_to_local_registry(ssh_connection: SSHConnection):
file_keywords.upload_file(get_stx_resource_path("resources/cloud_platform/images/node-hello-alpine/node-hello-alpine.tar.gz"), "/home/sysadmin/node-hello-alpine.tar.gz", overwrite=False)
TarKeywords(ssh_connection).decompress_tar_gz("/home/sysadmin/node-hello-alpine.tar.gz")
docker_load_image_keywords.load_docker_image_to_host("node-hello-alpine.tar")
docker_load_image_keywords.tag_docker_image_for_registry("registry.local:9001/node-hello:alpine", "node-hello", local_registry)
docker_load_image_keywords.tag_docker_image_for_registry("node-hello:alpine", "node-hello", local_registry)
docker_load_image_keywords.push_docker_image_to_registry("node-hello", local_registry)