Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-containers-containerregistry</artifactId>
<version>1.1.0-beta.5</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ com.azure:azure-communication-phonenumbers;1.1.1;1.2.0-beta.1
com.azure:azure-communication-networktraversal;1.1.0-beta.2;1.1.0-beta.3
com.azure:azure-communication-jobrouter;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-rooms;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-containers-containerregistry;1.0.14;1.1.0-beta.5
com.azure:azure-containers-containerregistry;1.0.14;1.1.0
com.azure:azure-containers-containerregistry-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-core;1.39.0;1.40.0-beta.1
com.azure:azure-core-amqp;2.8.5;2.9.0-beta.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-containers-containerregistry</artifactId>
<version>1.1.0-beta.5</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# Release History

## 1.1.0-beta.5 (Unreleased)
## 1.1.0 (2023-05-11)

### Features Added
### Features added from version 1.0.14
- Added `ContainerRegistryContentClient` and `ContainerRegistryAsyncContentClient` classes that allow to upload and download images to Azure Container Registry.

### Breaking Changes from version 1.1.0-beta.4
- Added sanity check for manifest size at download time - if manifest is bigger than 4MB, `ServiceResponseException` will be thrown. Previously no exception was thrown.
- Added sanity check for `Content-Length` header presence on the response when downloading blobs - if it's not present, `ServiceResponseException` will be thrown.
Previously, content was buffered and no exception was thrown.
- Renamed `ManifestMediaType.OCI_MANIFEST` to `ManifestMediaType.OCI_IMAGE_MANIFEST`.

- Added sanity check for manifest size at download time - if manifest is bigger than 4MB, `ServiceResponseException` will be thrown.
- There are no breaking changes from previous stable version.

### Bugs Fixed
### Other changes from version 1.0.14
- `ContainerRegistryAudience.AZURE_RESOURCE_MANAGER_GERMANY` is deprecated following [Azure Germany cloud deprecation](https://learn.microsoft.com/azure/cloud-adoption-framework/migrate/azure-best-practices/multiple-regions)
- Default constructors on following classes were deprecated: `ArtifactManifestPlatform`, `ArtifactManifestOrder`, `ArtifactOperatingSystem`, `ArtifactTagOrder`, `ArtifactManifestPlatform`.

### Other Changes
#### Dependency Updates
- Upgraded `azure-core-http-netty` from `1.13.2` to version `1.13.3`.
- Upgraded `azure-core` from `1.38.0` to version `1.39.0`.

## 1.0.14 (2023-04-21)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ and then include the direct dependency in the dependencies section without the v
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-containers-containerregistry</artifactId>
<version>1.0.13</version>
<version>1.1.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-containers-containerregistry</artifactId>
<version>1.1.0-beta.5</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-containers-containerregistry;current} -->

<name>Microsoft Azure SDK for Container Registry</name>
<description>This package contains Microsoft Azure SDK for Container Registry.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public Mono<SetManifestResult> setManifest(OciImageManifest manifest, String tag
return monoError(LOGGER, new NullPointerException("'manifest' can't be null."));
}

return withContext(context -> setManifestWithResponse(BinaryData.fromObject(manifest), tag, ManifestMediaType.OCI_MANIFEST, context))
return withContext(context -> setManifestWithResponse(BinaryData.fromObject(manifest), tag, ManifestMediaType.OCI_IMAGE_MANIFEST, context))
.flatMap(FluxUtil::toMono);
}

