From 049153e7cfec6fc22524158c8e28f783644e9989 Mon Sep 17 00:00:00 2001 From: Sumu Pitchayan <35242245+sumupitchayan@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:09:08 -0400 Subject: [PATCH] revert: "chore(ecs): clarify it's possible to use image digest on fromEcrRepository" (#27143) Reverts aws/aws-cdk#27115 Renaming `tag` prop to `tagOrDigest` of the `ContainerImage.fromEcrRepository` function introduces a breaking change, not for typescript users, but for other languages that require specifying the property name when calling the function. --- .../@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts | 7 ++----- packages/aws-cdk-lib/aws-ecs/lib/container-image.ts | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts b/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts index c6e4423b06b6d..8a48d1bbde767 100644 --- a/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts +++ b/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts @@ -26,12 +26,9 @@ export interface ContainerImageConfig { export abstract class ContainerImage { /** * Reference an image in an ECR repository - * - * @param repository ECR repository - * @param tagOrDigest Optional image tag or digest (digests must start with `sha256:`) */ - public static fromEcrRepository(repository: ecr.IRepository, tagOrDigest: string = 'latest'): ContainerImage { - return new EcrImage(repository, tagOrDigest); + public static fromEcrRepository(repository: ecr.IRepository, tag: string = 'latest'): ContainerImage { + return new EcrImage(repository, tag); } /** diff --git a/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts b/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts index 893a8f764180e..7ba6d6bf320d7 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts @@ -18,12 +18,9 @@ export abstract class ContainerImage { /** * Reference an image in an ECR repository - * - * @param repository ECR repository - * @param tagOrDigest Optional image tag or digest (digests must start with `sha256:`) */ - public static fromEcrRepository(repository: ecr.IRepository, tagOrDigest: string = 'latest') { - return new EcrImage(repository, tagOrDigest); + public static fromEcrRepository(repository: ecr.IRepository, tag: string = 'latest') { + return new EcrImage(repository, tag); } /**