feat(ecr): update and validate pull-through cache rules (#4342)

This commit is contained in:
XuJian authored and GitHub committed 2026-09-24 15:38:19 -04:00
1 parent 077b65df5c
commit b658c5f020
6 files changed
+210 -3

No files matched your search

@@ -185,6 +185,20 @@ class EcrTest {
.extracting(PullThroughCacheRule::ecrRepositoryPrefix)
.containsExactly(firstPrefix);
String credentialArn =
"arn:aws:secretsmanager:us-east-1:000000000000:secret:ecr-pullthroughcache/sdk";
UpdatePullThroughCacheRuleResponse updated = ecr.updatePullThroughCacheRule(builder -> builder
.ecrRepositoryPrefix(firstPrefix)
.credentialArn(credentialArn));
ValidatePullThroughCacheRuleResponse validated = ecr.validatePullThroughCacheRule(
builder -> builder.ecrRepositoryPrefix(firstPrefix));
assertThat(updated.credentialArn()).isEqualTo(credentialArn);
assertThat(updated.updatedAt()).isNotNull();
assertThat(validated.isValid()).isTrue();
assertThat(validated.credentialArn()).isEqualTo(credentialArn);
assertThat(validated.upstreamRegistryUrl()).isEqualTo("registry-1.docker.io");
DeletePullThroughCacheRuleResponse deleted = ecr.deletePullThroughCacheRule(
builder -> builder.ecrRepositoryPrefix(firstPrefix));
assertThat(deleted.ecrRepositoryPrefix()).isEqualTo(firstPrefix);