Expand Down Expand Up @@ -239,7 +239,7 @@ public Mono<UploadRegistryBlobResult> uploadBlob(BinaryData content) {
* <pre>
* contentClient.getManifest&#40;&quot;latest&quot;&#41;
* .doOnNext&#40;downloadResult -&gt; &#123;
* if &#40;ManifestMediaType.OCI_MANIFEST.equals&#40;downloadResult.getManifestMediaType&#40;&#41;&#41;
* if &#40;ManifestMediaType.OCI_IMAGE_MANIFEST.equals&#40;downloadResult.getManifestMediaType&#40;&#41;&#41;
* || ManifestMediaType.DOCKER_MANIFEST.equals&#40;downloadResult.getManifestMediaType&#40;&#41;&#41;&#41; &#123;
* OciImageManifest manifest = downloadResult.getManifest&#40;&#41;.toObject&#40;OciImageManifest.class&#41;;
* System.out.println&#40;&quot;Got OCI manifest&quot;&#41;;
Expand Down Expand Up @@ -273,7 +273,7 @@ public Mono<GetManifestResult> getManifest(String tagOrDigest) {
* contentClient.getManifestWithResponse&#40;&quot;latest&quot;&#41;
* .doOnNext&#40;response -&gt; &#123;
* GetManifestResult manifestResult = response.getValue&#40;&#41;;
* if &#40;ManifestMediaType.OCI_MANIFEST.equals&#40;manifestResult.getManifestMediaType&#40;&#41;&#41;
* if &#40;ManifestMediaType.OCI_IMAGE_MANIFEST.equals&#40;manifestResult.getManifestMediaType&#40;&#41;&#41;
* || ManifestMediaType.DOCKER_MANIFEST.equals&#40;manifestResult.getManifestMediaType&#40;&#41;&#41;&#41; &#123;
* OciImageManifest manifest = manifestResult.getManifest&#40;&#41;.toObject&#40;OciImageManifest.class&#41;;
* System.out.println&#40;&quot;Got OCI manifest&quot;&#41;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public String getEndpoint() {
@ServiceMethod(returns = ReturnType.SINGLE)
public SetManifestResult setManifest(OciImageManifest manifest, String tag) {
Objects.requireNonNull(manifest, "'manifest' cannot be null.");
return setManifestWithResponse(BinaryData.fromObject(manifest), tag, ManifestMediaType.OCI_MANIFEST, Context.NONE).getValue();
return setManifestWithResponse(BinaryData.fromObject(manifest), tag, ManifestMediaType.OCI_IMAGE_MANIFEST, Context.NONE).getValue();
}

/**
Expand Down Expand Up @@ -248,7 +248,7 @@ public UploadRegistryBlobResult uploadBlob(BinaryData content, Context context)
* <pre>
* GetManifestResult latestResult = contentClient.getManifest&#40;&quot;latest&quot;&#41;;
* if &#40;ManifestMediaType.DOCKER_MANIFEST.equals&#40;latestResult.getManifestMediaType&#40;&#41;&#41;
* || ManifestMediaType.OCI_MANIFEST.equals&#40;latestResult.getManifestMediaType&#40;&#41;&#41;&#41; &#123;
* || ManifestMediaType.OCI_IMAGE_MANIFEST.equals&#40;latestResult.getManifestMediaType&#40;&#41;&#41;&#41; &#123;
* OciImageManifest manifest = latestResult.getManifest&#40;&#41;.toObject&#40;OciImageManifest.class&#41;;
* &#125; else &#123;
* throw new IllegalArgumentException&#40;&quot;Unexpected manifest type: &quot; + latestResult.getManifestMediaType&#40;&#41;&#41;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public final class UtilsImpl {
public static final HttpHeaderName DOCKER_DIGEST_HEADER_NAME = HttpHeaderName.fromString("docker-content-digest");

public static final String SUPPORTED_MANIFEST_TYPES = "*/*"
+ "," + ManifestMediaType.OCI_MANIFEST
+ "," + ManifestMediaType.OCI_IMAGE_MANIFEST
+ "," + ManifestMediaType.DOCKER_MANIFEST
+ ",application/vnd.oci.image.index.v1+json"
+ ",application/vnd.docker.distribution.manifest.list.v2+json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/** Properties of this repository. */
@Fluent
public class ContainerRepositoryProperties implements JsonSerializable<ContainerRepositoryProperties> {
public final class ContainerRepositoryProperties implements JsonSerializable<ContainerRepositoryProperties> {
Comment thread
lmolkova marked this conversation as resolved.
Outdated
/*
* Registry login server name. This is likely to be similar to {registry-name}.azurecr.io.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class ManifestMediaType extends ExpandableStringEnum<ManifestMediaT
/**
* OCI manifest content type.
*/
public static final ManifestMediaType OCI_MANIFEST = fromString("application/vnd.oci.image.manifest.v1+json");
public static final ManifestMediaType OCI_IMAGE_MANIFEST = fromString("application/vnd.oci.image.manifest.v1+json");

@Deprecated
ManifestMediaType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class SetManifestOptions {
public SetManifestOptions(OciImageManifest ociImageManifest) {
Objects.requireNonNull(ociImageManifest, "'ociManifest' can't be null.");
this.manifest = BinaryData.fromObject(ociImageManifest);
this.mediaType = ManifestMediaType.OCI_MANIFEST;
this.mediaType = ManifestMediaType.OCI_IMAGE_MANIFEST;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void getManifest() {
// BEGIN: com.azure.containers.containerregistry.getManifestTag
GetManifestResult latestResult = contentClient.getManifest("latest");
if (ManifestMediaType.DOCKER_MANIFEST.equals(latestResult.getManifestMediaType())
|| ManifestMediaType.OCI_MANIFEST.equals(latestResult.getManifestMediaType())) {
|| ManifestMediaType.OCI_IMAGE_MANIFEST.equals(latestResult.getManifestMediaType())) {
OciImageManifest manifest = latestResult.getManifest().toObject(OciImageManifest.class);
} else {
throw new IllegalArgumentException("Unexpected manifest type: " + latestResult.getManifestMediaType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void getManifest() {
// BEGIN: com.azure.containers.containerregistry.getManifestAsync
contentClient.getManifest("latest")
.doOnNext(downloadResult -> {
if (ManifestMediaType.OCI_MANIFEST.equals(downloadResult.getManifestMediaType())
if (ManifestMediaType.OCI_IMAGE_MANIFEST.equals(downloadResult.getManifestMediaType())
|| ManifestMediaType.DOCKER_MANIFEST.equals(downloadResult.getManifestMediaType())) {
OciImageManifest manifest = downloadResult.getManifest().toObject(OciImageManifest.class);
System.out.println("Got OCI manifest");
Expand All @@ -149,7 +149,7 @@ private static void getManifestWithResponse() {
contentClient.getManifestWithResponse("latest")
.doOnNext(response -> {
GetManifestResult manifestResult = response.getValue();
if (ManifestMediaType.OCI_MANIFEST.equals(manifestResult.getManifestMediaType())
if (ManifestMediaType.OCI_IMAGE_MANIFEST.equals(manifestResult.getManifestMediaType())
|| ManifestMediaType.DOCKER_MANIFEST.equals(manifestResult.getManifestMediaType())) {
OciImageManifest manifest = manifestResult.getManifest().toObject(OciImageManifest.class);
System.out.println("Got OCI manifest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void canUploadOciManifestBinaryData(HttpClient httpClient) {
client = getContentClient("oci-artifact", httpClient);
setManifestPrerequisites();

SetManifestOptions options = new SetManifestOptions(BinaryData.fromObject(MANIFEST), ManifestMediaType.OCI_MANIFEST);
SetManifestOptions options = new SetManifestOptions(BinaryData.fromObject(MANIFEST), ManifestMediaType.OCI_IMAGE_MANIFEST);
SetManifestResult result = client.setManifestWithResponse(options, Context.NONE).getValue();
assertNotNull(result);
assertNotNull(result.getDigest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
public class ContainerRegistryContentClientTests {
private static final BinaryData SMALL_CONTENT = BinaryData.fromString("foobar");
private static final String SMALL_CONTENT_SHA256 = "sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2";
private static final String DEFAULT_MANIFEST_CONTENT_TYPE = "*/*," + ManifestMediaType.OCI_MANIFEST + "," + ManifestMediaType.DOCKER_MANIFEST + ",application/vnd.oci.image.index.v1+json"
private static final String DEFAULT_MANIFEST_CONTENT_TYPE = "*/*," + ManifestMediaType.OCI_IMAGE_MANIFEST + "," + ManifestMediaType.DOCKER_MANIFEST + ",application/vnd.oci.image.index.v1+json"
+ ",application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.cncf.oras.artifact.manifest.v1+json";
private static final BinaryData MANIFEST_DATA = BinaryData.fromObject(MANIFEST);
private static final BinaryData OCI_INDEX = BinaryData.fromString("{\"schemaVersion\":2,\"mediaType\":\"application/vnd.oci.image.index.v1+json\","
Expand Down Expand Up @@ -166,7 +166,7 @@ public void getManifest() {

assertArrayEquals(MANIFEST_DATA.toBytes(), result.getManifest().toBytes());
assertNotNull(result.getManifest().toObject(ManifestMediaType.class));
assertEquals(ManifestMediaType.OCI_MANIFEST, result.getManifestMediaType());
assertEquals(ManifestMediaType.OCI_IMAGE_MANIFEST, result.getManifestMediaType());
}

@SyncAsyncTest
Expand Down Expand Up @@ -469,7 +469,7 @@ public static HttpClient createClientManifests(BinaryData content, String digest
assertEquals(DEFAULT_MANIFEST_CONTENT_TYPE, request.getHeaders().getValue(HttpHeaderName.ACCEPT));
HttpHeaders headers = new HttpHeaders()
.add(UtilsImpl.DOCKER_DIGEST_HEADER_NAME, digest)
.add(HttpHeaderName.CONTENT_TYPE, returnContentType == null ? ManifestMediaType.OCI_MANIFEST.toString() : returnContentType.toString())
.add(HttpHeaderName.CONTENT_TYPE, returnContentType == null ? ManifestMediaType.OCI_IMAGE_MANIFEST.toString() : returnContentType.toString())
.add(HttpHeaderName.CONTENT_LENGTH, content.getLength().toString());
return new MockHttpResponse(request, 200, headers, content.toBytes());
});
Expand Down