Skip to content

Commit 7a40f49

Browse files
authored
Merge branch 'dotnet:master' into master-plus-models-update
2 parents bcf12b1 + 86eb07c commit 7a40f49

9 files changed

Lines changed: 326 additions & 299 deletions

File tree

Directory.Build.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
<!-- Strong-naming -->
3+
<PropertyGroup Label="Signing">
4+
<SignAssembly>true</SignAssembly>
5+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\Key.snk</AssemblyOriginatorKeyFile>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<!-- Defines the StrongNamePublicKeys class with constant which contains the repo identity public key formatted for use in InternalsVisibleTo attributes. -->
9+
<Compile Include="$(MSBuildThisFileDirectory)\StrongNamePublicKeys.cs" Visible="false" />
10+
</ItemGroup>
11+
</Project>

Key.snk

596 Bytes
Binary file not shown.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,16 @@ Here are typical exceptions thrown from the client library:
247247

248248
## .NET Foundation
249249

250-
Docker.DotNet is a [.NET Foundation](https://www.dotnetfoundation.org/projects) project.
250+
Docker.DotNet is a [.NET Foundation](https://www.dotnetfoundation.org) project.
251251

252252
There are many .NET related projects on GitHub.
253253

254254
- [.NET home repo](https://github.com/Microsoft/dotnet) - links to 100s of .NET projects, from Microsoft and the community.
255-
- [ASP.NET Core home](https://docs.microsoft.com/aspnet/core/?view=aspnetcore-3.1) - the best place to start learning about ASP.NET Core.
255+
- [ASP.NET Core home](https://docs.microsoft.com/aspnet/core) - the best place to start learning about ASP.NET Core.
256256

257257
This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](http://www.dotnetfoundation.org/code-of-conduct).
258258

259-
General .NET OSS discussions: [.NET Foundation forums](https://forums.dotnetfoundation.org)
259+
General .NET OSS discussions: [.NET Foundation Discord](https://dotnetfoundation.org/socialize/discord)
260260

261261
## Contributing
262262

StrongNamePublicKeys.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <summary>
2+
/// Contains the repo identity public key when strong naming the assembly.
3+
/// </summary>
4+
internal static class StrongNamePublicKeys
5+
{
6+
/// <summary>
7+
/// The public key used for assemblies in this repo (Key.snk).
8+
/// </summary>
9+
public const string DockerDotNetPublicKey = ", PublicKey=002400000480000094000000060200000024000052534131000400000100010013a6d952388480a1ce272e8c8ac11d710668c8723e696a421190445a1e6198288112f5e04eb99a626f8bb1454cdf30ebfb0a09cb7fc7b299cb03aa6fea1ae9a58f05f9fb92a85ce82ad4490bb2f0074822d8b0a786684f26a6eb1765f9026dae4857925b4e077d04b6311bec7dacf8e8a031dcc9f7e0384bca914256abee25d9";
10+
}

src/Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<Project>
2+
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
4+
25
<PropertyGroup>
36
<IsPackable>true</IsPackable>
47
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>

src/Docker.DotNet/DockerClient.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,18 @@ await HandleIfErrorResponseAsync(response.StatusCode, response, errorHandlers)
286286
.ConfigureAwait(false);
287287
}
288288

289-
internal Task<HttpResponseMessage> MakeRequestForRawResponseAsync(
289+
internal async Task<HttpResponseMessage> MakeRequestForRawResponseAsync(
290290
HttpMethod method,
291291
string path,
292292
IQueryString queryString,
293293
IRequestContent body,
294294
IDictionary<string, string> headers,
295295
CancellationToken token)
296296
{
297-
return PrivateMakeRequestAsync(SInfiniteTimeout, HttpCompletionOption.ResponseHeadersRead, method, path, queryString, headers, body, token);
297+
var response = await PrivateMakeRequestAsync(SInfiniteTimeout, HttpCompletionOption.ResponseHeadersRead, method, path, queryString, headers, body, token).ConfigureAwait(false);
298+
await HandleIfErrorResponseAsync(response.StatusCode, response)
299+
.ConfigureAwait(false);
300+
return response;
298301
}
299302

300303
internal async Task<DockerApiStreamedResponse> MakeRequestForStreamedResponseAsync(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
using System.Runtime.CompilerServices;
22

3-
[assembly: InternalsVisibleTo("Docker.DotNet.Tests")]
3+
[assembly: InternalsVisibleTo("Docker.DotNet.Tests" + StrongNamePublicKeys.DockerDotNetPublicKey)]

test/Docker.DotNet.Tests/IImageOperationsTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ await _dockerClient.Images.TagImageAsync(
6969
Assert.True(createImageTask.IsCanceled);
7070
}
7171

72+
[Fact]
73+
public Task CreateImageAsync_ErrorResponse_ThrowsDockerApiException()
74+
{
75+
return Assert.ThrowsAsync<DockerApiException>(() => _dockerClient.Images.CreateImageAsync(
76+
new ImagesCreateParameters()
77+
{
78+
FromImage = "1.2.3.Apparently&this$is+not-a_valid%repository//name",
79+
Tag = "ancient-one"
80+
}, null, null));
81+
}
82+
7283
[Fact]
7384
public async Task DeleteImageAsync_RemovesImage()
7485
{

0 commit comments

Comments
 (0)