Skip to content

Commit 880f6d4

Browse files
committed
registry: update example to include AWS provider usage
Add registry-aws dependency to examples/pom.xml. Update Main.java to use generic placeholder endpoints, add REGION constant, and pass withRegion() to the client builder to support running the example with AWS ECR. Made-with: Cursor
1 parent 03f6a8c commit 880f6d4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@
126126
<artifactId>registry-gcp</artifactId>
127127
<version>${project.version}</version>
128128
</dependency>
129+
<dependency>
130+
<groupId>com.salesforce.multicloudj</groupId>
131+
<artifactId>registry-aws</artifactId>
132+
<version>${project.version}</version>
133+
</dependency>
129134
<dependency>
130135
<groupId>org.slf4j</groupId>
131136
<artifactId>slf4j-api</artifactId>

examples/src/main/java/com/salesforce/multicloudj/registry/Main.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ public class Main {
3030

3131
// Constants
3232
private static final String DEFAULT_PROVIDER = "gcp";
33-
private static final String REGISTRY_ENDPOINT = "https://us-docker.pkg.dev";
34-
private static final String REPOSITORY = "my-project/my-repo/my-image";
33+
private static final String REGISTRY_ENDPOINT = "https://your-registry-endpoint";
34+
private static final String REPOSITORY = "your-repository";
3535
private static final String TAG = "latest";
36+
private static final String REGION = "your-region";
3637

3738
// Demo settings
3839
private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
@@ -163,6 +164,7 @@ private static void showSectionHeaderWithPause(String title) {
163164
private ContainerRegistryClient initializeClient() {
164165
return ContainerRegistryClient.builder(provider)
165166
.withRegistryEndpoint(REGISTRY_ENDPOINT)
167+
.withRegion(REGION)
166168
.build();
167169
}
168170

@@ -296,6 +298,7 @@ private void demonstratePlatformSelection() {
296298
try (ContainerRegistryClient client =
297299
ContainerRegistryClient.builder(provider)
298300
.withRegistryEndpoint(REGISTRY_ENDPOINT)
301+
.withRegion(REGION)
299302
.withPlatform(arm64)
300303
.build()) {
301304

0 commit comments

Comments
 (0)