Skip to content

Commit

Permalink
update code based on comments
Browse files Browse the repository at this point in the history
Signed-off-by: nhu1997 <[email protected]>
  • Loading branch information
nhu1997 committed Nov 12, 2024
1 parent ce21442 commit ca03e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/OrasProject.Oras/Packer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public static class Packer
/// </summary>
private const string _errMissingArtifactType = "missing artifact type";

public const string UnknownConfig = "application/vnd.unknown.config.v1+json";
public const string MediaTypeUnknownConfig = "application/vnd.unknown.config.v1+json";

public const string UnknownArtifact = "application/vnd.unknown.artifact.v1";
public const string MediaTypeUnknownArtifact = "application/vnd.unknown.artifact.v1";

/// <summary>
/// ManifestVersion represents the manifest version used for PackManifest
Expand Down Expand Up @@ -143,7 +143,7 @@ private static async Task<Descriptor> PackManifestV1_0Async(IPushable pusher, st
{
if (string.IsNullOrEmpty(artifactType))
{
artifactType = UnknownConfig;
artifactType = MediaTypeUnknownConfig;
}
ValidateMediaType(artifactType);
configDescriptor = await PushCustomEmptyConfigAsync(pusher, artifactType, options.ConfigAnnotations, cancellationToken);
Expand Down
4 changes: 2 additions & 2 deletions tests/OrasProject.Oras.Tests/PackerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ public async Task TestPackManifestImageV1_0_NoArtifactType()

// Verify artifact type and config media type

Assert.Equal(Packer.UnknownConfig, manifestDesc.ArtifactType);
Assert.Equal(Packer.UnknownConfig, manifest!.Config.MediaType);
Assert.Equal(Packer.MediaTypeUnknownConfig, manifestDesc.ArtifactType);
Assert.Equal(Packer.MediaTypeUnknownConfig, manifest!.Config.MediaType);
}

[Fact]
Expand Down

0 comments on commit ca03e9e

Please sign in to comment.