Skip to content

Commit

Permalink
fix acr test failure (#22290)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadelesh authored Jan 25, 2024
1 parent c87ebea commit 01fa694
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/containers/azcontainerregistry/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/containers/azcontainerregistry",
"Tag": "go/containers/azcontainerregistry_9579d04096"
"Tag": "go/containers/azcontainerregistry_cc8575d275"
}
4 changes: 2 additions & 2 deletions sdk/containers/azcontainerregistry/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,12 @@ func TestClient_UploadManifest(t *testing.T) {
ctx := context.Background()
client, err := NewClient(endpoint, cred, &ClientOptions{ClientOptions: options})
require.NoError(t, err)
getRes, err := client.GetManifest(ctx, "hello-world", "latest", &ClientGetManifestOptions{Accept: to.Ptr("application/vnd.docker.distribution.manifest.v2+json")})
getRes, err := client.GetManifest(ctx, "hello-world", "latest", &ClientGetManifestOptions{Accept: to.Ptr("application/vnd.oci.image.index.v1+json")})
require.NoError(t, err)
manifest, err := io.ReadAll(getRes.ManifestData)
require.NoError(t, err)
reader := bytes.NewReader(manifest)
uploadRes, err := client.UploadManifest(ctx, "hello-world", "test", "application/vnd.docker.distribution.manifest.v2+json", streaming.NopCloser(reader), nil)
uploadRes, err := client.UploadManifest(ctx, "hello-world", "test", "application/vnd.oci.image.index.v1+json", streaming.NopCloser(reader), nil)
require.NoError(t, err)
require.NotEmpty(t, *uploadRes.DockerContentDigest)
fmt.Printf("uploaded manifest digest: %s\n", *uploadRes.DockerContentDigest)
Expand Down
2 changes: 1 addition & 1 deletion sdk/containers/azcontainerregistry/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func run(m *testing.M) int {
panic(err)
}
}
if recording.GetRecordMode() == recording.LiveMode {
if recording.GetRecordMode() == recording.LiveMode || recording.GetRecordMode() == recording.RecordingMode {
var clientCloud cloud.Configuration
if cloudEnv, ok := os.LookupEnv("AZCONTAINERREGISTRY_ENVIRONMENT"); ok {
if strings.EqualFold(cloudEnv, "AzureUSGovernment") {
Expand Down

0 comments on commit 01fa694

Please sign in to comment.