Ejemplo n.º 1
0
def push_image(cluster_name: str, image_name: str, image_path: str,
               remote_context_path: str, remote_image_name: str, **kwargs):
    cluster_details = load_cluster_details(cluster_name=cluster_name)

    if cluster_details['cloud']['infra'] == 'azure':
        executor = GrassAzureExecutor(cluster_name=cluster_name)
        executor.push_image(image_name=image_name,
                            image_path=image_path,
                            remote_context_path=remote_context_path,
                            remote_image_name=remote_image_name)
Ejemplo n.º 2
0
def push_image(cluster_name: str, image_name: str, image_path: str,
               remote_context_path: str, remote_image_name: str, **kwargs):
    cluster_details = load_cluster_details(cluster_name=cluster_name)

    if cluster_details["mode"] in ["grass/azure", "grass/on-premises"]:
        executor = GrassAzureExecutor(cluster_name=cluster_name)
        executor.push_image(image_name=image_name,
                            image_path=image_path,
                            remote_context_path=remote_context_path,
                            remote_image_name=remote_image_name)
    else:
        raise BadRequestError(
            f"Unsupported command in mode '{cluster_details['mode']}'.")